Lost stability on 64-bit kernels

Dear community,

I have serious complaint, related to current Linux stability of USB.

  1. The latest (fast/large capacity) USB flash drives produce errors during initial initialization. If you boot system, having these drives inserted, there aren’t such a messages.

If you put Transcend JetFlash T5 8 GB (not extremely fast, but good one) to to USB port, system produces the following message (diff of states before and after insert):


> usb 8-5: new high speed USB device using ehci_hcd and address 4
> usb 8-5: configuration #1 chosen from 1 choice
> scsi10 : SCSI emulation for USB Mass Storage devices
> usb 8-5: New USB device found, idVendor=058f, idProduct=6387
> usb 8-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> usb 8-5: Product: Mass Storage Device
> usb 8-5: Manufacturer: JetFlash
> usb 8-5: SerialNumber: 08LZE5JG
> usb-storage: device found at 4
> usb-storage: waiting for device to settle before scanning
> scsi 10:0:0:0: Direct-Access JetFlash Transcend 8GB 8.07 PQ: 0 ANSI: 2
> sd 10:0:0:0: [sdd] 15687678 512-byte hardware sectors: (8.03GB/7.47GiB)
> sd 10:0:0:0: [sdd] Write Protect is off
> sd 10:0:0:0: [sdd] Mode Sense: 03 00 00 00
> sd 10:0:0:0: [sdd] Assuming drive cache: write through
> sd 10:0:0:0: [sdd] 15687678 512-byte hardware sectors: (8.03GB/7.47GiB)
> sd 10:0:0:0: [sdd] Write Protect is off
> sd 10:0:0:0: [sdd] Mode Sense: 03 00 00 00
> sd 10:0:0:0: [sdd] Assuming drive cache: write through
> sdd: sdd1 sdd2 < sdd5 >
> sd 10:0:0:0: [sdd] Attached SCSI removable disk
> sd 10:0:0:0: Attached scsi generic sg5 type 0
> usb-storage: device scan complete

Flash drive works at full speed, degrading later.

If you put OCZ Throttle 32 GB (VERY fast) drive, you have:


> usb 8-6: new high speed USB device using ehci_hcd and address 5
> ehci_hcd 0000:00:1d.7: port 6 reset error -110
> hub 8-0:1.0: hub_port_status failed (err = -32)
> hub 8-0:1.0: unable to enumerate USB device on port 6
> usb 7-2: new full speed USB device using uhci_hcd and address 3
> usb 7-2: not running at top speed; connect to a high speed hub
> usb 7-2: configuration #1 chosen from 1 choice
> scsi11 : SCSI emulation for USB Mass Storage devices
> usb-storage: device found at 3
> usb-storage: waiting for device to settle before scanning
> usb 7-2: New USB device found, idVendor=152d, idProduct=0602
> usb 7-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> usb 7-2: Product: THROTTLE
> usb 7-2: Manufacturer: OCZ
> usb 7-2: SerialNumber: 00000000000000000659
> scsi 11:0:0:0: Direct-Access THROTTLE Dev PQ: 0 ANSI: 0 CCS
> sd 11:0:0:0: [sde] 63078400 512-byte hardware sectors: (32.2GB/30.0GiB)
> sd 11:0:0:0: [sde] Write Protect is off
> sd 11:0:0:0: [sde] Mode Sense: 00 38 00 00
> sd 11:0:0:0: [sde] Assuming drive cache: write through
> sd 11:0:0:0: [sde] 63078400 512-byte hardware sectors: (32.2GB/30.0GiB)
> sd 11:0:0:0: [sde] Write Protect is off
> sd 11:0:0:0: [sde] Mode Sense: 00 38 00 00
> sd 11:0:0:0: [sde] Assuming drive cache: write through
> sde: sde1
> sd 11:0:0:0: [sde] Attached SCSI disk
> sd 11:0:0:0: Attached scsi generic sg6 type 0
> usb-storage: device scan complete


As a result of error in ‘reset’, flash drive works, but only in USB 1.1 mode (12 Mb/s instead of 480 Mb/s)!

If you insert A-Data Xupreme 200X 16 GB drive, you will have:


> usb 8-6: new high speed USB device using ehci_hcd and address 55
> usb 8-6: configuration #1 chosen from 1 choice
> scsi51 : SCSI emulation for USB Mass Storage devices
> usb-storage: device found at 55
> usb-storage: waiting for device to settle before scanning
> usb 8-6: New USB device found, idVendor=125f, idProduct=d07a
> usb 8-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> usb 8-6: Product: A-DATA USB Flash Drive
> usb 8-6: Manufacturer: A-DATA
> usb 8-6: SerialNumber: AA80000000000164
> scsi 51:0:0:0: Direct-Access A-DATA USB Flash Drive 1100 PQ: 0 ANSI: 0 CCS
> sd 51:0:0:0: [sdd] 31326208 512-byte hardware sectors: (16.0 GB/14.9 GiB)
> sd 51:0:0:0: [sdd] Write Protect is off
> sd 51:0:0:0: [sdd] Mode Sense: 43 00 00 00
> sd 51:0:0:0: [sdd] Assuming drive cache: write through
> sd 51:0:0:0: [sdd] 31326208 512-byte hardware sectors: (16.0 GB/14.9 GiB)
> sd 51:0:0:0: [sdd] Write Protect is off
> sd 51:0:0:0: [sdd] Mode Sense: 43 00 00 00
> sd 51:0:0:0: [sdd] Assuming drive cache: write through
> sdd: sdd1
> sd 51:0:0:0: [sdd] Attached SCSI removable disk
> sd 51:0:0:0: Attached scsi generic sg5 type 0
> sd 51:0:0:0: Embedded Enclosure Device
> sd 51:0:0:0: Failed to get diagnostic page 0x8000002
> sd 51:0:0:0: Failed to bind enclosure -19
> usb-storage: device scan complete

