From: Colin Leroy <colin@colino.net>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-kernel@vger.kernel.org, <linux-usb-devel@lists.sf.net>
Subject: [PATCH] Re: [linux-usb-devel] Re: [OOPS] reproducible oops with 2.6.5-rc2-bk3
Date: Thu, 25 Mar 2004 18:46:20 +0100 [thread overview]
Message-ID: <20040325184620.3b6b070c@jack.colino.net> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0403251153110.1083-100000@ida.rowland.org>
[-- Attachment #1: Type: text/plain, Size: 474 bytes --]
On 25 Mar 2004 at 11h03, Alan Stern wrote:
Hi,
Found out !
cdc-acm wants both interfaces to be ready (cur_altsetting initialized) when acm_probe() is called. Hence, we have to make two parts out of the loop in message.c::usb_set_configuration(): one to init things, one to register them.
The attached patch does that. It fixes the oops, and doesn't break any of my USB peripheral (printer, scanner, mouse, and diskonkey).
I hope it's fine enough to go in :)
--
Colin
[-- Attachment #2: cdc-acm.oops.patch --]
[-- Type: application/octet-stream, Size: 726 bytes --]
--- drivers/usb/core/message.c.orig 2004-03-25 18:34:04.000000000 +0100
+++ drivers/usb/core/message.c 2004-03-25 18:42:41.267697224 +0100
@@ -1178,10 +1178,17 @@
dev->bus->busnum, dev->devpath,
configuration,
alt->desc.bInterfaceNumber);
+ }
+
+ /* all interfaces are initialized, we can now
+ * register them
+ */
+ for (i = 0; i < cp->desc.bNumInterfaces; ++i) {
+ struct usb_interface *intf = cp->interface[i];
dev_dbg (&dev->dev,
"registering %s (config #%d, interface %d)\n",
intf->dev.bus_id, configuration,
- alt->desc.bInterfaceNumber);
+ intf->cur_altsetting->desc.bInterfaceNumber);
device_register (&intf->dev);
usb_create_driverfs_intf_files (intf);
}
next prev parent reply other threads:[~2004-03-25 17:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <136101c4126d$c0bc5600$3cc8a8c0@epro.dom>
2004-03-25 14:44 ` [linux-usb-devel] Re: [OOPS] reproducible oops with 2.6.5-rc2-bk3 Alan Stern
2004-03-25 15:20 ` Colin Leroy
2004-03-25 16:40 ` Colin Leroy
2004-03-25 16:56 ` Alan Stern
2004-03-25 17:26 ` Colin Leroy
2004-03-25 17:46 ` Colin Leroy [this message]
2004-03-25 18:46 ` [PATCH] " Alan Stern
2004-03-25 19:11 ` Colin Leroy
2004-03-25 20:22 ` Alan Stern
2004-03-25 20:01 ` Colin Leroy
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=20040325184620.3b6b070c@jack.colino.net \
--to=colin@colino.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sf.net \
--cc=stern@rowland.harvard.edu \
/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.