Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108979
b: refs/heads/master
c: 5096aed
h: refs/heads/master
i:
  108977: 65fce4d
  108975: c29b5cf
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Aug 21, 2008
1 parent 0612ee7 commit 261b5d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 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: f2189c477c986db47ac7f9cc32d05f6df18bfe9e
refs/heads/master: 5096aedcd2eb70fbea83f09281f97f9ec973d9de
30 changes: 9 additions & 21 deletions trunk/drivers/usb/core/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,8 @@ void usb_forced_unbind_intf(struct usb_interface *intf)
* The caller must hold @intf's device's lock, but not its pm_mutex
* and not @intf->dev.sem.
*
* FIXME: The caller must block system sleep transitions.
* Note: Rebinds will be skipped if a system sleep transition is in
* progress and the PM "complete" callback hasn't occurred yet.
*/
void usb_rebind_intf(struct usb_interface *intf)
{
Expand All @@ -830,10 +831,12 @@ void usb_rebind_intf(struct usb_interface *intf)
}

/* Try to rebind the interface */
intf->needs_binding = 0;
rc = device_attach(&intf->dev);
if (rc < 0)
dev_warn(&intf->dev, "rebind failed: %d\n", rc);
if (intf->dev.power.status == DPM_ON) {
intf->needs_binding = 0;
rc = device_attach(&intf->dev);
if (rc < 0)
dev_warn(&intf->dev, "rebind failed: %d\n", rc);
}
}

#ifdef CONFIG_PM
Expand All @@ -845,7 +848,6 @@ void usb_rebind_intf(struct usb_interface *intf)
* or rebind interfaces that have been unbound, according to @action.
*
* The caller must hold @udev's device lock.
* FIXME: For rebinds, the caller must block system sleep transitions.
*/
static void do_unbind_rebind(struct usb_device *udev, int action)
{
Expand All @@ -867,22 +869,8 @@ static void do_unbind_rebind(struct usb_device *udev, int action)
}
break;
case DO_REBIND:
if (intf->needs_binding) {

/* FIXME: The next line is needed because we are going to probe
* the interface, but as far as the PM core is concerned the
* interface is still suspended. The problem wouldn't exist
* if we could rebind the interface during the interface's own
* resume() call, but at the time the usb_device isn't locked!
*
* The real solution will be to carry this out during the device's
* complete() callback. Until that is implemented, we have to
* use this hack.
*/
// intf->dev.power.sleeping = 0;

if (intf->needs_binding)
usb_rebind_intf(intf);
}
break;
}
}
Expand Down

0 comments on commit 261b5d7

Please sign in to comment.