usb: Add support for root hub port status CAS
authorStanislaw Ledwon <staszek.ledwon@linux.jf.intel.com>
Mon, 18 Jun 2012 13:20:00 +0000 (15:20 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 25 Jul 2012 03:11:07 +0000 (04:11 +0100)
commitdb46b26cf3a124bd5beb357e48c0e2ea6e2f1725
treef89aab10893d5e9026f34b2d8e80dad1e6fc7d85
parentf2d391c109ecc377d55f7865ac8ea26ac8921ab7
usb: Add support for root hub port status CAS

commit 8bea2bd37df08aaa599aa361a9f8b836ba98e554 upstream.

The host controller port status register supports CAS (Cold Attach
Status) bit. This bit could be set when USB3.0 device is connected
when system is in Sx state. When the system wakes to S0 this port
status with CAS bit is reported and this port can't be used by any
device.

When CAS bit is set the port should be reset by warm reset. This
was not supported by xhci driver.

The issue was found when pendrive was connected to suspended
platform. The link state of "Compliance Mode" was reported together
with CAS bit. This link state was also not supported by xhci and
core/hub.c.

The CAS bit is defined only for xhci root hub port and it is
not supported on regular hubs. The link status is used to force
warm reset on port. Make the USB core issue a warm reset when port
is in ether the 'inactive' or 'compliance mode'. Change the xHCI driver
to report 'compliance mode' when the CAS is set. This force warm reset
on the root hub port.

This patch should be backported to stable kernels as old as 3.2, that
contain the commit 10d674a82e553cb8a1f41027bb3c3e309b3f6804 "USB: When
hot reset for USB3 fails, try warm reset."

Signed-off-by: Stanislaw Ledwon <staszek.ledwon@linux.intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Acked-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/core/hub.c
drivers/usb/host/xhci-hub.c
drivers/usb/host/xhci.h