diff options
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r-- | drivers/usb/core/hub.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index bee13517676f..1d5fc32d06d0 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1052,14 +1052,11 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) | |||
1052 | 1052 | ||
1053 | /* Continue a partial initialization */ | 1053 | /* Continue a partial initialization */ |
1054 | if (type == HUB_INIT2 || type == HUB_INIT3) { | 1054 | if (type == HUB_INIT2 || type == HUB_INIT3) { |
1055 | device_lock(hub->intfdev); | 1055 | device_lock(&hdev->dev); |
1056 | 1056 | ||
1057 | /* Was the hub disconnected while we were waiting? */ | 1057 | /* Was the hub disconnected while we were waiting? */ |
1058 | if (hub->disconnected) { | 1058 | if (hub->disconnected) |
1059 | device_unlock(hub->intfdev); | 1059 | goto disconnected; |
1060 | kref_put(&hub->kref, hub_release); | ||
1061 | return; | ||
1062 | } | ||
1063 | if (type == HUB_INIT2) | 1060 | if (type == HUB_INIT2) |
1064 | goto init2; | 1061 | goto init2; |
1065 | goto init3; | 1062 | goto init3; |
@@ -1262,7 +1259,7 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) | |||
1262 | queue_delayed_work(system_power_efficient_wq, | 1259 | queue_delayed_work(system_power_efficient_wq, |
1263 | &hub->init_work, | 1260 | &hub->init_work, |
1264 | msecs_to_jiffies(delay)); | 1261 | msecs_to_jiffies(delay)); |
1265 | device_unlock(hub->intfdev); | 1262 | device_unlock(&hdev->dev); |
1266 | return; /* Continues at init3: below */ | 1263 | return; /* Continues at init3: below */ |
1267 | } else { | 1264 | } else { |
1268 | msleep(delay); | 1265 | msleep(delay); |
@@ -1281,12 +1278,12 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) | |||
1281 | /* Scan all ports that need attention */ | 1278 | /* Scan all ports that need attention */ |
1282 | kick_hub_wq(hub); | 1279 | kick_hub_wq(hub); |
1283 | 1280 | ||
1284 | /* Allow autosuspend if it was suppressed */ | 1281 | if (type == HUB_INIT2 || type == HUB_INIT3) { |
1285 | if (type <= HUB_INIT3) | 1282 | /* Allow autosuspend if it was suppressed */ |
1283 | disconnected: | ||
1286 | usb_autopm_put_interface_async(to_usb_interface(hub->intfdev)); | 1284 | usb_autopm_put_interface_async(to_usb_interface(hub->intfdev)); |
1287 | 1285 | device_unlock(&hdev->dev); | |
1288 | if (type == HUB_INIT2 || type == HUB_INIT3) | 1286 | } |
1289 | device_unlock(hub->intfdev); | ||
1290 | 1287 | ||
1291 | kref_put(&hub->kref, hub_release); | 1288 | kref_put(&hub->kref, hub_release); |
1292 | } | 1289 | } |
@@ -1315,8 +1312,6 @@ static void hub_quiesce(struct usb_hub *hub, enum hub_quiescing_type type) | |||
1315 | struct usb_device *hdev = hub->hdev; | 1312 | struct usb_device *hdev = hub->hdev; |
1316 | int i; | 1313 | int i; |
1317 | 1314 | ||
1318 | cancel_delayed_work_sync(&hub->init_work); | ||
1319 | |||
1320 | /* hub_wq and related activity won't re-trigger */ | 1315 | /* hub_wq and related activity won't re-trigger */ |
1321 | hub->quiescing = 1; | 1316 | hub->quiescing = 1; |
1322 | 1317 | ||