我们的机器使用WiFi和3G通信。两个设备通过HUB共享相同的USB连接。
给出一段时间,它似乎断开两个设备和固件是无法恢复他们。我们的目标是在不重启的情况下恢复这些接口。
比较一台工作良好的机器和一台不工作的机器,我们可以看到这些差异:
root@well-working:~# lsusb -t
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ci_hdrc/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 480M
|__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=ath9k_htc, 480M
|__ Port 2: Dev 4, If 0, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 2: Dev 4, If 1, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 2: Dev 4, If 2, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 2: Dev 4, If 3, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 2: Dev 4, If 4, Class=Communications, Driver=cdc_ether, 480M
|__ Port 2: Dev 4, If 5, Class=CDC Data, Driver=cdc_ether, 480M
root@well-working:~# ls -l /sys/bus/usb/devices/
lrwxrwxrwx 1 root root 0 Jan 1 1970 1-0:1.0 -> ../../../devices/soc0/80080000.ahb/80090000.usb/ci_hdrc.1/usb1/1-0:1.0
lrwxrwxrwx 1 root root 0 Jan 1 1970 1-1 -> ../../../devices/soc0/80080000.ahb/80090000.usb/ci_hdrc.1/usb1/1-1
lrwxrwxrwx 1 root root 0 Jan 1 1970 1-1.1 -> ../../../devices/soc0/80080000.ahb/80090000.usb/ci_hdrc.1/usb1/1-1/1-1.1
lrwxrwxrwx 1 root root 0 Jan 1 1970 1-1.1:1.0 -> ../../../devices/soc0/80080000.ahb/80090000.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0
lrwxrwxrwx 1 root root 0 Jan 1 1970 1-1.2 -> ../../../devices/soc0/80080000.ahb/80090000.usb/ci_hdrc.1/usb1/1-1/1-1.2
lrwxrwxrwx 1 root root 0 Jan 1 1970 1-1.2:1.0 -> ../../../devices/soc0/80080000.ahb/80090000.usb/ci_hdrc.1/usb1/1-1/1-1.2/1-1.2:1.0
lrwxrwxrwx 1 root root 0 Jan 1 1970 1-1.2:1.1 -> ../../../devices/soc0/80080000.ahb/80090000.usb/ci_hdrc.1/usb1/1-1/1-1.2/1-1.2:1.1
lrwxrwxrwx 1 root root 0 Jan 1 1970 1-1.2:1.2 -> ../../../devices/soc0/80080000.ahb/80090000.usb/ci_hdrc.1/usb1/1-1/1-1.2/1-1.2:1.2
lrwxrwxrwx 1 root root 0 Jan 1 1970 1-1.2:1.3 -> ../../../devices/soc0/80080000.ahb/80090000.usb/ci_hdrc.1/usb1/1-1/1-1.2/1-1.2:1.3
lrwxrwxrwx 1 root root 0 Jan 1 1970 1-1.2:1.4 -> ../../../devices/soc0/80080000.ahb/80090000.usb/ci_hdrc.1/usb1/1-1/1-1.2/1-1.2:1.4
lrwxrwxrwx 1 root root 0 Jan 1 1970 1-1.2:1.5 -> ../../../devices/soc0/80080000.ahb/80090000.usb/ci_hdrc.1/usb1/1-1/1-1.2/1-1.2:1.5
lrwxrwxrwx 1 root root 0 Jan 1 1970 1-1:1.0 -> ../../../devices/soc0/80080000.ahb/80090000.usb/ci_hdrc.1/usb1/1-1/1-1:1.0
lrwxrwxrwx 1 root root 0 Jan 1 1970 usb1 -> ../../../devices/soc0/80080000.ahb/80090000.usb/ci_hdrc.1/usb1
root@non-working:~# lsusb -t
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ci_hdrc/1p, 480M
root@non-working:~# ls -l /sys/bus/usb/devices/
lrwxrwxrwx 1 root root 0 Jan 1 1970 1-0:1.0 -> ../../../devices/soc0/80080000.ahb/80090000.usb/ci_hdrc.1/usb1/1-0:1.0
lrwxrwxrwx 1 root root 0 Jan 1 1970 usb1 -> ../../../devices/soc0/80080000.ahb/80090000.usb/ci_hdrc.1/usb1
字符串
当一台机器丢失它的WiFi和3G所有的USB设备相关dissapear。
我们已经尝试改变它的功率相关参数值,没有成功。
root@non-working:~# ls /sys/bus/usb/devices/usb1/power/
active_duration connected_duration runtime_active_time
autosuspend control runtime_status
autosuspend_delay_ms level runtime_suspended_time
型
以下是断开连接事件的示例:
[1795405.092245] usb 1-1: USB disconnect, device number 2
[1795405.113015] usb 1-1.1: USB disconnect, device number 3
[1795405.287948] option1 ttyUSB3: option_instat_callback: error -71
[1795405.893171] ath: phy0: Chip reset failed
[1795405.915900] ath: phy0: Unable to reset channel (2412 Mhz) reset status -22
[1795405.948908] ath: phy0: Unable to set channel
[1795406.054290] ath: phy0: Failed to wakeup in 500us
[1795406.134293] ath: phy0: DMA failed to stop in 10 ms AR_CR=0xa83aa0c7 AR_DIAG_SW=0xa83aa0c7 DMADBG_7=0xa83aa0c7
[1795406.262963] ath: phy0: Failed to wakeup in 500us
[1795407.423023] ath: phy0: DMA failed to stop in 10 ms AR_CR=0x803aa0c7 AR_DIAG_SW=0x803aa0c7 DMADBG_7=0x803aa0c7
[1795408.171040] usb 1-1.1: ath9k_htc: USB layer deinitialized
[1795408.341405] usb 1-1.2: USB disconnect, device number 4
[1795408.451976] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
[1795408.527829] option 1-1.2:1.0: device disconnected
[1795408.612111] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
[1795408.662332] option 1-1.2:1.1: device disconnected
[1795408.759173] option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
[1795408.809315] option 1-1.2:1.2: device disconnected
[1795408.913052] option1 ttyUSB3: GSM modem (1-port) converter now disconnected from ttyUSB3
[1795408.965253] option 1-1.2:1.3: device disconnected
[1795409.026255] cdc_ether 1-1.2:1.4 eth0: unregister 'cdc_ether' usb-ci_hdrc.1-1.2, CDC Ethernet Device
型
此时,我们恢复那些接口的唯一方法就是重新启动整个机器。。当操作系统再次启动并加载其模块时,再次检测接口:
[ 5.107845] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 5.114635] ehci-platform: EHCI generic platform driver
[ 5.123058] usbcore: registered new interface driver usb-storage
[ 5.131111] usbcore: registered new interface driver usbserial
[ 5.137924] usbcore: registered new interface driver option
[ 5.145798] usbserial: USB Serial support registered for GSM modem (1-port)
[ 5.202460] ci_hdrc ci_hdrc.1: EHCI Host Controller
[ 5.209070] ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 1
[ 5.224634] ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
[ 5.236611] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 5.243661] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 5.251115] usb usb1: Product: EHCI Host Controller
[ 5.256220] usb usb1: Manufacturer: Linux 3.17.2-fslc+g6725f55 ehci_hcd
[ 5.263414] usb usb1: SerialNumber: ci_hdrc.1
[ 5.288768] hub 1-0:1.0: USB hub found
[ 5.293575] hub 1-0:1.0: 1 port detected
[ 5.632202] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[ 5.785868] usb 1-1: New USB device found, idVendor=0424, idProduct=2422
[ 5.793740] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 5.826896] hub 1-1:1.0: USB hub found
[ 5.833666] hub 1-1:1.0: 2 ports detected
[ 6.136125] usb 1-1.1: new high-speed USB device number 3 using ci_hdrc
[ 6.257841] usb 1-1.1: New USB device found, idVendor=0cf3, idProduct=9271
[ 6.265532] usb 1-1.1: New USB device strings: Mfr=16, Product=32, SerialNumber=48
[ 6.274210] usb 1-1.1: Product: SKW17
[ 6.279177] usb 1-1.1: Manufacturer: SKYLAB
[ 6.284601] usb 1-1.1: SerialNumber: 12345
[ 6.426135] usb 1-1.2: new high-speed USB device number 4 using ci_hdrc
[ 6.528004] usb 1-1.2: New USB device found, idVendor=05c6, idProduct=9003
[ 6.535563] usb 1-1.2: New USB device strings: Mfr=4, Product=3, SerialNumber=5
[ 6.544201] usb 1-1.2: Product: UMTS/HSPA Module
[ 6.550141] usb 1-1.2: Manufacturer: Quectel, Incorporated
[ 6.580942] option 1-1.2:1.0: GSM modem (1-port) converter detected
[ 6.606089] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB0
[ 6.636850] option 1-1.2:1.1: GSM modem (1-port) converter detected
[ 6.661615] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB1
[ 6.689028] option 1-1.2:1.2: GSM modem (1-port) converter detected
[ 6.711116] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB2
[ 6.742213] option 1-1.2:1.3: GSM modem (1-port) converter detected
[ 6.765995] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB3
型
- 硬件相关观察详情:*
我们无法确定是什么原因导致这些断开。我们怀疑与硬件相关的问题。分析HUB的晶体时钟与振荡器,我们可以观察到一个异常的行为:
的数据
当固件无法检测和恢复接口时,HUB的水晶时钟似乎会循环。只有内核模块在 Boot 时重新加载似乎被重新初始化并正常工作。
1条答案
按热度按时间kuarbcqp1#
你有没有试过把“ci_hdrc.1”(或者任何代表你的USB接口的东西)写到“/sys/bus/platform/drivers/ci_hdrc/unbind”,然后写到“/sys/bus/platform/drivers/ci_hdrc/bind”?这应该会重置所有内容,并允许设备在不重新启动的情况下恢复正常。我们最终将其用于ESD可能导致USB设备停止工作的产品。这是不需要重新启动就能恢复的唯一方法。
很抱歉回复晚了。