From: Byron Stanoszek <gandalf@winds.org>
To: linux-usb-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: [PATCH] Make USB process hub events in correct order
Date: Tue, 15 Jun 2004 14:26:49 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.60.0406151412430.26219@winds.org> (raw)
[-- Attachment #1: Type: TEXT/PLAIN, Size: 5350 bytes --]
This patch fixes the USB hub module to process events in the order that they
are received. It fixes the case where multi-port devices have multiple
hubs in them--while they are detected in the correct order, they are
initialized in reverse. It is required for the Sealink 8-port USB->serial hubs
to initialize with the port numbers in the correct order.
I don't think it breaks any existing functionality, but I won't send this to
Linus yet till I know it doesn't break anything.
Patch below against 2.6.7-rc3.
--- linux/drivers/usb/core/hub.bak 2004-06-08 10:21:57.000000000 -0400
+++ linux/drivers/usb/core/hub.c 2004-06-08 10:59:34.000000000 -0400
@@ -260,7 +260,7 @@
/* Something happened, let khubd figure it out */
if (list_empty(&hub->event_list)) {
- list_add(&hub->event_list, &hub_event_list);
+ list_add_tail(&hub->event_list, &hub_event_list);
wake_up(&khubd_wait);
}
An example without the patch (1-1.2.1 gets initialized before 1-1.1.1):
usb 1-1: new full speed USB device using address 2
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
usb 1-1.1: new full speed USB device using address 3
hub 1-1.1:1.0: USB hub found
hub 1-1.1:1.0: 4 ports detected
usb 1-1.2: new full speed USB device using address 4
hub 1-1.2:1.0: USB hub found
hub 1-1.2:1.0: 4 ports detected
usb 1-1.2.1: new full speed USB device using address 5
ftdi_sio 1-1.2.1:1.0: FTDI FT232BM Compatible converter detected
usb 1-1.2.1: FTDI FT232BM Compatible converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
usb 1-1.2.2: new full speed USB device using address 6
ftdi_sio 1-1.2.2:1.0: FTDI FT232BM Compatible converter detected
usb 1-1.2.2: FTDI FT232BM Compatible converter now attached to ttyUSB1 (or usb/tts/1 for devfs)
usb 1-1.2.3: new full speed USB device using address 7
ftdi_sio 1-1.2.3:1.0: FTDI FT232BM Compatible converter detected
usb 1-1.2.3: FTDI FT232BM Compatible converter now attached to ttyUSB2 (or usb/tts/2 for devfs)
usb 1-1.2.4: new full speed USB device using address 8
ftdi_sio 1-1.2.4:1.0: FTDI FT232BM Compatible converter detected
usb 1-1.2.4: FTDI FT232BM Compatible converter now attached to ttyUSB3 (or usb/tts/3 for devfs)
usb 1-1.1.1: new full speed USB device using address 9
ftdi_sio 1-1.1.1:1.0: FTDI FT232BM Compatible converter detected
usb 1-1.1.1: FTDI FT232BM Compatible converter now attached to ttyUSB4 (or usb/tts/4 for devfs)
usb 1-1.1.2: new full speed USB device using address 10
ftdi_sio 1-1.1.2:1.0: FTDI FT232BM Compatible converter detected
usb 1-1.1.2: FTDI FT232BM Compatible converter now attached to ttyUSB5 (or usb/tts/5 for devfs)
usb 1-1.1.3: new full speed USB device using address 11
ftdi_sio 1-1.1.3:1.0: FTDI FT232BM Compatible converter detected
usb 1-1.1.3: FTDI FT232BM Compatible converter now attached to ttyUSB6 (or usb/tts/6 for devfs)
usb 1-1.1.4: new full speed USB device using address 12
ftdi_sio 1-1.1.4:1.0: FTDI FT232BM Compatible converter detected
usb 1-1.1.4: FTDI FT232BM Compatible converter now attached to ttyUSB7 (or usb/tts/7 for devfs)
With the patch (the correct ordering):
usb 1-1: new full speed USB device using address 2
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
usb 1-1.1: new full speed USB device using address 3
hub 1-1.1:1.0: USB hub found
hub 1-1.1:1.0: 4 ports detected
usb 1-1.2: new full speed USB device using address 4
hub 1-1.2:1.0: USB hub found
hub 1-1.2:1.0: 4 ports detected
usb 1-1.1.1: new full speed USB device using address 5
ftdi_sio 1-1.1.1:1.0: FTDI FT232BM Compatible converter detected
usb 1-1.1.1: FTDI FT232BM Compatible converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
usb 1-1.1.2: new full speed USB device using address 6
ftdi_sio 1-1.1.2:1.0: FTDI FT232BM Compatible converter detected
usb 1-1.1.2: FTDI FT232BM Compatible converter now attached to ttyUSB1 (or usb/tts/1 for devfs)
usb 1-1.1.3: new full speed USB device using address 7
ftdi_sio 1-1.1.3:1.0: FTDI FT232BM Compatible converter detected
usb 1-1.1.3: FTDI FT232BM Compatible converter now attached to ttyUSB2 (or usb/tts/2 for devfs)
usb 1-1.1.4: new full speed USB device using address 8
ftdi_sio 1-1.1.4:1.0: FTDI FT232BM Compatible converter detected
usb 1-1.1.4: FTDI FT232BM Compatible converter now attached to ttyUSB3 (or usb/tts/3 for devfs)
usb 1-1.2.1: new full speed USB device using address 9
ftdi_sio 1-1.2.1:1.0: FTDI FT232BM Compatible converter detected
usb 1-1.2.1: FTDI FT232BM Compatible converter now attached to ttyUSB4 (or usb/tts/4 for devfs)
usb 1-1.2.2: new full speed USB device using address 10
ftdi_sio 1-1.2.2:1.0: FTDI FT232BM Compatible converter detected
usb 1-1.2.2: FTDI FT232BM Compatible converter now attached to ttyUSB5 (or usb/tts/5 for devfs)
usb 1-1.2.3: new full speed USB device using address 11
ftdi_sio 1-1.2.3:1.0: FTDI FT232BM Compatible converter detected
usb 1-1.2.3: FTDI FT232BM Compatible converter now attached to ttyUSB6 (or usb/tts/6 for devfs)
usb 1-1.2.4: new full speed USB device using address 12
ftdi_sio 1-1.2.4:1.0: FTDI FT232BM Compatible converter detected
usb 1-1.2.4: FTDI FT232BM Compatible converter now attached to ttyUSB7 (or usb/tts/7 for devfs)
-Byron
--
Byron Stanoszek Ph: (330) 644-3059
Systems Programmer Fax: (330) 644-8110
Commercial Timesharing Inc. Email: byron@comtime.com
[-- Attachment #2: Type: TEXT/PLAIN, Size: 395 bytes --]
--- linux/drivers/usb/core/hub.bak 2004-06-08 10:21:57.000000000 -0400
+++ linux/drivers/usb/core/hub.c 2004-06-08 10:59:34.000000000 -0400
@@ -260,7 +260,7 @@
/* Something happened, let khubd figure it out */
if (list_empty(&hub->event_list)) {
- list_add(&hub->event_list, &hub_event_list);
+ list_add_tail(&hub->event_list, &hub_event_list);
wake_up(&khubd_wait);
}
next reply other threads:[~2004-06-15 18:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-15 18:26 Byron Stanoszek [this message]
2004-06-15 20:06 ` [linux-usb-devel] " Greg KH
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=Pine.LNX.4.60.0406151412430.26219@winds.org \
--to=gandalf@winds.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
/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®