# USB mass storage problems [WORKAROUND]

## frostschutz

Hi,

I've got a Trekstor i.Beat organix MP3 player that's supposed to register itself as normal USB mass storage device when connected to the PC. This works out of the box in Windows 2000, as well as when booting Linux from a Knoppix-DVD. However, in Gentoo, using the 2.6.14-gentoo-r4 kernel, connecting the device causes the USB subsystem to freeze completely.

In dmesg, there is only one message when connecting the device: 

```
usb 1-1: new high speed USB device using ehci_hcd and address 3
```

After that, the USB subsystem is frozen, e.g. when calling something like 'lsusb', there will be no or only partially output, and the application will sleep in unkillable state until I unplug the device. Or, when connected at bootup, it will pause during the initialization of usb/hotplug, and cups. The booting process continues as soon as I unplug the device. When I do tha, there are two more messages in dmesg: 

```
usb 1-1: unable to read config index 0 descriptor/all

usb 1-1: can't read configurations, error -71
```

USB support, including mass storage support, as well as SCSI support (which I already need for Firewire/SBP2 scsi disk emulation), is all compiled into the kernel. Other USB devices (printer, scanner) work too (but not while the MP3 player is connected).

Does anybody know what's amiss here?Last edited by frostschutz on Fri Dec 16, 2005 8:21 pm; edited 1 time in total

----------

## sethleon

hello,

does other (usb) mass storage devices work after connecting to a port?

----------

## dsd

you should enable USB debug messages in the kernel config

----------

## frostschutz

Thanks for your replies.  :Smile: 

Unfortunately, the only other USB devices I own are printer and scanner. So far, I only used firewire devices (harddisk, burner, camcorder) for storage-related applications.

About the kernel debug messages, I enabled them in the kernel menuconfig like this: 

```
  │ │<*>   USB Mass Storage support                                       │ │  

  │ │[*]     USB Mass Storage verbose debug                               │ │
```

However, the only messages that turn up in dmesg are the ones I already posted. Do I have to do anything else to get to the USB debug messages?

----------

## frostschutz

 *frostschutz wrote:*   

> Unfortunately, the only other USB devices I own are printer and scanner. So far, I only used firewire devices (harddisk, burner, camcorder) for storage-related applications.

 

I just bought a USB Hub / Card Reader combo device. For this, /dev/sda through /dev/sdd are created. And there are a lot of debug messages too. However, when I connect the MP3 player to that HUB, the same freezing occurs. So I think it freezes before even starting to print debug messages. While this suggests that there may be something out of the ordinary with the MP3 player device, it doesn't explain why it's working in both Windows and Knoppix.

----------

## frostschutz

I experimented a bit with different kernel versions. Here are the results.

On a sidenote, during bootup I also get these USB-related messages. Are they critical? 

```
 Coldplugging usb devices ...

chown: cannot access `/proc/bus/usb/002/004': No such file or directory

chmod: cannot access `/proc/bus/usb/002/004': No such file or directory
```

Kernel 2.6.14-gentoo-r4: Frozen USB subsystem until unplug. Two messages in dmesg. 

```
usb 1-1.3: new high speed USB device using ehci_hcd and address 6

usb 1-1.3: can't set config #1, error -71
```

Kernel 2.6.14.3: Frozen USB subsystem, one additional message in dmesg. 

```
usb 1-1.3: new high speed USB device using ehci_hcd and address 6

ehci_hcd 0000:00:10.3: qh dfc4c400 (#00) state 4

usb 1-1.3: can't set config #1, error -71
```

Kernel 2.6.15-rc5-mm1: Frozen USB, kernel panic after unplugging the device. 

