From 600856c231ccb0cbf8afcf09066a8ab2a93ab03d Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Tue, 20 May 2014 18:08:07 -0700 Subject: 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 Signed-off-by: Dan Williams Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/hub.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/usb/core/hub.h') diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h index 33bcb2c..f9b521e 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; -- cgit v1.1