# USB stick not working reliably with EHCI (USB 2.0)

## the_bat

Hi,

I want to use a large USB Stick (8GB, takeMS) and it is not working reliably from within my gentoo system.  I tested on a Lenovo T60 notebook and a R61.

It works perfectly in Windows and ubuntu live cd.

When I plug the stick in it is recognized as:

```
May 13 12:50:01 monat Initializing USB Mass Storage driver...

May 13 12:50:01 monat scsi5 : SCSI emulation for USB Mass Storage devices

May 13 12:50:01 monat usb-storage: device found at 7

May 13 12:50:01 monat usbcore: registered new interface driver usb-storage

May 13 12:50:01 monat USB Mass Storage support registered.

May 13 12:50:01 monat usb-storage: waiting for device to settle before scanning

May 13 12:50:06 monat scsi 5:0:0:0: Direct-Access     S31B0802 USB DISK         1100 PQ: 0 ANSI: 0 CCS

May 13 12:50:06 monat sd 5:0:0:0: [sdb] 16251904 512-byte hardware sectors (8321 MB)

May 13 12:50:06 monat sd 5:0:0:0: [sdb] Write Protect is off

May 13 12:50:06 monat sd 5:0:0:0: [sdb] Mode Sense: 43 00 00 00

May 13 12:50:06 monat sd 5:0:0:0: [sdb] Assuming drive cache: write through

May 13 12:50:06 monat sd 5:0:0:0: [sdb] 16251904 512-byte hardware sectors (8321 MB)

May 13 12:50:06 monat sd 5:0:0:0: [sdb] Write Protect is off

May 13 12:50:06 monat sd 5:0:0:0: [sdb] Mode Sense: 43 00 00 00

May 13 12:50:06 monat sd 5:0:0:0: [sdb] Assuming drive cache: write through

May 13 12:50:06 monat sdb: unknown partition table

May 13 12:50:06 monat sd 5:0:0:0: [sdb] Attached SCSI removable disk

May 13 12:50:06 monat sd 5:0:0:0: Attached scsi generic sg2 type 0

May 13 12:50:06 monat usb-storage: device scan complete
```

I can then work a little with the device but sooner or later I get:

```
May 13 13:29:40 monat usb 3-3: reset high speed USB device using ehci_hcd and address 7

May 13 13:29:55 monat usb 3-3: device descriptor read/64, error -110

May 13 13:30:11 monat usb 3-3: device descriptor read/64, error -110

May 13 13:30:11 monat usb 3-3: reset high speed USB device using ehci_hcd and address 7

May 13 13:30:26 monat usb 3-3: device descriptor read/64, error -110

May 13 13:30:41 monat usb 3-3: device descriptor read/64, error -110

May 13 13:30:41 monat usb 3-3: reset high speed USB device using ehci_hcd and address 7

May 13 13:30:52 monat usb 3-3: device not accepting address 7, error -110

May 13 13:30:52 monat usb 3-3: reset high speed USB device using ehci_hcd and address 7

May 13 13:31:02 monat usb 3-3: device not accepting address 7, error -110

May 13 13:31:02 monat usb 3-3: USB disconnect, address 7

May 13 13:31:02 monat sd 5:0:0:0: Device offlined - not ready after error recovery

May 13 13:31:02 monat scsi 5:0:0:0: [sdb] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK,SUGGEST_OK

May 13 13:31:02 monat end_request: I/O error, dev sdb, sector 7496

May 13 13:31:02 monat Buffer I/O error on device dm-0, logical block 680

May 13 13:31:02 monat lost page write due to I/O error on dm-0

May 13 13:31:02 monat Buffer I/O error on device dm-0, logical block 681

...

```

I tried various vanilla kernels from 2.6.22.x to 2.6.25.3 and a current 2.6.25-r8 gentoo kernel to no avail.  I also tried to get the .config from the working binary kernel from the ubuntu live cd and rebuilt it from ubuntu sources, still same problem.

I have the feeling that it may not be the kernel, but another piece of configuration after kernel boot.

Removing the ehci modules lets me use the stick in slow mode (~8 hours for a backup to the stick  :Sad:  ).

Any hints appreciated.Last edited by the_bat on Mon May 19, 2008 9:31 am; edited 1 time in total

----------

## the_bat

I just rechecked with the gentoo live-cd 2007.0 --- it's broken there too.

Now, what could ubuntu be doing different with the USB-subsystem on the same hardware?

----------

## the_bat

*bump*

Any ideas?

----------

## doralsoral

I'm having a similar problem with an HD in an enclosure thats giving me the same error except in my case it never works. Let me know if you find a solution

----------

## doctork

Unfortunately, I can't offer anything except sympathy.  I have similar problems with USB flash drives and EHCI on my IBM T40P laptop -- if I enable EHCI in the kernel, I can't talk to the flash drives.  The UHCI drive appears to work, albeit at the expected much slower speed.  The same flash drive plugged into my Asus A8N-E based desktop works fine with the EHCI driver.  BTW, this was with 2.6.24-gentoo-r8 on both the laptap and desktop.

----------

## the_bat

I work-arounded the problem by reducing the number of sectors to write at once to the device.  I traced the problem by enabling all kinds of USB debugging in the kernel and always saw problems with large request after 6KB.

```
echo 8 > /sys/block/[your device]/device/max_sectors

```

This limits requests to 8 sectors (= 4KB).

I added a hook into udev to do this every time I plug in this specific stick.

You will probably see a big performance drop if done for hard disks.

----------