```
usb 1-1.3: new high speed USB device using ehci_hcd and address 6

usb 1-1.3: configuration #1 chosen from 1 choice

Unable to handle kernel NULL pointer dereference at virtual address 00000000

 printing eip:

c015f878

*pde = 00000000

Oops: 0000 [#1]

PREEMPT 

last sysfs file: /class/vc/vcsa6/dev

Modules linked in: it87 hwmon_vid eeprom lm90 hwmon i2c_isa i2c_viapro i2c_core

CPU:    0

EIP:    0060:[<c015f878>]    Not tainted VLI

EFLAGS: 00010046   (2.6.15-rc5-mm1) 

EIP is at kfree+0x38/0x70

eax: 00000000   ebx: 0000018d   ecx: dfcf6c20   edx: 00000001

esi: 00000000   edi: 00000001   ebp: 00000202   esp: c1565e60

ds: 007b   es: 007b   ss: 0068

Process khubd (pid: 88, threadinfo=c1564000 task=c152b550)

Stack: <0>00000000 00000009 0000018d ffffffb9 dfa0e400 dec05c00 c03442ff 00000001 

       <0>80000600 00000009 00000000 00000001 00000000 00000000 00000000 00001388 

       <0>dec05cf4 00000001 00000001 dfcf6c20 dfa0e400 00000000 dec05c00 00000001 

Call Trace:

 [<c03442ff>] usb_set_configuration+0x39f/0x4a0

 [<c033db1a>] usb_new_device+0xaa/0x180

 [<c033ee0a>] hub_port_connect_change+0x27a/0x450

 [<c0330089>] arm_lock64+0x559/0x5b0

 [<c033f23a>] hub_events+0x25a/0x4c0

 [<c033f4b9>] hub_thread+0x19/0xf0

 [<c012fb70>] autoremove_wake_function+0x0/0x60

 [<c012fb70>] autoremove_wake_function+0x0/0x60

 [<c033f4a0>] hub_thread+0x0/0xf0

 [<c012f586>] kthread+0xb6/0xf0

 [<c012f4d0>] kthread+0x0/0xf0

 [<c0101055>] kernel_thread_helper+0x5/0x10

Code: 24 08 89 74 24 0c 89 6c 24 14 85 ff 74 30 9c 5d fa 8d 87 00 00 00 40 c1 e8 0c c1 e0 05 03 05 30 50 57 c0 8b 70 18 e8 d8 5b 11 00 <8b> 1c 86 8b 03 3b 43 04 73 1d 89 7c 83 10 40 89 03 55 9d 8b 5c
```

If required, I can provide complete dmesg output for each kernel.

----------

## frostschutz

I forgot Knoppix (kernel 2.6.12) output: 

```
usb 1-1.3: new full speed USB device using uhci_hcd and address 8

scsi3 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 8

usb-storage: waiting for device to settle before scanning

  Vendor: TrekStor  Model: i.Beat organix    Rev: 0100

  Type:   Direct-Access                      ANSI SCSI revision: 04

SCSI device sdb: 1012480 512-byte hdwr sectors (518 MB)

sdb: Write Protect is off

sdb: Mode Sense: 03 00 00 00

sdb: assuming drive cache: write through

SCSI device sdb: 1012480 512-byte hdwr sectors (518 MB)

sdb: Write Protect is off

sdb: Mode Sense: 03 00 00 00

sdb: assuming drive cache: write through

 sdb: sdb1

Attached scsi removable disk sdb at scsi3, channel 0, id 0, lun 0

usb-storage: device scan complete
```

----------

## dsd

 *frostschutz wrote:*   

> About the kernel debug messages, I enabled them in the kernel menuconfig like this: 

 

the debug option i was referring to is "USB verbose debug messages" (CONFIG_USB_DEBUG)

----------

## frostschutz

Whoops. Sorry.   :Embarassed: 

I enabled the messages in kernel 2.6.14-gentoo-r4 now.

When plugging the device in, the following comes up: 

```
hub 1-1:1.0: state 5 ports 4 chg 0000 evt 0008

hub 1-1:1.0: port 3, status 0101, change 0001, 12 Mb/s

hub 1-1:1.0: debounce: port 3: total 100ms stable 100ms status 0x101

usb 1-1.3: new high speed USB device using ehci_hcd and address 13

usb 1-1.3: khubd timed out on ep0in len=9/9

usb 1-1.3: khubd timed out on ep0in len=32/32

usb 1-1.3: hcd_unlink_urb d4ab86e0 fail -16
```

