Linux OTG端口搞砸了我的其他主机端口 [英] Linux OTG port screwing up my other host port

查看:269
本文介绍了Linux OTG端口搞砸了我的其他主机端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行Linux 3.0.35内核并带有两个USB端口的Variscite VAR-SOM-MX6.第一个端口是连接到外部mini-OTG插孔的OTG端口.第二个是内部主机端口,它连接到集线器芯片,然后再连接到其他一些设备. 如果我将OTG电缆插入第一个端口,告诉它是主机,则一切正常.如果我插入了常规电缆,或者根本没有电缆,那么第二个主机端口将无法正确枚举.电缆的另一端不必有任何东西,因此,这仅是与OTG尝试作为主机或设备有关的错误. 例如,如果我插入OTG电缆并重新启动,则内核日志中包含以下几行.

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

如果我然后从端口1拔出OTG电缆,它将断开端口2上的所有连接:

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

我怀疑某些代码正在使用物理端口号1和2,而不管端口是主机还是设备,而其他代码只是查看实际的主机端口,并在内部混淆端口号.以前有没有人见过这个错误?谷歌搜索没有发现任何问题.还是在更专业的论坛上我应该发布这个问题?

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?

推荐答案

万一有人感兴趣,这可能是硬件设计问题.两个USB PHY均由内部稳压器供电,该稳压器由主机VBUS或OTG VBUS(以较高者为准)由+ 5V供电.设计人员认为这些是电压感测输入,因此通过一个10K电阻将5V的主机VBUS驱动.因此,当未连接OTG端口时,便便排空了.将10K更改为0欧姆即可解决此问题.

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.

这篇关于Linux OTG端口搞砸了我的其他主机端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