linux-stable/drivers/usb/dwc3
Zeng Tao 38152b626b usb: dwc3: gadget: Fix the uninitialized link_state when udc starts
[ Upstream commit 88b1bb1f3b ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-03-05 17:57:04 +01:00
..
core.c usb: dwc3: core: Clean up ULPI device 2018-12-01 09:44:18 +01:00
core.h usb: dwc3: Update DWC_usb31 GTXFIFOSIZ reg fields 2018-05-25 16:13:03 +02:00
debug.c
debug.h
debugfs.c
dwc3-exynos.c usb: dwc3: exynos fix axius clock error path to do cleanup 2017-06-24 07:11:17 +02:00
dwc3-keystone.c usb: dwc3: keystone: check return value 2018-04-13 19:47:58 +02:00
dwc3-of-simple.c usb: dwc3: of-simple: fix use-after-free on remove 2018-08-24 13:12:26 +02:00
dwc3-omap.c usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq 2018-11-10 07:42:50 -08:00
dwc3-pci.c usb: dwc3: pci: Properly cleanup resource 2018-04-24 09:34:11 +02:00
dwc3-st.c usb: dwc3: replace %p with %pK 2017-07-12 15:01:03 +02:00
ep0.c
gadget.c usb: dwc3: gadget: Fix the uninitialized link_state when udc starts 2019-03-05 17:57:04 +01:00
gadget.h
host.c
io.h
Kconfig
Makefile
trace.c
trace.h
ulpi.c