OTG MUSB driver issue?


Several times I encountered issues with devices connected to the
beagle board's OTG port (through a powered hub).
(kernel 2.6.28-omap1).
Today this happened again and I was lucky enough to be able to find
the symptoms.

Scenario: I had a file on a USB hard disk. This file was copied to an
SD card. After copying the file was corrupted.
Removing the card and hard disk and connecting them to my linux box
allowed me to compare the SD and hard disk version (using cmp -l).
There were differences on four places. Each difference was 4 bytes (32
bits) and occurred on a 4 byte boundary.

I have no idea what causes it, but I strongly suspect the MUSB driver.
A hauppauge usb tv card also does not work when connected to the hub,
whereas the same card works without problem on a linksys NSLU2 (which
also has an arm processor).

Anyone suggestions? Patches ??


I guess that should be already fixed with patches queued up in Greg's
queue, but then again, let me check more. Could you:

# echo 5 > /sys/modules/musb_hdrc/parameters/debug
# echo 8 > /proc/sysrq-trigger

then connect device and send me log output ?

Hi Balbi,

Thanks for your help.
It was echo 5 > /sys/module/musb_hdrc/parameters/musb_debug

Also beforestarting the system I removed all other usb devices from
the hub (I have to use a hub to get enough power for the hard disk).

After connecting the disk it took about two seconds before the system
started to generate log data.
The system kept on generating debug info so after about two minutes I
decided that it was enough and switched off the beagle and saved the
log file. If this is too short let me know and I'll repeat the
The last 30 lines or so are probably caused by the device loosing
power. At that point it was still very busy generating messages

The log file is attached: 54 k gizpped 1.2M unzipped.

If you happen to have a patch that would be great.

Best regards, Frans

minicom.cap.gz (53.6 KB)

I tried this on the current linux-omap codebase (as of today). I
transferred a 1 GB file back-and-forth a couple of times between
a flash drive and an SD card on a USB card reader (both connected
through a USB hub to the MUSB port). There was no data corruption.

How big was your file? Any chance the card reader or the hard drive
is bad?

What kind of corruption do you see? (You mentioned 4 bytes were different
in 4 places. How different?)

- Anand

P.S. I tested this on the 3430 SDP. Only changes I made from the
defconfig were to remove CONFIG_USB_STORAGE_DEBUG and CONFIG_DEBUG_LL.

Anand, Felipe, thanks for the feedback.

I did a short test. I copied the the musb driver source dir from the
linux-omap git to the angstrom kernel, compiled it and
tested it.
Same problem. I verified that the driver code indeed got recompiled
(threw away the .o files and uimage)
Attached is a picture from my webcam. The colored stripes are always
on different locations.

Also the diffs between the 2 pictures that I reported before:
ce_blank.png ce_blank.png-
frans@linux-suse:~> cmp -l ce*
12709 161 0
12710 303 60
12711 125 120
12712 356 1
12761 237 10
12762 247 0
12763 246 105
12764 51 20
12797 156 100
12798 332 0
12799 347 100
12800 146 6
13713 335 24
13714 153 307
13715 20 326
13716 106 114

Best regards, Frans.