Skip to content

Commit

Permalink
USB: unbind all interfaces before rebinding them
Browse files Browse the repository at this point in the history
This patch (as1387) fixes a bug introduced during the changeover to
the runtime PM framework.  When a driver doesn't support resume or
reset-resume, and consequently its interfaces need to be unbound and
rebound, we have to unbind all the interfaces before trying to rebind
any of them.  Otherwise the driver's probe method for one interface
could try to claim a different interface and fail, because that other
interface hasn't been unbound yet.

This fixes Bugzilla #15788.  The symptom is that some USB sound cards
don't work after hibernation.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: François Valenduc <francois.valenduc@tvcablenet.be>
Cc: stable <stable@kernel.org> [.34]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Jun 4, 2010
1 parent 109f34e commit c043f12
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/core/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,7 @@ int usb_resume(struct device *dev, pm_message_t msg)

/* For all other calls, take the device back to full power and
* tell the PM core in case it was autosuspended previously.
* Unbind the interfaces that will need rebinding later.
*/
} else {
status = usb_resume_both(udev, msg);
Expand All @@ -1336,6 +1337,7 @@ int usb_resume(struct device *dev, pm_message_t msg)
pm_runtime_set_active(dev);
pm_runtime_enable(dev);
udev->last_busy = jiffies;
do_unbind_rebind(udev, DO_REBIND);
}
}

Expand Down

0 comments on commit c043f12

Please sign in to comment.