Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
scsi hosts and usb mass storage device
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Sparc
View previous topic :: View next topic  
Author Message
jbwillia
Tux's lil' helper
Tux's lil' helper


Joined: 07 May 2004
Posts: 108
Location: TN, USA

PostPosted: Thu Jun 10, 2004 8:44 am    Post subject: scsi hosts and usb mass storage device Reply with quote

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 http://forums.gentoo.org/viewtopic.php?p=1226298#1226298
Back to top
View user's profile Send private message
Kope
Tux's lil' helper
Tux's lil' helper


Joined: 17 May 2004
Posts: 136

PostPosted: Thu Jun 10, 2004 2:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
ciaranm
Retired Dev
Retired Dev


Joined: 19 Jul 2003
Posts: 1719
Location: In Hiding

PostPosted: Thu Jun 10, 2004 9:59 pm    Post subject: Reply with quote

This, people, is why we use udev.
Back to top
View user's profile Send private message
jbwillia
Tux's lil' helper
Tux's lil' helper


Joined: 07 May 2004
Posts: 108
Location: TN, USA

PostPosted: Thu Jun 10, 2004 10:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
Kope
Tux's lil' helper
Tux's lil' helper


Joined: 17 May 2004
Posts: 136

PostPosted: Fri Jun 11, 2004 2:09 am    Post subject: Reply with quote

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
View user's profile Send private message
jbwillia
Tux's lil' helper
Tux's lil' helper


Joined: 07 May 2004
Posts: 108
Location: TN, USA

PostPosted: Fri Jun 11, 2004 7:08 am    Post subject: Reply with quote

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
View user's profile Send private message
ciaranm
Retired Dev
Retired Dev


Joined: 19 Jul 2003
Posts: 1719
Location: In Hiding

PostPosted: Fri Jun 11, 2004 11:50 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Sparc All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum