You are not logged in.

#1 2010-12-28 13:25:34

xCrucialDudex
Member
Registered: 2007-08-19
Posts: 144

USB resets USB device(s) connected to bus-powered USB hub

I've a latptop and USB hub that's connected to its USB port, no PSU for the hub, so it's bus-powered. I've 2-3 external SATA hard drives connected to this hub via USB interface, all hard drives have PSUs of their own, so they draw only 2mA according to lsusb.

Now, I'm running Listen that plays MP3s off one of the external drives and I have tar busy unpacking a big number of archives to another drive that's connected to USB hub.

And the music started pausing, sort of, just no sound for 10 seconds or something like that, and then it plays again. So I checked lsusb output, all the devices connected to all USB buses were there, so I looked into dmesg output and there I saw this:

usb 1-3.2: reset high speed USB device using ehci_hcd and address 12
usb 1-3.2: reset high speed USB device using ehci_hcd and address 12
usb 1-3.1: reset high speed USB device using ehci_hcd and address 8
usb 1-3.2: reset high speed USB device using ehci_hcd and address 12
usb 1-3.2: reset high speed USB device using ehci_hcd and address 12
usb 1-3.1: reset high speed USB device using ehci_hcd and address 8
usb 1-3.2: reset high speed USB device using ehci_hcd and address 12

this happens each time the music in Listen goes off, so the drive is being reset. Especially when USB bus is busy and loaded heavily. I'm relatively new to USB in Linux so my question would be what's going on here? How do I troubleshoot this? Is it just a poor quality USB hub? (if drives are connected to laptop's USB ports directly I never experienced a problem like that, even under heavy load). Is there any chance of simply tweaking the settings or will I have to go out and buy a more powerful and robust USB hub?

Offline

#2 2010-12-28 13:32:30

xCrucialDudex
Member
Registered: 2007-08-19
Posts: 144

Re: USB resets USB device(s) connected to bus-powered USB hub

Bus 001 Device 008: ID 152d:2338 JMicron Technology Corp. / JMicron USA Technology Corp. JM20337 Hi-Speed USB to SATA & PATA Combo Bridge
Bus 001 Device 012: ID 152d:2338 JMicron Technology Corp. / JMicron USA Technology Corp. JM20337 Hi-Speed USB to SATA & PATA Combo Bridge

this is from lsusb that indicates that it is external hard drives that are being reset, indeed.

Offline

#3 2010-12-30 15:03:40

Daniel_F
Member
From: Brazil
Registered: 2010-12-28
Posts: 69

Re: USB resets USB device(s) connected to bus-powered USB hub

This is just a wild guess, but....

What would happen if you add

options usbcore autosuspend=-1

to your  /etc/modprobe.d/modprobe.conf   ?

Offline

#4 2010-12-30 15:14:43

xCrucialDudex
Member
Registered: 2007-08-19
Posts: 144

Re: USB resets USB device(s) connected to bus-powered USB hub

Daniel_F wrote:

This is just a wild guess, but....

What would happen if you add

options usbcore autosuspend=-1

to your  /etc/modprobe.d/modprobe.conf   ?

wouldn't I damage my equipment that way?

Offline

#5 2010-12-30 16:30:24

Daniel_F
Member
From: Brazil
Registered: 2010-12-28
Posts: 69

Re: USB resets USB device(s) connected to bus-powered USB hub

I don't think so ! 

All it does is disable the kernel's usbcore module autosuspend feature. No harm there except, maybe, slightly increased power consumption.

From the kernel documentation  (http://www.kernel.org/doc/Documentation … gement.txt):

The USB specification states that all USB devices must support power management.  Nevertheless, the sad fact is that many devices do not support it very well.  You can suspend them all right, but when you try to resume them they disconnect themselves from the USB bus or they stop working entirely.  For this reason, by default the kernel disables autosuspend (the power/control attribute is initialized to "on") for all devices other than hubs. Hubs, at least, appear to be reasonably well-behaved inthis regard.

Sometimes it turns out that even when a device does work okay with autosuspend there are still problems.

and

The default autosuspend idle-delay time is controlled by a module parameter in usbcore.  You can specify the value when usbcore is loaded.  For example, to set it to 5 seconds instead of 2 you would do:

    modprobe usbcore autosuspend=5

Equivalently, you could add to /etc/modprobe.conf a line saying:

    options usbcore autosuspend=5

Some distributions load the usbcore module very early during the boot process, by means of a program or script running from an initramfs image.  To alter the parameter value you would have to rebuild that image.

If usbcore is compiled into the kernel rather than built as a loadable module, you can add

    usbcore.autosuspend=5

to the kernel's boot command line.

Finally, the parameter value can be changed while the system is running.  If you do:

    echo 5 >/sys/module/usbcore/parameters/autosuspend

then each new USB device will have its autosuspend idle-delay initialized to 5.  (The idle-delay values for already existing devices will not be affected.)

Setting the initial default idle-delay to -1 will prevent any autosuspend of any USB device.  This is a simple alternative to disabling CONFIG_USB_SUSPEND and rebuilding the kernel, and it has the added benefit of allowing you to enable autosuspend for selected devices.

Offline

#6 2010-12-31 13:51:27

xCrucialDudex
Member
Registered: 2007-08-19
Posts: 144

Re: USB resets USB device(s) connected to bus-powered USB hub

I tried that but it didn't change anything, unfortunatelly. It's still a mystery to me why it would sometimes work without any problems for almost 8 hours in a row and then reset the devices two times in half an hour.

Offline

#7 2010-12-31 18:41:05

Daniel_F
Member
From: Brazil
Registered: 2010-12-28
Posts: 69

Re: USB resets USB device(s) connected to bus-powered USB hub

What about temperature ??  Is the USB hub getting hot ??  It might be overheating and resetting itself....

Offline

#8 2010-12-31 19:27:58

xCrucialDudex
Member
Registered: 2007-08-19
Posts: 144

Re: USB resets USB device(s) connected to bus-powered USB hub

Daniel_F wrote:

What about temperature ??  Is the USB hub getting hot ??  It might be overheating and resetting itself....

No, it's not hot it's almost cold. Each drive draws only 2mA and I've been using only one drive today and it got reset three times in 8 hours or so.

Offline

#9 2011-03-07 08:19:06

thelucster
Member
Registered: 2009-02-25
Posts: 18

Re: USB resets USB device(s) connected to bus-powered USB hub

Hi xCrucialDudex, have you come across the solution to this? I have been having a similar problem, however I have the drives setup in a software raid. When they reset (all at the same time) the raid marks them as faulty >_<

A couple of things you might want to try if you haven't solved this already:

Reduce the maximum number of sectors read at a time on each device:

# cat /sys/block/sda/device/max_sectors
240
# echo 64 > /sys/block/sda/device/max_sectors

http://gordonazmo.wordpress.com/2010/08 … it-for-me/

And secondly try changing the default queue scheduler for each device:

# cat /sys/block/sda/queue/scheduler
noop deadline [cfq]
# echo deadline > /sys/block/sda/queue/scheduler

https://bugs.launchpad.net/ubuntu/+sour … +bug/88746

Unfortunately this didn't solve it for me however. The other option I saw was to disable the ehci module and only use USB 1.1, however that isn't an option for me.

Offline

Board footer

Powered by FluxBB