linux/drivers/usb/dwc3
Zeng Tao 88b1bb1f3b usb: dwc3: gadget: Fix the uninitialized link_state when udc starts
Currently the link_state is uninitialized and the default value is 0(U0)
before the first time we start the udc, and after we start the udc then
 stop the udc, the link_state will be undefined.
We may have the following warnings if we start the udc again with
an undefined link_state:

WARNING: CPU: 0 PID: 327 at drivers/usb/dwc3/gadget.c:294 dwc3_send_gadget_ep_cmd+0x304/0x308
dwc3 100e0000.hidwc3_0: wakeup failed --> -22
[...]
Call Trace:
[<c010f270>] (unwind_backtrace) from [<c010b3d8>] (show_stack+0x10/0x14)
[<c010b3d8>] (show_stack) from [<c034a4dc>] (dump_stack+0x84/0x98)
[<c034a4dc>] (dump_stack) from [<c0118000>] (__warn+0xe8/0x100)
[<c0118000>] (__warn) from [<c0118050>](warn_slowpath_fmt+0x38/0x48)
[<c0118050>] (warn_slowpath_fmt) from [<c0442ec0>](dwc3_send_gadget_ep_cmd+0x304/0x308)
[<c0442ec0>] (dwc3_send_gadget_ep_cmd) from [<c0445e68>](dwc3_ep0_start_trans+0x48/0xf4)
[<c0445e68>] (dwc3_ep0_start_trans) from [<c0446750>](dwc3_ep0_out_start+0x64/0x80)
[<c0446750>] (dwc3_ep0_out_start) from [<c04451c0>](__dwc3_gadget_start+0x1e0/0x278)
[<c04451c0>] (__dwc3_gadget_start) from [<c04452e0>](dwc3_gadget_start+0x88/0x10c)
[<c04452e0>] (dwc3_gadget_start) from [<c045ee54>](udc_bind_to_driver+0x88/0xbc)
[<c045ee54>] (udc_bind_to_driver) from [<c045f29c>](usb_gadget_probe_driver+0xf8/0x140)
[<c045f29c>] (usb_gadget_probe_driver) from [<bf005424>](gadget_dev_desc_UDC_store+0xac/0xc4 [libcomposite])
[<bf005424>] (gadget_dev_desc_UDC_store [libcomposite]) from[<c023d8e0>] (configfs_write_file+0xd4/0x160)
[<c023d8e0>] (configfs_write_file) from [<c01d51e8>] (__vfs_write+0x1c/0x114)
[<c01d51e8>] (__vfs_write) from [<c01d5ff4>] (vfs_write+0xa4/0x168)
[<c01d5ff4>] (vfs_write) from [<c01d6d40>] (SyS_write+0x3c/0x90)
[<c01d6d40>] (SyS_write) from [<c0107400>] (ret_fast_syscall+0x0/0x3c)

Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2019-01-14 10:29:55 +02:00
..
Kconfig usb: dwc3: add EXTCON dependency for qcom 2018-10-02 10:33:43 +03:00
Makefile usb: dwc3: Add a glue driver for Synopsys HAPS platform 2018-07-26 13:47:51 +03:00
core.c usb: dwc3: Add workaround for isoc start transfer failure 2018-11-26 09:06:32 +02:00
core.h usb: dwc3: gadget: Report isoc transfer frame number 2018-12-05 11:14:15 +02:00
debug.h usb: dwc3: debugfs: Properly print/set link state for HS 2018-11-26 09:06:31 +02:00
debugfs.c usb: dwc3: debugfs: Print/set link state for peripheral mode 2018-11-26 09:06:31 +02:00
drd.c usb: dwc3: drd: Add support for DR detection through extcon 2018-11-26 09:06:32 +02:00
dwc3-exynos.c usb: dwc3: exynos: Add support for Exynos5433 variant with all clocks 2018-10-02 10:33:01 +03:00
dwc3-haps.c PCI: Move Synopsys HAPS platform device IDs 2018-12-17 16:24:39 -06:00
dwc3-keystone.c USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
dwc3-of-simple.c usb: dwc3: of-simple: avoid unused function warnings 2018-08-29 09:59:37 +03:00
dwc3-omap.c usb: dwc3: omap: don't miss events during suspend/resume 2018-02-12 10:53:18 +02:00
dwc3-pci.c Revert "usb: dwc3: pci: Use devm functions to get the phy GPIOs" 2018-12-07 08:13:32 +02:00
dwc3-qcom.c usb: dwc3: qcom: mark PM functions as __maybe_unused 2018-06-19 12:48:12 +03:00
dwc3-st.c USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
ep0.c usb: dwc3: gadget: remove redundant variable maxpacket 2018-07-13 15:41:56 +02:00
gadget.c usb: dwc3: gadget: Fix the uninitialized link_state when udc starts 2019-01-14 10:29:55 +02:00
gadget.h usb: dwc3: gadget: introduce cancelled_list 2018-11-26 09:08:29 +02:00
host.c usb: dwc3: Support option to disable USB2 LPM 2018-11-26 09:06:31 +02:00
io.h USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
trace.c USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00
trace.h usb: dwc3: trace: add missing break statement to make compiler happy 2018-12-07 07:30:18 +02:00
ulpi.c USB: dwc3: Remove redundant license text 2017-11-07 15:45:01 +01:00