xHCI: keep track of ports being resumed and indicate in hub_status_data
authorAndiry Xu <andiry.xu@amd.com>
Fri, 13 Apr 2012 18:54:30 +0000 (02:54 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Jun 2012 07:18:23 +0000 (15:18 +0800)
commit296b8ce71ac3c48cd43d9373b444d9856cfeebff
tree41f7948e6bf9a25e4e58a70b8eb79aabef7f9ea3
parentce5833387ab9481e2d83939a4a36203e3461ef73
xHCI: keep track of ports being resumed and indicate in hub_status_data

commit f370b9968a220a3d79d870dd7dee674cc0ff3d10 upstream.

This commit adds a bit-array to xhci bus_state for keeping track of
which ports are undergoing a resume transition. If any of the bits
are set when xhci_hub_status_data() is called, the routine will return
a non-zero value even if no ports have any status changes pending.
This will allow usbcore to handle races between root-hub suspend and
port wakeup.

This patch should be backported to kernels as old as 3.4, that contain
the commit 879d38e6bc36d73b0ac40ec9b0d839fda9fa8b1a "USB: fix race
between root-hub suspend and remote wakeup".

Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-hub.c
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci.c
drivers/usb/host/xhci.h