android_kernel_motorola_sm6375/drivers/usb
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Keiya Nobuta d5b0c0eafe usb: core: hub: Improved device recognition on remote wakeup
commit 9c06ac4c83df6d6fbdbf7488fbad822b4002ba19 upstream.

If hub_activate() is called before D+ has stabilized after remote
wakeup, the following situation might occur:

         __      ___________________
        /  \    /
D+   __/    \__/

Hub  _______________________________
          |  ^   ^           ^
          |  |   |           |
Host _____v__|___|___________|______
          |  |   |           |
          |  |   |           \-- Interrupt Transfer (*3)
          |  |    \-- ClearPortFeature (*2)
          |   \-- GetPortStatus (*1)
          \-- Host detects remote wakeup

- D+ goes high, Host starts running by remote wakeup
- D+ is not stable, goes low
- Host requests GetPortStatus at (*1) and gets the following hub status:
  - Current Connect Status bit is 0
  - Connect Status Change bit is 1
- D+ stabilizes, goes high
- Host requests ClearPortFeature and thus Connect Status Change bit is
  cleared at (*2)
- After waiting 100 ms, Host starts the Interrupt Transfer at (*3)
- Since the Connect Status Change bit is 0, Hub returns NAK.

In this case, port_event() is not called in hub_event() and Host cannot
recognize device. To solve this issue, flag change_bits even if only
Connect Status Change bit is 1 when got in the first GetPortStatus.

This issue occurs rarely because it only if D+ changes during a very
short time between GetPortStatus and ClearPortFeature. However, it is
fatal if it occurs in embedded system.

Signed-off-by: Keiya Nobuta <[email protected]>
Cc: stable <[email protected]>
Acked-by: Alan Stern <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-01-23 08:22:36 +01:00
..
atm
c67x00
cdns3 usb: cdns3: should not use the same dev_id for shared interrupt handler 2020-01-14 20:08:29 +01:00
chipidea usb: chipidea: host: Disable port power only if previously enabled 2020-01-14 20:08:19 +01:00
class
common
core usb: core: hub: Improved device recognition on remote wakeup 2020-01-23 08:22:36 +01:00
dwc2
dwc3 usb: dwc3: gadget: Fix request complete check 2020-01-12 12:21:52 +01:00
early
gadget USB: dummy-hcd: use usb_urb_dir_in instead of usb_pipein 2020-01-12 12:21:10 +01:00
host usb: ohci-da8xx: ensure error return on variable error is set 2020-01-14 20:08:29 +01:00
image
isp1760
misc
mon
mtu3
musb usb: musb: dma: Correct parameter passed to IRQ handler 2020-01-14 20:08:31 +01:00
phy
renesas_usbhs
roles
serial USB: serial: quatech2: handle unbound ports 2020-01-23 08:22:35 +01:00
storage
typec USB-PD tcpm: bad warning+size, PPS adapters 2020-01-14 20:08:29 +01:00
usbip usbip: Fix error path of vhci_recv_ret_submit() 2019-12-31 16:46:05 +01:00
Kconfig
Makefile
usb-skeleton.c