This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

USB file storage gadget driver not responding to host after first mem sleep?

Other Parts Discussed in Thread: DM3730

Hi, everyone.


I have a board using DM3730 and runs PSP4.2.0.7.

I compiled g_ether and g_file_storage as modules and switch them on demand.

This works fine if after the board boots the device is connected to a host computer as g_ether and is switched to g_file_storage.

The g_file_storage driver won't respond to host if the switch happens between power up and the first sleep.

(1. power up, connect with g_ether loaded, switch to g_file_storage, then both g_file_storage and g_ether works perfectly from then on.

 2. power up, connect with g_ether loaded, sleep, wake up, then g_file_storage won't respond to host from then on, but g_ether is normal.)

Running SRP does not help.

What could possibly cause this behavior?

Host side dmesg:

[568864.653239] usb 3-1: new full-speed USB device number 31 using xhci_hcd
[568864.669595] usb 3-1: not running at top speed; connect to a high speed hub
[568864.670631] usb 3-1: New USB device found, idVendor=0525, idProduct=a4a2
[568864.670633] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[568864.670634] usb 3-1: Product: RNDIS/Ethernet Gadget
[568864.670635] usb 3-1: Manufacturer: Linux 2.6.37 with musb-hdrc
[568864.680131] cdc_ether 3-1:1.0 usb0: register 'cdc_ether' at usb-0000:00:14.0-1, CDC Ethernet Device, 2e:57:ae:1b:94:80
[568865.396392] usb 3-1: USB disconnect, device number 31
[568865.396520] cdc_ether 3-1:1.0 usb0: unregister 'cdc_ether' usb-0000:00:14.0-1, CDC Ethernet Device
[568866.285943] usb 3-1: new full-speed USB device number 32 using xhci_hcd
[568866.302254] usb 3-1: not running at top speed; connect to a high speed hub
[568866.302961] usb 3-1: New USB device found, idVendor=0525, idProduct=a4a5
[568866.302965] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[568866.302968] usb 3-1: Product: File-backed Storage Gadget
[568866.302970] usb 3-1: Manufacturer: Linux 2.6.37 with musb-hdrc
[568866.302972] usb 3-1: SerialNumber: 123456789ABC
[568866.309462] usb-storage 3-1:1.0: USB Mass Storage device detected
[568866.309515] usb-storage 3-1:1.0: Quirks match for vid 0525 pid a4a5: 10000
[568866.309552] scsi251 : usb-storage 3-1:1.0
[568888.703540] usb 3-1: reset full-speed USB device number 32 using xhci_hcd
[568888.720064] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep c068b32c
[568888.720067] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep c068b300
[568888.839596] usb 3-1: reset full-speed USB device number 32 using xhci_hcd
[568888.855960] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep c068b32c
[568888.855963] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep c068b300
[568894.982033] usb 3-1: reset full-speed USB device number 32 using xhci_hcd
[568894.998817] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep c068b32c
[568894.998821] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep c068b300
[568895.170163] usb 3-1: reset full-speed USB device number 32 using xhci_hcd
[568895.186583] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep c068b32c
[568895.186586] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep c068b300
[568895.306203] usb 3-1: reset full-speed USB device number 32 using xhci_hcd
[568895.322701] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep c068b32c
[568895.322705] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep c068b300
[568895.329092] scsi 251:0:0:0: Device offlined - not ready after error recovery

Device side dmesg:

[   95.351043] g_ether gadget: full speed config #1: CDC Ethernet (ECM)
[   95.357757] musb-hdrc periph: enabled ep2in for int IN, dma, maxpacket 16
[   95.358551] musb-hdrc periph: enabled ep1in for bulk IN, dma, maxpacket 64
[   95.358612] musb-hdrc periph: enabled ep1out for bulk OUT, dma, maxpacket 64
[   95.662475] devctl=0x99
[   96.639892] g_file_storage gadget: File-backed Storage Gadget, version: 1 September 2010
[   96.648529] g_file_storage gadget: Number of LUNs=3
[   96.653686] g_file_storage gadget-lun0: ro=1, nofua=0, file: /dev/mmcblk0p2
[   96.661041] g_file_storage gadget-lun1: ro=1, nofua=0, file: /dev/mmcblk0p4
[   96.668395] g_file_storage gadget-lun2: ro=0, nofua=0, file: /dev/mmcblk0p3
[   96.675781] musb g_file_storage gadget disconnected.
[   96.796417] platform iva.0: omap_voltage_scale: Already at the requestedrate 520000000
[   96.804809] platform mpu.0: omap_voltage_scale: Already at the requestedrate 600000000
[   96.982238] musb-hdrc periph: enabled ep1in for bulk IN, dma, maxpacket 64
[   96.982299] musb-hdrc periph: enabled ep1out for bulk OUT, dma, maxpacket 64
[   96.982330] g_file_storage gadget: full speed config #1
[  119.389862] musb-hdrc periph: enabled ep1in for bulk IN, dma, maxpacket 64
[  119.389953] musb-hdrc periph: enabled ep1out for bulk OUT, dma, maxpacket 64
[  119.390136] g_file_storage gadget: full speed config #1
[  119.525756] musb-hdrc periph: enabled ep1in for bulk IN, dma, maxpacket 64
[  119.525848] musb-hdrc periph: enabled ep1out for bulk OUT, dma, maxpacket 64
[  119.525909] g_file_storage gadget: full speed config #1