summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/usb.h
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2014-03-12 11:30:38 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-17 16:08:27 -0700
commit6aec044cc2f5670cf3b143c151c8be846499bd15 (patch)
treea2d0c9ba0e26e9029a0f62948540799ed53703bf /drivers/usb/core/usb.h
parentead5178bf442dbae4008ee54bf4f66a1f6a317c9 (diff)
downloadlinux-stable-6aec044cc2f5670cf3b143c151c8be846499bd15.tar.gz
linux-stable-6aec044cc2f5670cf3b143c151c8be846499bd15.tar.bz2
linux-stable-6aec044cc2f5670cf3b143c151c8be846499bd15.zip
USB: unbind all interfaces before rebinding any
When a driver doesn't have pre_reset, post_reset, or reset_resume methods, the USB core unbinds that driver when its device undergoes a reset or a reset-resume, and then rebinds it afterward. The existing straightforward implementation can lead to problems, because each interface gets unbound and rebound before the next interface is handled. If a driver claims additional interfaces, the claim may fail because the old binding instance may still own the additional interface when the new instance tries to claim it. This patch fixes the problem by first unbinding all the interfaces that are marked (i.e., their needs_binding flag is set) and then rebinding all of them. The patch also makes the helper functions in driver.c a little more uniform and adjusts some out-of-date comments. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-and-tested-by: "Poulain, Loic" <loic.poulain@intel.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/usb.h')
-rw-r--r--drivers/usb/core/usb.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
index 823857767a16..0923add72b59 100644
--- a/drivers/usb/core/usb.h
+++ b/drivers/usb/core/usb.h
@@ -55,7 +55,7 @@ extern int usb_match_one_id_intf(struct usb_device *dev,
extern int usb_match_device(struct usb_device *dev,
const struct usb_device_id *id);
extern void usb_forced_unbind_intf(struct usb_interface *intf);
-extern void usb_rebind_intf(struct usb_interface *intf);
+extern void usb_unbind_and_rebind_marked_interfaces(struct usb_device *udev);
extern int usb_hub_claim_port(struct usb_device *hdev, unsigned port,
struct dev_state *owner);