Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354546
b: refs/heads/master
c: d3b9d7a
h: refs/heads/master
v: v3
  • Loading branch information
Sarah Sharp committed Jan 3, 2013
1 parent d8c5c78 commit 165ae77
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a24a6078754f28528bc91e7e7b3e6ae86bd936d8
refs/heads/master: d3b9d7a9051d7024a93c76a84b2f84b3b66ad6d5
30 changes: 25 additions & 5 deletions trunk/drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2605,7 +2605,6 @@ static void hub_port_finish_reset(struct usb_hub *hub, int port1,
case -ENODEV:
clear_port_feature(hub->hdev,
port1, USB_PORT_FEAT_C_RESET);
/* FIXME need disconnect() for NOTATTACHED device */
if (hub_is_superspeed(hub->hdev)) {
clear_port_feature(hub->hdev, port1,
USB_PORT_FEAT_C_BH_PORT_RESET);
Expand Down Expand Up @@ -2639,6 +2638,18 @@ static int hub_port_reset(struct usb_hub *hub, int port1,
* Some companion controllers don't like it when they mix.
*/
down_read(&ehci_cf_port_reset_rwsem);
} else if (!warm) {
/*
* If the caller hasn't explicitly requested a warm reset,
* double check and see if one is needed.
*/
status = hub_port_status(hub, port1,
&portstatus, &portchange);
if (status < 0)
goto done;

if (hub_port_warm_reset_required(hub, portstatus))
warm = true;
}

/* Reset the port */
Expand Down Expand Up @@ -4690,12 +4701,21 @@ static void hub_events(void)
*/
if (hub_port_warm_reset_required(hub, portstatus)) {
int status;
struct usb_device *udev =
hub->ports[i - 1]->child;

dev_dbg(hub_dev, "warm reset port %d\n", i);
status = hub_port_reset(hub, i, NULL,
HUB_BH_RESET_TIME, true);
if (status < 0)
hub_port_disable(hub, i, 1);
if (!udev) {
status = hub_port_reset(hub, i,
NULL, HUB_BH_RESET_TIME,
true);
if (status < 0)
hub_port_disable(hub, i, 1);
} else {
usb_lock_device(udev);
status = usb_reset_device(udev);
usb_unlock_device(udev);
}
connect_change = 0;
}

Expand Down

0 comments on commit 165ae77

Please sign in to comment.