diff options
| author | Jens Axboe <axboe@kernel.dk> | 2012-07-30 03:03:10 -0400 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2012-07-30 03:03:10 -0400 |
| commit | 72ea1f74fcdf874cca6d2c0962379523bbd99e2c (patch) | |
| tree | 4c67be6c73356086ff44ef1b8b1c9479702689ca /drivers/usb/core/hub.c | |
| parent | b1af9be5ef77898c05667bb9dbf3b180d91d3292 (diff) | |
| parent | a73ff3231df59a4b92ccd0dd4e73897c5822489b (diff) | |
Merge branch 'for-jens' of git://git.drbd.org/linux-drbd into for-3.6/drivers
Diffstat (limited to 'drivers/usb/core/hub.c')
| -rw-r--r-- | drivers/usb/core/hub.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 04fb834c3fa1..8fb484984c86 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
| @@ -2324,12 +2324,16 @@ static unsigned hub_is_wusb(struct usb_hub *hub) | |||
| 2324 | static int hub_port_reset(struct usb_hub *hub, int port1, | 2324 | static int hub_port_reset(struct usb_hub *hub, int port1, |
| 2325 | struct usb_device *udev, unsigned int delay, bool warm); | 2325 | struct usb_device *udev, unsigned int delay, bool warm); |
| 2326 | 2326 | ||
| 2327 | /* Is a USB 3.0 port in the Inactive state? */ | 2327 | /* Is a USB 3.0 port in the Inactive or Complinance Mode state? |
| 2328 | static bool hub_port_inactive(struct usb_hub *hub, u16 portstatus) | 2328 | * Port worm reset is required to recover |
| 2329 | */ | ||
| 2330 | static bool hub_port_warm_reset_required(struct usb_hub *hub, u16 portstatus) | ||
| 2329 | { | 2331 | { |
| 2330 | return hub_is_superspeed(hub->hdev) && | 2332 | return hub_is_superspeed(hub->hdev) && |
| 2331 | (portstatus & USB_PORT_STAT_LINK_STATE) == | 2333 | (((portstatus & USB_PORT_STAT_LINK_STATE) == |
| 2332 | USB_SS_PORT_LS_SS_INACTIVE; | 2334 | USB_SS_PORT_LS_SS_INACTIVE) || |
| 2335 | ((portstatus & USB_PORT_STAT_LINK_STATE) == | ||
| 2336 | USB_SS_PORT_LS_COMP_MOD)) ; | ||
| 2333 | } | 2337 | } |
| 2334 | 2338 | ||
| 2335 | static int hub_port_wait_reset(struct usb_hub *hub, int port1, | 2339 | static int hub_port_wait_reset(struct usb_hub *hub, int port1, |
| @@ -2365,7 +2369,7 @@ static int hub_port_wait_reset(struct usb_hub *hub, int port1, | |||
| 2365 | * | 2369 | * |
| 2366 | * See https://bugzilla.kernel.org/show_bug.cgi?id=41752 | 2370 | * See https://bugzilla.kernel.org/show_bug.cgi?id=41752 |
| 2367 | */ | 2371 | */ |
| 2368 | if (hub_port_inactive(hub, portstatus)) { | 2372 | if (hub_port_warm_reset_required(hub, portstatus)) { |
| 2369 | int ret; | 2373 | int ret; |
| 2370 | 2374 | ||
| 2371 | if ((portchange & USB_PORT_STAT_C_CONNECTION)) | 2375 | if ((portchange & USB_PORT_STAT_C_CONNECTION)) |
| @@ -3379,7 +3383,7 @@ int usb_disable_lpm(struct usb_device *udev) | |||
| 3379 | return 0; | 3383 | return 0; |
| 3380 | 3384 | ||
| 3381 | udev->lpm_disable_count++; | 3385 | udev->lpm_disable_count++; |
| 3382 | if ((udev->u1_params.timeout == 0 && udev->u1_params.timeout == 0)) | 3386 | if ((udev->u1_params.timeout == 0 && udev->u2_params.timeout == 0)) |
| 3383 | return 0; | 3387 | return 0; |
| 3384 | 3388 | ||
| 3385 | /* If LPM is enabled, attempt to disable it. */ | 3389 | /* If LPM is enabled, attempt to disable it. */ |
| @@ -4408,9 +4412,7 @@ static void hub_events(void) | |||
| 4408 | /* Warm reset a USB3 protocol port if it's in | 4412 | /* Warm reset a USB3 protocol port if it's in |
| 4409 | * SS.Inactive state. | 4413 | * SS.Inactive state. |
| 4410 | */ | 4414 | */ |
| 4411 | if (hub_is_superspeed(hub->hdev) && | 4415 | if (hub_port_warm_reset_required(hub, portstatus)) { |
| 4412 | (portstatus & USB_PORT_STAT_LINK_STATE) | ||
| 4413 | == USB_SS_PORT_LS_SS_INACTIVE) { | ||
| 4414 | dev_dbg(hub_dev, "warm reset port %d\n", i); | 4416 | dev_dbg(hub_dev, "warm reset port %d\n", i); |
| 4415 | hub_port_reset(hub, i, NULL, | 4417 | hub_port_reset(hub, i, NULL, |
| 4416 | HUB_BH_RESET_TIME, true); | 4418 | HUB_BH_RESET_TIME, true); |
