LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   USB Hub disappearing after a few seconds of no USB device being inserted (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/usb-hub-disappearing-after-a-few-seconds-of-no-usb-device-being-inserted-876536/)

BruceDLong 04-22-2011 11:44 AM

USB Hub disappearing after a few seconds of no USB device being inserted
 
Hello everyone,
Here is what happens:
If I boot with a USB stick (or other USB device) inserted, the USB device will be found and work normally.
If I boot without it inserted then insert it, it will not be found; no message, nothing in dmesg.

If I remove the stick when the USB stick is working (working because I rebooted with it already inserted) and reinsert it within about 2 seconds it will be found again. I get messages that it was removed then messages that it was inserted, found and mounted.

BUT, if I remove the USB stick then wait for more than about 3 second before reinserting it; nothing. It isn't detected, the LED on the USB stick doesn't turn on, no messages in dmesg no new changes any relevant /sys or /proc files. (Unless there is something I don't know about which is possible.)

Here are some clues:
CLUE 1:
When the USB stick is working we have a directory: sys/class/scsi_host/host0

After the device is removed (and later when reinserted), the host0 disappears.

CLUE 2:
// Here is USB stick is working...

cm-t35 login: root
root@cm-t35:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp.
Bus 001 Device 003: ID 0ea0:2168 Ours Technology, Inc. Transcend JetFlash 2.0 / Astone USB Drive

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

// Now I'll remove it...

usb 1-1.1: USB disconnect, address 3

root@cm-t35:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@cm-t35:~#

// Now I'll reinsert it...
root@cm-t35:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@cm-t35:~#

CLUE 3:
As long as at least one item is plugged into the hub the hub won't power down. E.g. If I plug a USB mouse in then I can remove the memory stick and reinsert it. Likewise, I can remove and reinsert the mouse as long as I don't remove the memory stick.

It's only when all devices have been removed from the hub for >2 seconds, the hub will power down.



DATA:
I'm running a late version of Angstrom on a cm-t3530. I've tried difference configurations, update&&upgrade, and it happens on 3 different boards.

xeleema 04-23-2011 12:13 AM

Greetingz!

Not sure what Linux distribution you're running, but this sounds like your kernel's unloading it's USB-related modules after the USB hub goes to sleep.

1) Open a terminal window (aka "xterm", "konsole")

2) When it's all working, do the following;
lsmod | sort | tee -a ~/working.txt

3) Then get it to "break" and do this;
lsmod | sort | tee -a ~/broken.txt

4) Then find out the difference
diff ~/working.txt ~/broken.txt
Stuff with a "<" is in the working file, stuff with a ">" is in the broken file.
Find out what kernel module is only showing up when things are working.

BruceDLong 04-30-2011 06:05 PM

Actually, I did type lsmod for both the "broken" and "working" case and the results were in my first post.

For posterity, the problem was that the hub was powering down after two seconds of having nothing plugged into it. This is normal but in this case it wasn't responding to the power-up message when something was plugged in.

The solution was to add a phrase to the kernel boot command line telling the kernel to disable all powering down.


All times are GMT -5. The time now is 11:34 PM.