I am testing the USB host and standby functionality of the DM3730 Torpdeo Eval board for a planned design, using BSP 2.4.2.
So far ISP1763 seems to work as expected when the SoM goes into standby, e.g. connected USB devices resume their work.
Here is a typical suspend/wakeup log:
[ 263.283111] PM: Syncing filesystems ... done.
[ 263.301849] PM: Preparing system for mem sleep
[ 263.340209] mmc0: card b368 removed
[ 263.423980] omap_device: omap_i2c.1: new worst case activate latency 0: 183105
[ 263.547149] Freezing user space processes ... (elapsed 0.01 seconds) done.
[ 263.573608] Freezing remaining freezable tasks ... (elapsed 0.02 seconds) done.
[ 263.604187] PM: Entering mem sleep
[ 263.608489] omap_device: smartreflex.0: new worst case deactivate latency 0: 183105
[ 263.639984] ISP1763 resuming
[ 263.653289] Phy: Stopping machine
[ 263.750579] ISP1763 suspended
[ 263.758941] PM: suspend of devices complete after 123.718 msecs
[ 263.772796] PM: late suspend of devices complete after 7.507 msecs
[ 263.780700] omap_device: omap_uart.2: new worst case deactivate latency 0: 244140
[ 265.124847] omap_device: omap_uart.0: new worst case activate latency 0: 61035
[ 265.140594] Successfully put all powerdomains to target state
[ 265.151031] PM: early resume of devices complete after 4.058 msecs
[ 265.167694] omap_device: omap2_mcspi.1: new worst case activate latency 0: 122070
[ 265.178009] ISP1763 resuming
[ 265.196472] Phy: Starting machine
[ 265.268096] PM: resume of devices complete after 106.292 msecs
[ 265.284484] PM: Finishing wakeup.
[ 265.287963] Restarting tasks ... done.
[ 265.600189] mmc0: host does not support reading read-only switch. assuming write-enable.
[ 265.624999] mmc0: new SDHC card at address b368
[ 265.641815] mmcblk0: mmc0:b368 NCard 3.73 GiB
[ 265.659759] mmcblk0: p1
[ 267.195739] eth0: link down
[ 268.195709] eth0: link up, 100Mbps, full-duplex
However when using the OMAP´s OTG port (using a proper OTG-host cable; with pin 5 pulled to GND) the behavior is different:
When the MUSB_HDRC part of the kernel is set to Host Mode all connected devices are disconnected and reconnected after suspend:
[ 69.845886] Phy: Starting machine
[ 69.926025] PM: resume of devices complete after 121.490 msecs
[ 69.942474] PM: Finishing wakeup.
[ 69.945953] Restarting tasks ...
[ 69.951660] omap_device: musb-omap2430.-1: new worst case activate latency 0: 152587
[ 69.972351] done.
[ 69.985870] omap_device: omap_i2c.1: new worst case deactivate latency 0: 61035
[ 70.019073] hub 1-0:1.0: activate --> -22
[ 70.314575] mmc0: host does not support reading read-only switch. assuming write-enable.
[ 70.337646] mmc0: new SDHC card at address b368
[ 70.354125] mmcblk0: mmc0:b368 NCard 3.73 GiB
[ 70.372039] mmcblk0: p1
[ 70.517791] usb 1-1: new high speed USB device number 2 using musb-hdrc
[ 70.679077] usb 1-1: New USB device found, idVendor=05e3, idProduct=0608
[ 70.686279] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[ 70.693847] usb 1-1: Product: USB2.0 Hub
[ 70.710968] hub 1-1:1.0: USB hub found
[ 70.719482] hub 1-1:1.0: 4 ports detected
[ 71.010437] usb 1-1.4: new full speed USB device number 3 using musb-hdrc
[ 71.129364] usb 1-1.4: New USB device found, idVendor=1546, idProduct=01a8
[ 71.136749] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
When it is configured to OTG mode devices are discovered after loading a gadget module (Why is that needed?), but are not working after suspend at all:
[ 37.768249] PM: Entering mem sleep
[ 37.772552] omap_device: smartreflex.0: new worst case deactivate latency 0: 183105
[ 37.815368] ISP1763 resuming
[ 37.822631] Phy: Stopping machine
[ 37.930267] ISP1763 suspended
[ 37.938659] PM: suspend of devices complete after 139.282 msecs
[ 37.957458] omap_device: musb-omap2430.-1: new worst case deactivate latency 0: 213623
[ 37.966339] PM: late suspend of devices complete after 21.362 msecs
[ 40.765686] omap_device: omap_uart.0: new worst case activate latency 0: 61035
[ 40.773620] Successfully put all powerdomains to target state
[ 40.795379] PM: early resume of devices complete after 15.411 msecs
[ 40.857604] omap_device: omap2_mcspi.1: new worst case activate latency 0: 152587
[ 40.868103] ISP1763 resuming
[ 40.886840] Phy: Starting machine
[ 41.103210] usb 2-1: reset high speed USB device number 2 using musb-hdrc
[ 41.228149] usb 2-1: device descriptor read/64, error -19
[ 41.462524] usb 2-1: device descriptor read/64, error -19
[ 42.884918] eth0: link down
[ 43.885070] eth0: link up, 100Mbps, full-duplex
[ 44.650024] hub 2-0:1.0: Cannot enable port 1. Maybe the USB cable is bad?
[ 47.736022] hub 2-0:1.0: Cannot enable port 1. Maybe the USB cable is bad?
[ 50.821868] hub 2-0:1.0: Cannot enable port 1. Maybe the USB cable is bad?
[ 50.830078] PM: resume of devices complete after 9978.638 msecs
[ 50.846405] PM: Finishing wakeup.
[ 50.849884] Restarting tasks ...
[ 50.855590] usb 2-1: USB disconnect, device number 2
[ 50.922271] done.
[ 50.960510] omap_device: omap_uart.2: new worst case deactivate latency 0: 61035
[ 51.219238] mmc0: host does not support reading read-only switch. assuming write-enable.
[ 51.244079] mmc0: new SDHC card at address b368
[ 51.260620] mmcblk0: mmc0:b368 NCard 3.73 GiB
[ 51.278625] mmcblk0: p1
[ 53.970550] hub 2-0:1.0: Cannot enable port 1. Maybe the USB cable is bad?
Only when issuing rmmod g_zero and modprobe g_zero the devices are detected again.