From stern@rowland.harvard.edu Mon Dec 3 12:42:12 2007 From: Alan Stern Date: Mon, 3 Dec 2007 15:42:10 -0500 (EST) Subject: USB: repair USBDEVFS_CONNECT ioctl To: Greg KH Message-ID: For as long as I've known about it, the USBDEVFS_CONNECT ioctl hasn't done what it's supposed to. The current code reprobes _all_ the unbound USB interfaces; this patch (as1021) makes it reprobe only the interface for which it was called. Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- usb-2.6.orig/drivers/usb/core/devio.c +++ usb-2.6/drivers/usb/core/devio.c @@ -1373,9 +1373,10 @@ static int proc_ioctl(struct dev_state * /* let kernel drivers try to (re)bind to the interface */ case USBDEVFS_CONNECT: - usb_unlock_device(ps->dev); - retval = bus_rescan_devices(intf->dev.bus); - usb_lock_device(ps->dev); + if (!intf->dev.driver) + retval = device_attach(&intf->dev); + else + retval = -EBUSY; break; /* talk directly to the interface's driver */