xhci: Resume bus on any port status change.
commit7111ebc97ed53a32314011c85a6f235f0dab8ae8
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Tue, 14 Dec 2010 21:24:55 +0000 (14 13:24 -0800)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Fri, 14 Jan 2011 23:28:51 +0000 (14 15:28 -0800)
treecff5a9e5c2fb231fc7933b89aa2e17ec180ca3cf
parente0e736fc0d33861335e2a132e4f688f7fd380c61
xhci: Resume bus on any port status change.

The original code that resumed the USB bus on a port status change would
only do so when there was a device connected to the port.  If a device was
just disconnected, the event would be queued for khubd, but khubd wouldn't
run.  That would leave the connect status change (CSC) bit set.

If a USB device was plugged into that same port, the xHCI host controller
would set the current connect status (CCS) bit.  But since the CSC bit was
already set, it would not generate an interrupt for a port status change
event.  That would mean the user could "Safely Remove" a device, have the
bus suspend, disconnect the device, re-plug it in, and then the device
would never be enumerated.

Plugging in a different device on another port would cause the bus to
resume, and khubd would notice the re-connected device.  Running lsusb
would also resume the bus, leading users to report the problem "went away"
when using diagnostic tools.

The solution is to resume the bus when a port status change event is
received, regardless of the port status.

Thank you very much to Maddog for helping me track down this Heisenbug.

This patch should be queued for the 2.6.37 stable tree.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: Jon 'maddog' Hall <maddog@li.org>
Tested-by: Andiry Xu <andiry.xu@amd.com>
Cc: stable@kernel.org
drivers/usb/host/xhci-ring.c