Linux OTG port screwing up my other host port

落花浮王杯 提交于 2019-12-11 04:33:42

问题


I've got a Variscite VAR-SOM-MX6 running a Linux 3.0.35 kernel, with two USB ports. The first port is an OTG port connected to an external mini-OTG jack. The second is an internal host port going to a hub chip, and then to some other devices. If I've got an OTG cable plugged into the first port, telling it to be a host, then everything works fine. If I have a regular cable, or no cable at all, plugged in, then the second host port doesn't enumerate properly. There doesn't have to be anything at the other end of the cable, so this is a bug related only to whether the OTG is trying to be a host or a device. For instance, if I plug in an OTG cable and reboot, the kernel log contains the following lines.

usb 2-1: new high speed USB device number 2 using fsl-ehci
usb 2-1: New USB device found, idVendor=0424, idProduct=2534
usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
hub 2-1:1.0: USB hub found
hub 2-1:1.0: 4 ports detected
usb 2-1.1: new high speed USB device number 3 using fsl-ehci
usb 2-1.1: New USB device found, idVendor=0424, idProduct=9e00
usb 2-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
usb 2-1.2: new high speed USB device number 4 using fsl-ehci
usb 2-1.2: New USB device found, idVendor=0403, idProduct=6011
usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 2-1.2: Product: Quad RS232-HS
usb 2-1.2: Manufacturer: FTDI

If I then yank the OTG cable from port 1, it disconnects everything on port 2:

usb 2-1: USB disconnect, device number 2
usb 2-1.1: USB disconnect, device number 3
usb 2-1.2: USB disconnect, device number 4

and then tries to re-enumerate everything, but fails miserably:

usb 2-1: new high speed USB device number 5 using fsl-ehci
usb 2-1: new high speed USB device number 6 using fsl-ehci
usb 2-1: new high speed USB device number 7 using fsl-ehci
usb 2-1: device not accepting address 7, error -71
usb 2-1: new high speed USB device number 8 using fsl-ehci
usb 2-1: device not accepting address 8, error -71
hub 2-0:1.0: unable to enumerate USB device on port 1

I suspect that some code is using physical port numbers 1 and 2, irrespective of whether a port is a host or a device, while other code is only looking at actual host ports, and getting the port numbers confused internally. Has anyone seen this bug before? Googling didn't turn anything up. Or is there a more specialized forum where I should post this question?


回答1:


In case anyone is interested, this turned out to be a hardware design issue. Both USB PHYs are powered off an internal regulator that is powered by +5V from either the host VBUS or the OTG VBUS, whichever is higher. The designer thought these were voltage sensing inputs, and drove the host VBUS with 5V through a 10K resistor. So it ran out of poop when the OTG port wasn't connected. Changing 10K to 0 ohms fixed it.



来源:https://stackoverflow.com/questions/38319062/linux-otg-port-screwing-up-my-other-host-port

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!