android_kernel_sony_sdm845/drivers/usb
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Kai-Heng Feng dfa2cacd9f xhci: Poll for U0 after disabling USB2 LPM
[ Upstream commit b3d71abd135e6919ca0b6cab463738472653ddfb ]

USB2 devices with LPM enabled may interrupt the system suspend:
[  932.510475] usb 1-7: usb suspend, wakeup 0
[  932.510549] hub 1-0:1.0: hub_suspend
[  932.510581] usb usb1: bus suspend, wakeup 0
[  932.510590] xhci_hcd 0000:00:14.0: port 9 not suspended
[  932.510593] xhci_hcd 0000:00:14.0: port 8 not suspended
..
[  932.520323] xhci_hcd 0000:00:14.0: Port change event, 1-7, id 7, portsc: 0x400e03
..
[  932.591405] PM: pci_pm_suspend(): hcd_pci_suspend+0x0/0x30 returns -16
[  932.591414] PM: dpm_run_callback(): pci_pm_suspend+0x0/0x160 returns -16
[  932.591418] PM: Device 0000:00:14.0 failed to suspend async: error -16

During system suspend, USB core will let HC suspends the device if it
doesn't have remote wakeup enabled and doesn't have any children.
However, from the log above we can see that the usb 1-7 doesn't get bus
suspended due to not in U0. After a while the port finished U2 -> U0
transition, interrupts the suspend process.

The observation is that after disabling LPM, port doesn't transit to U0
immediately and can linger in U2. xHCI spec 4.23.5.2 states that the
maximum exit latency for USB2 LPM should be BESL + 10us. The BESL for
the affected device is advertised as 400us, which is still not enough
based on my testing result.

So let's use the maximum permitted latency, 10000, to poll for U0
status to solve the issue.

Cc: stable@vger.kernel.org
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20200624135949.22611-6-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-30 15:38:41 -04:00
..
atm USB: atm: ueagle-atm: add missing endpoint check 2019-12-21 10:41:53 +01:00
c67x00
chipidea usb: chipidea: host: Disable port power only if previously enabled 2020-01-14 20:04:25 +01:00
class cdc-acm: Add DISABLE_ECHO quirk for Microchip/SMSC chip 2020-06-30 15:38:41 -04:00
common usb: common: Consider only available nodes for dr_mode 2019-04-03 06:24:19 +02:00
core usb: add USB_QUIRK_DELAY_INIT for Logitech C922 2020-06-30 15:38:40 -04:00
dwc2 usb: dwc2: Postponed gadget registration to the udc class driver 2020-06-30 15:38:40 -04:00
dwc3 usb: dwc3: don't set gadget->is_otg flag 2020-04-13 10:32:59 +02:00
early treewide: remove redundant #include <linux/kconfig.h> 2016-10-11 15:06:33 -07:00
gadget usb: gadget: Fix issue with config_ep_by_speed function 2020-06-30 15:38:27 -04:00
host xhci: Poll for U0 after disabling USB2 LPM 2020-06-30 15:38:41 -04:00
image USB: microtek: fix info-leak at probe 2019-10-17 13:42:38 -07:00
isp1760
misc USB: sisusbvga: Change port variable from signed to unsigned 2020-05-02 17:23:10 +02:00
mon usb: mon: Fix a deadlock in usbmon between mmap and read 2019-12-21 10:41:56 +01:00
musb usb: musb: Fix runtime PM imbalance on error 2020-06-11 09:22:22 +02:00
phy usb: gadget: fsl: fix link error against usb-gadget module 2020-01-29 10:24:22 +01:00
renesas_usbhs usb: renesas_usbhs: add suspend event support in gadget mode 2020-01-04 13:39:14 +01:00
serial USB: serial: option: add Telit LE910C1-EUX compositions 2020-06-11 09:22:22 +02:00
storage USB: uas: add quirk for LaCie 2Big Quadra 2020-05-20 08:15:27 +02:00
usbip usbip: Fix error path of vhci_recv_ret_submit() 2020-01-04 13:40:20 +01:00
wusbcore usb: wusbcore: security: cast sizeof to int for comparison 2018-10-03 17:01:45 -07:00
Kconfig usb: Move USB_UHCI_BIG_ENDIAN_* out of USB_SUPPORT 2018-02-22 15:43:51 +01:00
Makefile
README
usb-skeleton.c USB: usb-skeleton: fix NULL-deref on disconnect 2019-10-17 13:42:29 -07:00

To understand all the Linux-USB framework, you'll use these resources:

    * This source code.  This is necessarily an evolving work, and
      includes kerneldoc that should help you get a current overview.
      ("make pdfdocs", and then look at "usb.pdf" for host side and
      "gadget.pdf" for peripheral side.)  Also, Documentation/usb has
      more information.

    * The USB 2.0 specification (from www.usb.org), with supplements
      such as those for USB OTG and the various device classes.
      The USB specification has a good overview chapter, and USB
      peripherals conform to the widely known "Chapter 9".

    * Chip specifications for USB controllers.  Examples include
      host controllers (on PCs, servers, and more); peripheral
      controllers (in devices with Linux firmware, like printers or
      cell phones); and hard-wired peripherals like Ethernet adapters.

    * Specifications for other protocols implemented by USB peripheral
      functions.  Some are vendor-specific; others are vendor-neutral
      but just standardized outside of the www.usb.org team.

Here is a list of what each subdirectory here is, and what is contained in
them.

core/		- This is for the core USB host code, including the
		  usbfs files and the hub class driver ("hub_wq").

host/		- This is for USB host controller drivers.  This
		  includes UHCI, OHCI, EHCI, and others that might
		  be used with more specialized "embedded" systems.

gadget/		- This is for USB peripheral controller drivers and
		  the various gadget drivers which talk to them.


Individual USB driver directories.  A new driver should be added to the
first subdirectory in the list below that it fits into.

image/		- This is for still image drivers, like scanners or
		  digital cameras.
../input/	- This is for any driver that uses the input subsystem,
		  like keyboard, mice, touchscreens, tablets, etc.
../media/	- This is for multimedia drivers, like video cameras,
		  radios, and any other drivers that talk to the v4l
		  subsystem.
../net/		- This is for network drivers.
serial/		- This is for USB to serial drivers.
storage/	- This is for USB mass-storage drivers.
class/		- This is for all USB device drivers that do not fit
		  into any of the above categories, and work for a range
		  of USB Class specified devices. 
misc/		- This is for all USB device drivers that do not fit
		  into any of the above categories.