Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36420
b: refs/heads/master
c: d5cbad4
h: refs/heads/master
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Sep 27, 2006
1 parent f5ebbe2 commit 3db7a2e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 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: 455b25fb209c8241e2163b491228b28667d82c1c
refs/heads/master: d5cbad4b8b37acfde3e63d31b92561b87288ad0f
11 changes: 10 additions & 1 deletion trunk/drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,8 @@ hub_port_resume(struct usb_hub *hub, int port1, struct usb_device *udev)

// dev_dbg(hub->intfdev, "resume port %d\n", port1);

set_bit(port1, hub->busy_bits);

/* see 7.1.7.7; affects power usage, but not budgeting */
status = clear_port_feature(hub->hdev,
port1, USB_PORT_FEAT_SUSPEND);
Expand Down Expand Up @@ -1707,6 +1709,10 @@ hub_port_resume(struct usb_hub *hub, int port1, struct usb_device *udev)
if (status < 0)
hub_port_logical_disconnect(hub, port1);

clear_bit(port1, hub->busy_bits);
if (!hub->hdev->parent && !hub->busy_bits[0])
usb_enable_root_hub_irq(hub->hdev->bus);

return status;
}

Expand Down Expand Up @@ -2690,7 +2696,7 @@ static void hub_events(void)

/* If this is a root hub, tell the HCD it's okay to
* re-enable port-change interrupts now. */
if (!hdev->parent)
if (!hdev->parent && !hub->busy_bits[0])
usb_enable_root_hub_irq(hdev->bus);

loop:
Expand Down Expand Up @@ -2865,6 +2871,9 @@ int usb_reset_device(struct usb_device *udev)
break;
}
clear_bit(port1, parent_hub->busy_bits);
if (!parent_hdev->parent && !parent_hub->busy_bits[0])
usb_enable_root_hub_irq(parent_hdev->bus);

if (ret < 0)
goto re_enumerate;

Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/usb/core/hub.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ struct usb_hub {
unsigned long event_bits[1]; /* status change bitmask */
unsigned long change_bits[1]; /* ports with logical connect
status change */
unsigned long busy_bits[1]; /* ports being reset */
unsigned long busy_bits[1]; /* ports being reset or
resumed */
#if USB_MAXCHILDREN > 31 /* 8*sizeof(unsigned long) - 1 */
#error event_bits[] is too short!
#endif
Expand Down

0 comments on commit 3db7a2e

Please sign in to comment.