Part Number: AM5748
Other Parts Discussed in Thread: AM5706, , AM5728
Board: Custom board with AM5748 and AM5706 (We have two products based on AM5748 and AM5706.)
Processor SDK Linux RT 6.02
These products use point-to-point USB Ethernet between AM47xx and Windows using:
- Linux g_ether module: <kernel>/drivers/usb/gadget/legacy/ether.c
- Windows RNDIS USB driver (host/windows side).
Linux module g_ether is initialized, with modprobe parameters:
root@am57xx-evm:~# cat /etc/modprobe.d/g_ether.conf
options g_ether host_addr=8e:a0:8a:7a:f3:bc dev_addr=00:1e:58:41:b8:78
DTS:
&usb1 {
dr_mode = "peripheral";
maximum-speed = "high-speed";
};
&omap_dwc3_1 {
extcon = <&extcon_usb1>;
};
This P2P USB Ethernet works fine, even when USB cable is removed and re-connected.
Problem occurs when Windows PC (host side of P2P USB Ethernet) sleeps/suspends. When Windows PC wakes up, USB Ethernet does not work, until AM57xx device is rebooted or RNDIS module is reloaded using:
modprobe -r g_ether ; modprobe g_ether
Added some debug logs in kernel dwc3 driver (see below).
In working conditions, when removing and re-connecting USB, we always see “not-highlighted” logs below (and USB continues to work fine).
But in case of Windows PC suspend/sleep, "highlighted" logs are extra, which are leaving USB in suspended state.
When removing USB cable or Windows PC is suspends/sleeps:
[ 114.324024] dwc3 48890000.usb: dwc3_gadget_interrupt Event type 3
[ 114.330157] dwc3 48890000.usb: dwc3_gadget_linksts_change_interrupt STATE 5
[ 114.337183] dwc3 48890000.usb: dwc3_gadget_interrupt Event type 3
[ 114.343308] dwc3 48890000.usb: dwc3_gadget_linksts_change_interrupt STATE 3
[ 114.350301] composite_suspend
When reconnecting USB cable OR Windows PC wakes up:
[ 139.129521] dwc3 48890000.usb: dwc3_gadget_interrupt Event type 1
[ 139.135655] composite_disconnect
[ 139.138901] reset_config
[ 139.184285] dwc3 48890000.usb: dwc3_gadget_interrupt Event type 2
[ 139.190420] dwc3 48890000.usb: dwc3_gadget_interrupt Event type 3
[ 139.196545] dwc3 48890000.usb: dwc3_gadget_linksts_change_interrupt STATE 0
[ 139.217368] dwc3 48890000.usb: dwc3_gadget_interrupt Event type 1
[ 139.223496] composite_disconnect
[ 139.272135] dwc3 48890000.usb: dwc3_gadget_interrupt Event type 2
[ 139.321027] set_config 2
[ 139.323580] g_ether gadget: full-speed config #2: RNDIS
[ 139.331160] set_config 2
[ 139.333709] reset_config
[ 139.336589] g_ether gadget: full-speed config #2: RNDIS
[ 144.356436] dwc3 48890000.usb: dwc3_gadget_interrupt Event type 3
[ 144.362571] dwc3 48890000.usb: dwc3_gadget_linksts_change_interrupt STATE 5
[ 144.369599] dwc3 48890000.usb: dwc3_gadget_interrupt Event type 3
[ 144.375725] dwc3 48890000.usb: dwc3_gadget_linksts_change_interrupt STATE 3
[ 144.382719] composite_suspend