From: Duncan Sands <baldrick@free.fr>
To: Andy Lutomirski <luto@myrealbox.com>,
Andrew Morton <akpm@osdl.org>,
vojtech@suse.cz
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6.6-mm2 (oops on keyboard/mouse USB hub unplug)
Date: Fri, 14 May 2004 09:20:51 +0200 [thread overview]
Message-ID: <200405140920.51717.baldrick@free.fr> (raw)
In-Reply-To: <40A4207D.9000003@myrealbox.com>
> Unplugging my hub still oopses. This one was introduced in -mm1
> (2.6.6-rc2-mm1 was fine), and reverting mm1's bk-usb.patch fixed it.
> This happens every time.
The following patch from Alan Stern should fix it:
===== drivers/usb/core/message.c 1.83 vs edited =====
--- 1.83/drivers/usb/core/message.c Mon May 3 06:26:40 2004
+++ edited/drivers/usb/core/message.c Thu May 13 13:37:48 2004
@@ -830,7 +830,14 @@
interface = dev->actconfig->interface[i];
dev_dbg (&dev->dev, "unregistering interface %s\n",
interface->dev.bus_id);
- device_unregister (&interface->dev);
+ device_del (&interface->dev);
+ }
+
+ /* Now that the interfaces are unbound, nobody should
+ * try to access them.
+ */
+ for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
+ put_device (&dev->actconfig->interface[i]->dev);
dev->actconfig->interface[i] = NULL;
}
dev->actconfig = 0;
===== drivers/usb/core/usb.c 1.264 vs edited =====
--- 1.264/drivers/usb/core/usb.c Thu Apr 15 08:19:20 2004
+++ edited/drivers/usb/core/usb.c Thu May 13 13:40:06 2004
@@ -198,6 +198,9 @@
* This routine helps device drivers avoid such mistakes.
* However, you should make sure that you do the right thing with any
* alternate settings available for this interfaces.
+ *
+ * Don't call this function unless you are bound to one of the interfaces
+ * on this device or you own the dev->serialize semaphore!
*/
struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, unsigned ifnum)
{
@@ -228,6 +231,9 @@
* it would be incorrect to assume that the first altsetting entry in
* the array corresponds to altsetting zero. This routine helps device
* drivers avoid such mistakes.
+ *
+ * Don't call this function unless you are bound to the intf interface
+ * or you own the device's ->serialize semaphore!
*/
struct usb_host_interface *usb_altnum_to_altsetting(struct usb_interface *intf,
unsigned int altnum)
prev parent reply other threads:[~2004-05-14 7:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fa.h3bu70j.nm6rj1@ifi.uio.no>
2004-05-14 1:27 ` Andy Lutomirski
2004-05-14 7:20 ` Duncan Sands [this message]
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=200405140920.51717.baldrick@free.fr \
--to=baldrick@free.fr \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@myrealbox.com \
--cc=vojtech@suse.cz \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®