问题描述
我们的机器使用 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,Class=vendor Specific Class,Driver=ath9k_htc,480M
|__ Port 2: Dev 4,Driver=option,If 1,If 2,If 3,If 4,Class=Communications,Driver=cdc_ether,If 5,Class=CDC Data,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,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 设备都会消失。
我们已经尝试更改其与电源相关的参数值,但没有成功。
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 的晶体时钟似乎循环。 只有在启动时重新加载内核模块似乎才能重新初始化并正常工作。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)