When unplugging the device: 

```
usb 1-1.3: default language 0x0409

ehci_hcd 0000:00:10.3: devpath 1.3 ep0in 3strikes

ehci_hcd 0000:00:10.3: devpath 1.3 ep0in 3strikes

ehci_hcd 0000:00:10.3: devpath 1.3 ep0in 3strikes

ehci_hcd 0000:00:10.3: devpath 1.3 ep0in 3strikes

ehci_hcd 0000:00:10.3: devpath 1.3 ep0in 3strikes

ehci_hcd 0000:00:10.3: devpath 1.3 ep0in 3strikes

usb 1-1.3: new device strings: Mfr=1, Product=2, SerialNumber=3

usb 1-1.3: hotplug

ehci_hcd 0000:00:10.3: devpath 1.3 ep0out 3strikes

usb 1-1.3: can't set config #1, error -71

usb 1-1.3: hotplug

hub 1-1:1.0: state 5 ports 4 chg 0000 evt 0008

hub 1-1:1.0: port 3, status 0300, change 0003, 1.5 Mb/s

hub 1-1:1.0: debounce: port 3: total 100ms stable 100ms status 0x300
```

----------

## dsd

next step would be to see if you can reproduce it on 2.6.15-rc5

----------

## frostschutz

In 2.6.15-rc5, it's the same story.

```
hub 1-1:1.0: state 5 ports 4 chg 0000 evt 0008

hub 1-1:1.0: port 3, status 0101, change 0001, 12 Mb/s

hub 1-1:1.0: debounce: port 3: total 100ms stable 100ms status 0x101

usb 1-1.3: new high speed USB device using ehci_hcd and address 6

usb 1-1.3: hcd_unlink_urb d0aac160 fail -16

usb 1-1.3: khubd timed out on ep0in len=9/9

usb 1-1.3: khubd timed out on ep0in len=32/32

usb 1-1.3: hcd_unlink_urb cf506ea0 fail -16

usb 1-1.3: default language 0x0409

ehci_hcd 0000:00:10.3: devpath 1.3 ep0in 3strikes

ehci_hcd 0000:00:10.3: devpath 1.3 ep0in 3strikes

ehci_hcd 0000:00:10.3: devpath 1.3 ep0in 3strikes

ehci_hcd 0000:00:10.3: devpath 1.3 ep0in 3strikes

ehci_hcd 0000:00:10.3: devpath 1.3 ep0in 3strikes

ehci_hcd 0000:00:10.3: devpath 1.3 ep0in 3strikes

usb 1-1.3: new device strings: Mfr=1, Product=2, SerialNumber=3

usb 1-1.3: hotplug

ehci_hcd 0000:00:10.3: devpath 1.3 ep0out 3strikes

usb 1-1.3: can't set config #1, error -71

usb 1-1.3: hotplug

hub 1-1:1.0: state 5 ports 4 chg 0000 evt 0008

hub 1-1:1.0: port 3, status 0300, change 0003, 1.5 Mb/s

hub 1-1:1.0: debounce: port 3: total 100ms stable 100ms status 0x300
```

----------

## ingemar

I've got the same problem, but I'm using a SanDisk mp3-player. And it does work on my iBook with Gentoo installed...

----------

## entemoehre

are you connecting the device to a usb-hub or directly to the usb port? I had similar problems with several USB 2.0 hubs some time ago.

----------

## ingemar

Heh, I solved my problem! I was connecting my usb wire to a extension cable that came along with a wireless USB mouse. But connecting the mp3player to the USB port directly fixes it. Maybe the extension cable doesn't have enough channels?

Regarding your problem, could it be that your kernel doesn't have support for USB 2.0? Or something like that...

----------

## frostschutz

 *entemoehre wrote:*   

> are you connecting the device to a usb-hub or directly to the usb port?

 

I only just bought a USB hub after reporting this problem; I'm using this hub now, and devices attached to this hub work well (the HUB uses a Cypress chipset which was recommended by the USB-Linux project IIRC). For the MP3 player, wether I connect it directly to a port or to the hub, it does not work in the more recent kernels. In Knoppix (2.6.12 kernel), it does work both connected directly and connected via the HUB. So I don't think the HUB can be the main cause of my problem.

