linux_old1/drivers/usb/dwc2
Douglas Anderson 1fb7f12d5b usb: dwc2: host: Fix remote wakeup when not in DWC2_L2
In commit 734643dfbd ("usb: dwc2: host: add flag to reflect bus
state") we changed dwc2_port_suspend() not to set the lx_state
anymore (instead it sets the new bus_suspended variable).  This
introduced a bug where we would fail to detect device insertions if:

1. Plug empty hub into dwc2
2. Plug USB flash drive into the empty hub.
3. Wait a few seconds
4. Unplug USB flash drive
5. Less than 2 seconds after step 4, plug the USB flash drive in again.

The dwc2_hcd_rem_wakeup() function should have been changed to look at
the new bus_suspended variable.

Let's fix it.  Since commit b46146d59f ("usb: dwc2: host: resume root
hub on remote wakeup") talks about needing the root hub resumed if the
bus was suspended, we'll include it in our test.

It appears that the "port_l1_change" should only be set to 1 if we were
in DWC2_L1 (the driver currently never sets this), so we'll update the
former "else" case based on this test.

Fixes: 734643dfbd ("usb: dwc2: host: add flag to reflect bus state")
Acked-by: John Youn <johnyoun@synopsys.com>
Tested-by: Gregory Herrero <gregory.herrero@intel.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-11-17 11:35:38 -06:00
..
Kconfig usb: dwc2: remove dwc2_platform.ko 2015-04-29 15:20:11 -05:00
Makefile usb: dwc2: remove dwc2_platform.ko 2015-04-29 15:20:11 -05:00
core.c usb: dwc2: fix duplicate argument warning 2015-10-13 13:17:42 -05:00
core.h usb: dwc2: refactor common low-level hw code to platform.c 2015-10-14 08:40:15 -05:00
core_intr.c usb: dwc2: exit hibernation on session request 2015-10-01 12:40:27 -05:00
debug.h usb: dwc2: move debugfs code to a separate file 2015-04-29 15:18:25 -05:00
debugfs.c usb: dwc2: Use platform endianness when accessing registers 2015-09-27 10:54:31 -05:00
gadget.c usb: dwc2: refactor common low-level hw code to platform.c 2015-10-14 08:40:15 -05:00
hcd.c usb: dwc2: host: Fix remote wakeup when not in DWC2_L2 2015-11-17 11:35:38 -06:00
hcd.h usb: dwc2: Use platform endianness when accessing registers 2015-09-27 10:54:31 -05:00
hcd_ddma.c usb: dwc2: Use platform endianness when accessing registers 2015-09-27 10:54:31 -05:00
hcd_intr.c usb: dwc2: host: Fix use after free w/ simultaneous irqs 2015-10-19 09:22:46 -05:00
hcd_queue.c usb: dwc2: host: use correct frame number during qh init 2015-10-01 12:40:18 -05:00
hw.h usb: dwc2: gadget: parity fix in isochronous mode 2015-10-02 13:10:57 -05:00
pci.c usb: dwc2: pci: Add device mode to the dwc2-pci driver 2015-03-11 15:08:17 -05:00
platform.c usb: dwc2: host: Fix ahbcfg for rk3066 2015-11-17 11:29:52 -06:00