All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: torvalds@osdl.org
Cc: Andrew Morton <akpm@osdl.org>,
	stern@rowland.harvard.edu, linux-usb-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: [PATCH] USB: Eliminate wait following interface unregistration
Date: Sat, 27 Mar 2004 23:12:47 -0800	[thread overview]
Message-ID: <20040328071247.GA6773@kroah.com> (raw)
In-Reply-To: <20040327230634.5642c6ad.akpm@osdl.org>

Hi,

The following patch from Alan Stern <stern@rowland.harvard.edu> fixes a
bug in the current USB code that causes khubd to hang when a device is
removed from the system, thereby preventing any future USB device
changes (like adding or removing other devices) from happening.

Both Andrew and I can easily duplicate this bug against the current -bk
tree.

It's not a perfect fix, but it works for now, and I will spend the next
week working on restructuring the code so this is handled properly.

thanks,

greg k-h

--- 1.73/drivers/usb/core/message.c	Wed Mar 17 14:16:47 2004
+++ edited/drivers/usb/core/message.c	Wed Mar 24 10:17:04 2004
@@ -794,9 +794,6 @@
 
 static void release_interface(struct device *dev)
 {
-	struct usb_interface *interface = to_usb_interface(dev);
-
-	complete(interface->released);
 }
 
 /*
@@ -828,16 +825,12 @@
 	if (dev->actconfig) {
 		for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
 			struct usb_interface	*interface;
-			struct completion	intf_completion;
 
 			/* remove this interface */
 			interface = dev->actconfig->interface[i];
 			dev_dbg (&dev->dev, "unregistering interface %s\n",
 				interface->dev.bus_id);
-			init_completion (&intf_completion);
-			interface->released = &intf_completion;
 			device_unregister (&interface->dev);
-			wait_for_completion (&intf_completion);
 		}
 		dev->actconfig = 0;
 		if (dev->state == USB_STATE_CONFIGURED)



           reply	other threads:[~2004-03-28  7:13 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20040327230634.5642c6ad.akpm@osdl.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040328071247.GA6773@kroah.com \
    --to=greg@kroah.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=stern@rowland.harvard.edu \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.