This drive initially works at full speed, but, sometimes after, behave as the rest of drives (‘failure to bind enclosure’ seems harmless, in contrast to Throttle).

Kingston HyperX 4 GB doesn’t produce such a messages, but during creation of bootable flash, system doesn’t start – this can be corrected in ‘syslinux’ via setting ‘slow’ (?) flag during creation of bootable flash.

  1. All aforementioned phenomena you can see only on 64-bit kernels (I have tested SuSE and Ubuntu, both initial and patched versions). On 32-bit versions (both Linux and Windows) you don’t see this kind of behavior (I couldn’t check any 64-bit Windows, sorry).

  2. During bulk file transfer, initial flash drive performance is excellent, but sometimes after … it degrades up to hell (up to 10-15 KB/s)! There is NO any messages in system logs, it is just extremely slow … %-( 32-bit versions of Linux (and Windows) don’t show such a behavior. It looks like system has some loop in kernel, that occasionally exits (via timer? or similar).

This erratical behavior of USB/kernel subsystem is extremely painful, making work with the newest and/or large capacity flash drives practically impossible.

The problem doesn’t link to the single FD manufacture (as you saw, 4 of them have been tested), and it seems (mainly) 64-bit related, BUT, degrading of speed during large copy operations is common, both for 32- and 64-bit versions of Linux, Windows-32 shows slower transfer rates, but NO DEGRADATION.

If we want see Linux desktop as the real alternative to Wxyz, this situations shouldn’t exist for so long time, conserving between various kernels/distributions.

If somebody has access to kernel developers, please point them on these problems.

kvoz123 wrote:
> Dear community,
>
> I have serious complaint, related to current Linux stability of USB.
>
> 1. The latest (fast/large capacity) USB flash drives produce errors
> during initial initialization. If you boot system, having these drives
> inserted, there aren’t such a messages.
>
> If you put Transcend JetFlash T5 8 GB (not extremely fast, but good
> one) to to USB port, system produces the following message (diff of
> states before and after insert):
>
> ------------------------------
>> usb 8-5: new high speed USB device using ehci_hcd and address 4
>> usb 8-5: configuration #1 chosen from 1 choice
>> scsi10 : SCSI emulation for USB Mass Storage devices
>> usb 8-5: New USB device found, idVendor=058f, idProduct=6387
>> usb 8-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
>> usb 8-5: Product: Mass Storage Device
>> usb 8-5: Manufacturer: JetFlash
>> usb 8-5: SerialNumber: 08LZE5JG
>> usb-storage: device found at 4
>> usb-storage: waiting for device to settle before scanning
>> scsi 10:0:0:0: Direct-Access JetFlash Transcend 8GB 8.07 PQ: 0
> ANSI: 2
>> sd 10:0:0:0: [sdd] 15687678 512-byte hardware sectors:
> (8.03GB/7.47GiB)
>> sd 10:0:0:0: [sdd] Write Protect is off
>> sd 10:0:0:0: [sdd] Mode Sense: 03 00 00 00
>> sd 10:0:0:0: [sdd] Assuming drive cache: write through
>> sd 10:0:0:0: [sdd] 15687678 512-byte hardware sectors:
> (8.03GB/7.47GiB)
>> sd 10:0:0:0: [sdd] Write Protect is off
>> sd 10:0:0:0: [sdd] Mode Sense: 03 00 00 00
>> sd 10:0:0:0: [sdd] Assuming drive cache: write through
>> sdd: sdd1 sdd2 < sdd5 >
>> sd 10:0:0:0: [sdd] Attached SCSI removable disk
>> sd 10:0:0:0: Attached scsi generic sg5 type 0
>> usb-storage: device scan complete
> -----------------------------------
>
> Flash drive works at full speed, degrading later.
>
>
> If you put OCZ Throttle 32 GB (VERY fast) drive, you have:
>
> -----------------------------------
>> usb 8-6: new high speed USB device using ehci_hcd and address 5
>> ehci_hcd 0000:00:1d.7: port 6 reset error -110
>> hub 8-0:1.0: hub_port_status failed (err = -32)
>> hub 8-0:1.0: unable to enumerate USB device on port 6

This message usually comes from uhci_hcd being loaded BEFORE
ehci_hcd. The problem and the fix has been posted in a bug report, but
not yet fixed. The solution is simple. Add ehci_hcd to the modules
loaded on boot.

–snip a bunch of ranting –

> If somebody has access to kernel developers, please point them on
> these problems.

It is a distro problem, not a kernel problem!

> cat modules.order |grep hci
kernel/drivers/ieee1394/ohci1394.ko
kernel/drivers/usb/host/ehci-hcd.ko
kernel/drivers/usb/host/ohci-hcd.ko
kernel/drivers/usb/host/uhci-hcd.ko
kernel/drivers/staging/usbip/vhci-hcd.ko
kernel/drivers/ata/ahci.ko
kernel/drivers/bluetooth/hci_vhci.ko
kernel/drivers/bluetooth/hci_uart.ko
kernel/drivers/mmc/host/sdhci.ko
kernel/drivers/mmc/host/sdhci-pci.ko

As you see, ehci should load before uhci.

  1. It doesn’t explain, why many flash drives work? And why many of them – not …

  2. It doesn’t explain performance degradation during massive copy operations.

  3. Why 32-bit versions don’t suffer?