Hello,
I am using IMX6 quad with linux-fslc-imx kernel 5.4.
For some USB device such as "ASIX AX88179 USB 3.0 Gigibit Ethernet" USB ethernet adapter the bit CSC of USB_nPORTSC1 doesn't change so there is no transition to connection status according to the following code from port_event function in hub.c (The device is powered but with no connection status)
if (portchange & USB_PORT_STAT_C_CONNECTION) {
usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_C_CONNECTION);
connect_change = 1;
dev_dbg(&port_dev->dev, "connection changed\n");
}
Below is the debug traces:
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
usb usb2: usb wakeup-resume
hub 2-0:1.0: hub_resume
hub 2-0:1.0: state 7 ports 1 chg 0002 evt 0000
usb usb2-port1: over-current change #1
hub 2-0:1.0: enabling power on all ports
usb usb2-port1: status 0100, change 0008, 12 Mb/s
hub 2-0:1.0: hub_suspend
root# devmem2 0x2184184
/dev/mem opened.
Memory mapped at address 0x76ffa000.
Read at address 0x02184184 (0x76ffa184): 0x18001205
I am using USB OTG:
The above problem occurs if I set the USB role to host mode before attaching the device to the port.
If I attached the device before changing to the host mode, there is no problem, the device works fine, below is the debug traces:
usb usb2: udev 1, busnum 2, minor = 128
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
hub 2-0:1.0: standalone hub
hub 2-0:1.0: individual port power switching
hub 2-0:1.0: individual port over-current protection
hub 2-0:1.0: Single TT
hub 2-0:1.0: TT requires at most 8 FS bit times (666 ns)
hub 2-0:1.0: power on to power good time: 20ms
hub 2-0:1.0: local power source is good
hub 2-0:1.0: enabling power on all ports
hub 2-0:1.0: state 7 ports 1 chg 0002 evt 0000
usb usb2-port1: connection changed
usb usb2-port1: status 0101, change 0001, 12 Mb/s
usb usb2-port1: debounce total 100ms stable 100ms status 0x101
usb 2-1: new high-speed USB device number 2 using ci_hdrc
usb 2-1: udev 2, busnum 2, minor = 129
hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002
ax88179_178a 2-1:1.0 eth1: register 'ax88179_178a' at usb-ci_hdrc.0-1, ASIX AX88179 USB 3.0 Gigabit Ethernet, 74:da:38:d9:1f:72
usbcore: registered new interface driver ax88179_178a
Could you please help why the device doesn't get connected status if the host role is already enabled?
Best regards,
Mohamed Ali
Hello,
Could you share how are you changing the role of the USB for your test?
Also, please note that If you're using USB OTG then the system would change automatically using the USB_ID or USB_OTG_ID logic state, there is no need to manually change the role.
Best regards,
Aldo.
Hello,
I can reproduce this issue either by
1) Updating the sysfs role attribute to host
or
2) By changing the USB_OTG_ID level (USB_OTG_ID in our design is connected to a gpio so we are controlling it manually: this is a requirement from our customer).
I think even if the sysfs role attribute is changed manually it should work, isn't it?
Best Regards,
Mohamed Ali