Any insights on this matter are welcome; if we can't solve the problem til the end of the week, I think I'll contact the usb-linux mailing list.  :Smile: 

----------

## frostschutz

I did a little more investigating (compiling kernels and testing), and found a workaround for the problem.

I already wrote that Knoppix successfully detects the device; my Knoppix DVD was using Linux 2.6.12 and claimed to use an unpatched, out-of-the-box vanilla kernel, so I didn't investigate any further. However, it striked me odd that when I compiled my own 2.6.12 kernel, it didn't detect the device. Even after extracting the exact .config that Knoppix was using and compiling a kernel with that, it still did not work.

So I had to look at the logs created by Knoppix when detecting this device more closely; and only when I did that I noticed that Knoppix was not using USB2.0 for this device (ehci), but just the plain old normal USB1 implementation (uhci or whatever). Why exactly it did that, I do not know, since the Knoppix kernel had support for ehci built in (as a module) just like my own kernel did.

Anyway, I took the hint and disabled ehci completely in my kernel. And what do you know, the device is detected correctly in 2.6.14-gentoo-r4 now. The downside of this workaround is, that now all my devices have to use the slow USB1 speed, although they all are supposed to support USB2.0 (my MP3 player included).

----------

## ptitoine

I've the same problem with all USB2 hardware, but i don't know when it's appear, i've changed kernels a few times, and i've tried with 2.6.12-gentoo-r10 yesterday and the problem is still here, i'm fed up with this problem

```
t40p ptitoine # uname -a

Linux t40p 2.6.14-gentoo-r4 #1 PREEMPT Sun Dec 25 21:59:28 UTC 2005 i686 Intel(R) Pentium(R) M processor 1600MHz GenuineIntel GNU/Linux
```

before pluging a USB2 Flash drive (same problem with other hardware)

```
t40p ptitoine # dmesg | tail -n 20

input: USB HID v1.11 Mouse [Logitech USB Receiver] on usb-0000:00:1d.1-1

e1000: lan: e1000_watchdog_task: NIC Link is Up 100 Mbps Full Duplex

[fglrx] Kernel AGP support doesn't provide agplock functionality.

[fglrx] AGP detected, AgpState   = 0x1f000217 (hardware caps of chipset)

agpgart: Found an AGP 2.0 compliant device at 0000:00:00.0.

agpgart: Putting AGP V2 device at 0000:00:00.0 into 4x mode

agpgart: Putting AGP V2 device at 0000:01:00.0 into 4x mode

[fglrx] AGP enabled,  AgpCommand = 0x1f000314 (selected caps)

[fglrx] free  AGP = 256126976

[fglrx] max   AGP = 256126976

[fglrx] free  LFB = 47165440

[fglrx] max   LFB = 47165440

[fglrx] free  Inv = 0

[fglrx] max   Inv = 0

[fglrx] total Inv = 0

[fglrx] total TIM = 0

[fglrx] total FB  = 0

[fglrx] total AGP = 65536

process `nslookup' is using obsolete setsockopt SO_BSDCOMPAT

ipw2200: Unknown notification: subtype=40,flags=0xa0,size=40
```

after pluging the USB2 Flash drive

```
t40p ptitoine # dmesg | tail -n 20

[fglrx] Kernel AGP support doesn't provide agplock functionality.

[fglrx] AGP detected, AgpState   = 0x1f000217 (hardware caps of chipset)

agpgart: Found an AGP 2.0 compliant device at 0000:00:00.0.

agpgart: Putting AGP V2 device at 0000:00:00.0 into 4x mode

agpgart: Putting AGP V2 device at 0000:01:00.0 into 4x mode

[fglrx] AGP enabled,  AgpCommand = 0x1f000314 (selected caps)

[fglrx] free  AGP = 256126976

[fglrx] max   AGP = 256126976

[fglrx] free  LFB = 47165440

[fglrx] max   LFB = 47165440

[fglrx] free  Inv = 0

