LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   slow usb key detection (https://www.linuxquestions.org/questions/slackware-14/slow-usb-key-detection-537618/)

davidsrsb 03-15-2007 01:30 AM

slow usb key detection
 
When I insert my flash key onto a Slackware 11.0 machine I get very slow installation.
this happens with both 2.4.33 and huge 2.6 kernels.
var/log/messages shows

ar 15 13:38:27 pisang -- MARK --
Mar 15 13:53:37 pisang kernel: usb 1-1: new full speed USB device using uhci_hcd and address 19
Mar 15 13:53:38 pisang kernel: usb 1-1: new full speed USB device using uhci_hcd and address 20
Mar 15 13:53:38 pisang kernel: usb 1-1: new full speed USB device using uhci_hcd and address 21
Mar 15 13:53:39 pisang kernel: usb 1-1: new full speed USB device using uhci_hcd and address 22
Mar 15 13:53:39 pisang kernel: usb 1-1: new full speed USB device using uhci_hcd and address 23
repeats
Mar 15 13:54:31 pisang kernel: usb 1-1: new full speed USB device using uhci_hcd and address 125
Mar 15 13:54:31 pisang kernel: usb 1-1: new full speed USB device using uhci_hcd and address 126
Mar 15 13:54:32 pisang kernel: usb 1-1: new full speed USB device using uhci_hcd and address 127
Mar 15 13:54:32 pisang kernel: usb 1-1: new full speed USB device using uhci_hcd and address 2
Mar 15 13:54:33 pisang kernel: usb 1-1: new full speed USB device using uhci_hcd and address 3
repeats
Mar 15 13:54:52 pisang kernel: usb 1-1: new full speed USB device using uhci_hcd and address 42
Mar 15 13:54:53 pisang kernel: usb 1-1: new full speed USB device using uhci_hcd and address 43
Mar 15 13:54:53 pisang kernel: usb 1-1: new full speed USB device using uhci_hcd and address 44
Mar 15 13:54:54 pisang kernel: usb 1-1: new full speed USB device using uhci_hcd and address 45
Mar 15 13:54:54 pisang kernel: usb 1-1: configuration #1 chosen from 1 choice
Mar 15 13:54:54 pisang kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Mar 15 13:54:59 pisang kernel: Vendor: Kingston Model: DataTraveler 2.0 Rev: 6.16
Mar 15 13:54:59 pisang kernel: Type: Direct-Access ANSI SCSI revision: 00
Mar 15 13:54:59 pisang kernel: SCSI device sda: 2004991 512-byte hdwr sectors (1027 MB)
Mar 15 13:54:59 pisang kernel: sda: Write Protect is off
Mar 15 13:54:59 pisang kernel: SCSI device sda: 2004991 512-byte hdwr sectors (1027 MB)
Mar 15 13:54:59 pisang kernel: sda: Write Protect is off
Mar 15 13:54:59 pisang kernel: sda: sda1
Mar 15 13:54:59 pisang kernel: sd 2:0:0:0: Attached scsi removable disk sda
Mar 15 13:54:59 pisang kernel: sd 2:0:0:0: Attached scsi generic sg0 type 0










;

gnashley 03-15-2007 03:20 AM

How long does all that take? Usually when you first insert the device it will take about 3 seconds for the kernel to first catch the event. Then hotplug starts to load the modules after a 3 second sleep. About that time the usb drivers have finfished registering and the scsi drivers start registering. It can take another 10-15 seconds (or more) for this to happen, especially if the device has more than one partition.
It looks as if your device is USB-1.1 so it will natuarlly be slower and the usb driver has to figure that out and start 'masquerading' as usb-1.1.

These problems also occur with other OS's (windows takes just as long to register usb devices) as they are problems with usb the protocol itself.

davidsrsb 03-15-2007 06:15 AM

It takes a couple of minutes. Trying all of the possible addresses a few times at one per second takes a long time

davidsrsb 03-17-2007 02:50 AM

Now the key is never loaded, the messages file shows that the process is cycling through addresses indefinitely.
This happens on a few machines with different hardware.

Trying a different key works ok.

Googling shows several people reporting the same problem with keys, usb disk drives and cameras on several Linux distributions.

tobyl 03-17-2007 07:51 AM

I haven't got an answer for you, but I did a bit of digging around.
Basically I think gnashley is spot on, but I found an interesting thing.

https://lists.ubuntu.com/archives/ke...st/020583.html

if you look here, you will find your problem exactly. But see this line:
usb 1-3: new high speed USB device using ehci_hcd and address 7

It is your device down to the revision number.
It is loading successfully as a high-speed device, using the ehci driver.

So can you check if your device and the hub you are plugging it in are both high speed (USB2.0)?

Note that as gnashley said, "full speed USB" is the slower speed. You need to see "high speed" for USB2.0

Usb suppport seems to improve with every new kernel version. If this problem is really bugging you, I think compiling your own up-to-date kernel (with usb drivers as modules) is the way to go. Also you may wish to check that you have the latest versions of hotplug and udev.

tobyl

masonm 03-17-2007 08:01 AM

If a different key loads well, or faster, it's likely the device itself that's the problem. My 1GB thumb drive loads very quickly.

How old is this device? They do have a limited life span and perhaps this one is simply "wearing out"? Also, as gnashly said, if it's a 1.1 device it's going to take longer.

Do you have an fstab entry for a device like this? I found that creating an entry in fstab sped up the mounting process for the device.

/dev/sda1 /mnt/thumb auto noauto,user 0 0

gnashley 03-17-2007 09:43 AM

If the device is not high-speed, then the high-speed driver has to figure out which of the other drivers to use and revert to that, which may consume more time. Also as suggested make sure your hubs and extensions are all compatible. (having a usb-2 card with a usb-1 extension or hub will usually not work for usb-2 disks, even if they claim to be comatible.)

davidsrsb 03-17-2007 11:12 PM

The key is usb2
Most of the the PCs are definitely usb 1.1 generation

masonm 03-18-2007 12:08 AM

Trying to use a usb2 device on a 1.1 box is going to slow things down. Try pluggin it into a box with a modern usb port and see what happens.

gnashley 03-18-2007 03:56 AM

It may help to manually load the right kernel module instead of making the kernel figure it out.


All times are GMT -5. The time now is 12:21 AM.