From 606d0900c7b253a674101fa56e1a20c60bf6cad0 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Wed, 7 Apr 2004 02:52:02 -0700 Subject: [PATCH] [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 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index ece587efd575b..ed1296ad92f7d 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -339,18 +339,17 @@ static void driver_disconnect(struct usb_interface *intf) 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 = { -- 2.53.0