summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2008-10-27 12:07:44 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-10-29 14:54:41 -0700
commit61fbeba11c553c489ba5284c0ed67067dc7b7c0f (patch)
treec8f71dc1dd86c81712d4c9f5cf59b70826eb54d5 /drivers/usb
parent74511bb340059be5a3fceb032213c7f325344694 (diff)
downloadop-kernel-dev-61fbeba11c553c489ba5284c0ed67067dc7b7c0f.zip
op-kernel-dev-61fbeba11c553c489ba5284c0ed67067dc7b7c0f.tar.gz
USB: prevent autosuspend during hub initialization
This patch (as1153) fixes a potential problem in hub initialization. Starting in 2.6.28, initialization was split into several tasks to help speed up booting. This opens the possibility that the hub may be autosuspended before all the initialization tasks can complete. Normally that wouldn't matter, but with incomplete initialization there is a risk that the hub would never autoresume -- especially if devices were plugged into the hub beforehand. The solution is a simple one-line change to suppress autosuspend until the initialization is finished. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/hub.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 37ff8ae..b19cbfc 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -659,6 +659,9 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
PREPARE_DELAYED_WORK(&hub->init_work, hub_init_func2);
schedule_delayed_work(&hub->init_work,
msecs_to_jiffies(delay));
+
+ /* Suppress autosuspend until init is done */
+ to_usb_interface(hub->intfdev)->pm_usage_cnt = 1;
return; /* Continues at init2: below */
} else {
hub_power_on(hub, true);
OpenPOWER on IntegriCloud