ChangeSet 1.1713.7.6, 2004/04/07 16:52:02-07:00, david-b@pacbell.net

[PATCH] USB: fix xsane breakage, hangs on device scan at launch

Disable a usbfs disconnect() synchronization hack, which recently
started deadlocking because this routine is now called in a different
context.

It shouldn't be needed any longer now that usbcore shuts down endpoints
as part of driver unbinding.  (Except maybe on UHCI, which will have
canceled but not necessarily completed all requests.)


 drivers/usb/core/devio.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)


diff -Nru a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
--- a/drivers/usb/core/devio.c	Wed Apr 14 14:33:50 2004
+++ b/drivers/usb/core/devio.c	Wed Apr 14 14:33:50 2004
@@ -339,18 +339,17 @@
 	if (!ps)
 		return;
 
-	/* this waits till synchronous requests complete */
-	down_write (&ps->devsem);
+	/* NOTE:  this relies on usbcore having canceled and completed
+	 * all pending I/O requests; 2.6 does that.
+	 */
 
 	/* prevent new I/O requests */
 	ps->dev = 0;
-	ps->ifclaimed = 0;
+	clear_bit(intf->cur_altsetting->desc.bInterfaceNumber, &ps->ifclaimed);
 	usb_set_intfdata (intf, NULL);
 
 	/* force async requests to complete */
 	destroy_all_async (ps);
-
-	up_write (&ps->devsem);
 }
 
 struct usb_driver usbdevfs_driver = {
