linux-stable/drivers/usb/dwc3
Zeng Tao 11617a275e 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:59 +01:00
..
core.c usb: dwc3: core: Clean up ULPI device 2018-12-01 09:42:49 +01:00
core.h usb: dwc3: core: Fix ULPI PHYs and prevent phy_get/ulpi_init during suspend/resume 2018-09-15 09:45:35 +02:00
debug.h usb: dwc3: trace: decode ctrl request 2017-06-02 11:22:29 +03:00
debugfs.c usb: dwc3: debugfs: slightly improve output of trb_ring 2017-06-02 11:22:28 +03:00
drd.c usb: dwc3: Add dual-role support 2017-04-11 10:58:31 +03:00
dwc3-exynos.c usb: dwc3: exynos: Handle return value of clk_prepare_enable 2017-06-15 11:10:27 +03:00
dwc3-keystone.c usb: dwc3: keystone: Add PM_RUNTIME Support to DWC3 Keystone USB driver 2017-08-09 13:10:16 +03:00
dwc3-of-simple.c usb: dwc3: of-simple: fix use-after-free on remove 2018-08-24 13:08:57 +02:00
dwc3-omap.c usb: dwc3: omap: don't miss events during suspend/resume 2018-05-25 16:17:36 +02:00
dwc3-pci.c usb: dwc3: pci: add support for Intel IceLake 2018-08-24 13:08:56 +02:00
dwc3-st.c usb: dwc3: replace %p with %pK 2017-06-02 11:22:10 +03:00
ep0.c usb: dwc3: ep0: Reset TRB counter for ep0 IN 2018-02-28 10:19:43 +01:00
gadget.c usb: dwc3: gadget: Fix the uninitialized link_state when udc starts 2019-03-05 17:57:59 +01:00
gadget.h usb: dwc3: change stream event enable bit back to 13 2018-09-26 08:37:58 +02:00
host.c
io.h
Kconfig usb: changes for v4.12 2017-04-11 16:47:26 +02:00
Makefile usb: dwc3: Makefile: fix link error on randconfig 2018-05-25 16:17:39 +02:00
trace.c
trace.h usb: dwc3: trace: add missing break statement to make compiler happy 2019-02-12 19:46:02 +01:00
ulpi.c usb: dwc3: ulpi: conditionally resume ULPI PHY 2017-06-13 13:21:05 +03:00