View previous topic :: View next topic |
Author |
Message |
jbwillia Tux's lil' helper
Joined: 07 May 2004 Posts: 108 Location: TN, USA
|
Posted: Thu Jun 10, 2004 8:44 am Post subject: scsi hosts and usb mass storage device |
|
|
I am having an issue with the scsi system and how it communicates with usb. I am using the 2.6.6 kernel and running pure udev. The problem is that every time I plug in a usb mass storage device, a new scsi host is created. I had this problem in sysfs and thought maybe it was just a race condition, so I went ahead and switched over to udev. I am getting better results in that at least each time it is plugged in it creates the device data in /sys and once it is unplugged all that is removed. However it is still assigning these scsi hosts incrementally every time I replug it in. Here is a scenario of what's going on:
I plug a mass storage device in and here is an excerpt from syslog Code: | Jun 9 16:25:44 odin scsi.agent[31675]: disk at /devices/pci0000:80/0000:80:01.0/usb2/2-1/2-1:1.0/host4/4:0:0:0 |
I unplug the device without ever having mounted it and everything seems to be fine; /sys/devices/pci0000:80/0000:80:01.0/usb2/2-1/2-1:1.0/ is now empty as it should be.
I now plug the device back in and get this is syslog Code: | Jun 9 16:47:28 odin scsi.agent[31877]: disk at /devices/pci0000:80/0000:80:01.0/usb2/2-1/2-1:1.0/host5/5:0:0:0 |
Now, that all said ... Why is it creating host5 instead of reusing the old host4 that had been unregistered through hotplug? I have been posting in the kernel & hardware forum but thus far not gettiing anything of value; I'm beginning to believe this is a sparc spceific issue. My posts in the kernel & hardware forum are at https://forums.gentoo.org/viewtopic.php?p=1226298#1226298 |
|
Back to top |
|
|
Kope Tux's lil' helper
Joined: 17 May 2004 Posts: 136
|
Posted: Thu Jun 10, 2004 2:35 pm Post subject: |
|
|
I see the same behavior on my system.
However, no matter how many times I plug it in, it always appears under the same device in /dev.
That is, no matter if I see
/devices/pci...host5/5:0.0.0
or
/devices/pci...host15/5:0.0.0
The new usb drive always appears at the next available /dev/sd[a-z] entry.
So, while this is a bit confusing, unless it's not binding to the proper major/minor node number it really isn't an issue. _________________ "Computers are useless -- they only give you answers!" -- Pablo Picasso |
|
Back to top |
|
|
ciaranm Retired Dev
Joined: 19 Jul 2003 Posts: 1719 Location: In Hiding
|
Posted: Thu Jun 10, 2004 9:59 pm Post subject: |
|
|
This, people, is why we use udev. |
|
Back to top |
|
|
jbwillia Tux's lil' helper
Joined: 07 May 2004 Posts: 108 Location: TN, USA
|
Posted: Thu Jun 10, 2004 10:23 pm Post subject: |
|
|
yes, udev is assigning it to the proper link in /dev which is good and of course I will eventually write a udev rule for my 2 mass storage devices ... but this raises the question of when will I discover the maximum number of scsi hosts in linux? I do not have this problem on my celeron machine running debian using a 2.4.22 kernel and devfs .... in that case everytime the mass storage device is disconnected, it is removed from /dev/scsi and the next time one is plugged in, it is given the previous host number ... is that not how it should be? is this a problem with the scsi driver? |
|
Back to top |
|
|
Kope Tux's lil' helper
Joined: 17 May 2004 Posts: 136
|
Posted: Fri Jun 11, 2004 2:09 am Post subject: |
|
|
no. it's just a difference between udev and devfs.
You're seeing expected behavior. _________________ "Computers are useless -- they only give you answers!" -- Pablo Picasso |
|
Back to top |
|
|
jbwillia Tux's lil' helper
Joined: 07 May 2004 Posts: 108 Location: TN, USA
|
Posted: Fri Jun 11, 2004 7:08 am Post subject: |
|
|
my problem has nothing to do with udev... udev is working perfectly fine ... the problem is with the scsi driver .... eventually if I don't reboot somewhere along the way I will reach an upper limit on the number of scsi hosts that are being assigned... the real question is: why doesn't the scsi driver know that the device had been disconnected so it can reuse that old host number? this is not normal behavior; i even get that much from the guys in the kernel & hardware forum (refer to the link above) ... it's just no one in there had anything to fix the problem (i think it's sparc specific hence the reason why I am posting in here) |
|
Back to top |
|
|
ciaranm Retired Dev
Joined: 19 Jul 2003 Posts: 1719 Location: In Hiding
|
Posted: Fri Jun 11, 2004 11:50 am Post subject: |
|
|
No no, this is expected behaviour, and it's one of the reasons udev is so necessary. The whole static major/minor thing has to go, and that requires something like udev. |
|
Back to top |
|
|
|