[fglrx] max   Inv = 0

[fglrx] total Inv = 0

[fglrx] total TIM = 0

[fglrx] total FB  = 0

[fglrx] total AGP = 65536

process `nslookup' is using obsolete setsockopt SO_BSDCOMPAT

ipw2200: Unknown notification: subtype=40,flags=0xa0,size=40

usb 4-4: new high speed USB device using ehci_hcd and address 5

usb 4-4: new high speed USB device using ehci_hcd and address 9
```

removing the f*****g ehci_hcd module

```
t40p ptitoine # rmmod ehci_hcd
```

dmesg after removing

```
t40p ptitoine # dmesg | tail -n 20

usb 2-2: new full speed USB device using uhci_hcd and address 4

Initializing USB Mass Storage driver...

scsi0 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 4

usb-storage: waiting for device to settle before scanning

usbcore: registered new driver usb-storage

USB Mass Storage support registered.

  Vendor: I0MEGA    Model: UMni128MB*IOM2H4  Rev: 2.00

  Type:   Direct-Access                      ANSI SCSI revision: 02

usb-storage: device scan complete

SCSI device sda: 256000 512-byte hdwr sectors (131 MB)

sda: Write Protect is off

sda: Mode Sense: 03 00 00 00

sda: assuming drive cache: write through

SCSI device sda: 256000 512-byte hdwr sectors (131 MB)

sda: Write Protect is off

sda: Mode Sense: 03 00 00 00

sda: assuming drive cache: write through

 sda: sda1

Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
```

lspci output

```
t40p ptitoine # lspci

00:00.0 Host bridge: Intel Corporation 82855PM Processor to I/O Controller (rev 03)

00:01.0 PCI bridge: Intel Corporation 82855PM Processor to AGP Controller (rev 03)

00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 01)

00:1d.1 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 01)

00:1d.2 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 01)

00:1d.7 USB Controller: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller (rev 01)

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 81)

00:1f.0 ISA bridge: Intel Corporation 82801DBM (ICH4-M) LPC Interface Bridge (rev 01)

00:1f.1 IDE interface: Intel Corporation 82801DBM (ICH4-M) IDE Controller (rev 01)

00:1f.3 SMBus: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller (rev 01)

00:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 01)

00:1f.6 Modem: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller (rev 01)

01:00.0 VGA compatible controller: ATI Technologies Inc Radeon R250 Lf [FireGL 9000] (rev 02)

02:00.0 CardBus bridge: Texas Instruments PCI1520 PC card Cardbus Controller (rev 01)

02:00.1 CardBus bridge: Texas Instruments PCI1520 PC card Cardbus Controller (rev 01)

02:01.0 Ethernet controller: Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile) (rev 03)02:02.0 Network controller: Intel Corporation PRO/Wireless 2915ABG MiniPCI Adapter (rev 05)
```

lsusb output (the drive is ID 4146:2168)

```
t40p ptitoine # lsusb

Bus 003 Device 001: ID 0000:0000

Bus 002 Device 004: ID 4146:2168

Bus 002 Device 003: ID 046d:c50e Logitech, Inc.

Bus 002 Device 001: ID 0000:0000

Bus 001 Device 001: ID 0000:0000
```

if someone has an idea ?!

----------

## frostschutz

I sent a message to the usb-users mailing list about my problem, and they basically said it's most likely due to a buggy VIA USB chipset, and I could probably fix it by buying another controller. However, according to your lspci, your's is actually an Intel. Unfortunately you don't have USB debug messages enabled, so we can't be sure we're really suffering from the same problem (although it has the same effect and solution). Unfortunately, I myself do not own the MP3 player device anymore; I sent it back today due to other problems.

----------

## ptitoine

I've an Intel chipset I855M with an ICH4 south bridge

Therefore i've ehci working on this laptop

----------

## ptitoine

hello frostschutz,

I've switched back to nitro-sources with 2.6.14-nitro2 and my usb2 flash drive works  :Smile: 

I can not check with my other USB2 hardware (2 hard drives) because I'm not @ home

bye

----------

