Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 59385
b: refs/heads/master
c: 06b84e8
h: refs/heads/master
i:
  59383: 01e43cf
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Jul 12, 2007
1 parent c016a5f commit e80446e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 48 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: f3fd77cd2f4499f3e2ef9a1e6d5e4f4349d556c3
refs/heads/master: 06b84e8adcad8280d76a7c71e772c5cddba96d85
48 changes: 1 addition & 47 deletions trunk/drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -982,49 +982,6 @@ hub_ioctl(struct usb_interface *intf, unsigned int code, void *user_data)
}


/* grab device/port lock, returning index of that port (zero based).
* protects the upstream link used by this device from concurrent
* tree operations like suspend, resume, reset, and disconnect, which
* apply to everything downstream of a given port.
*/
static int locktree(struct usb_device *udev)
{
int t;
struct usb_device *hdev;

if (!udev)
return -ENODEV;

/* root hub is always the first lock in the series */
hdev = udev->parent;
if (!hdev) {
usb_lock_device(udev);
return 0;
}

/* on the path from root to us, lock everything from
* top down, dropping parent locks when not needed
*/
t = locktree(hdev);
if (t < 0)
return t;

/* everything is fail-fast once disconnect
* processing starts
*/
if (udev->state == USB_STATE_NOTATTACHED) {
usb_unlock_device(hdev);
return -ENODEV;
}

/* when everyone grabs locks top->bottom,
* non-overlapping work may be concurrent
*/
usb_lock_device(udev);
usb_unlock_device(hdev);
return udev->portnum;
}

static void recursively_mark_NOTATTACHED(struct usb_device *udev)
{
int i;
Expand Down Expand Up @@ -2594,10 +2551,7 @@ static void hub_events(void)

/* Lock the device, then check to see if we were
* disconnected while waiting for the lock to succeed. */
if (locktree(hdev) < 0) {
usb_put_intf(intf);
continue;
}
usb_lock_device(hdev);
if (hub != usb_get_intfdata(intf))
goto loop;

Expand Down

0 comments on commit e80446e

Please sign in to comment.