summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/hub.h
diff options
context:
space:
mode:
authorAlan Stern2014-05-21 03:08:07 +0200
committerGreg Kroah-Hartman2014-05-28 01:28:03 +0200
commit600856c231ccb0cbf8afcf09066a8ab2a93ab03d (patch)
treeaa8e9074adccb30ecbd6ac8aa2dce377e0c5a834 /drivers/usb/core/hub.h
parentusb: pci_quirks: fix sparse 'symbol not declared' warning (diff)
downloadkernel-qcow2-linux-600856c231ccb0cbf8afcf09066a8ab2a93ab03d.tar.gz
kernel-qcow2-linux-600856c231ccb0cbf8afcf09066a8ab2a93ab03d.tar.xz
kernel-qcow2-linux-600856c231ccb0cbf8afcf09066a8ab2a93ab03d.zip
USB: mutual exclusion for resetting a hub and power-managing a port
The USB core doesn't properly handle mutual exclusion between resetting a hub and changing the power states of the hub's ports. We need to avoid sending port-power requests to the hub while it is being reset, because such requests cannot succeed. This patch fixes the problem by keeping track of when a reset is in progress. At such times, attempts to suspend (power-off) a port will fail immediately with -EBUSY, and calls to usb_port_runtime_resume() will update the power_is_on flag and return immediately. When the reset is complete, hub_activate() will automatically restore each port to the proper power state. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/hub.h')
-rw-r--r--drivers/usb/core/hub.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h
index 33bcb2c6f90a..f9b521e60128 100644
--- a/drivers/usb/core/hub.h
+++ b/drivers/usb/core/hub.h
@@ -66,6 +66,7 @@ struct usb_hub {
unsigned limited_power:1;
unsigned quiescing:1;
unsigned disconnected:1;
+ unsigned in_reset:1;
unsigned quirk_check_port_auto_suspend:1;