赞
踩
在工作中有发现一个比较神奇的事情。一般情况下,大家都知道U盘对应的节点是固定的,但恰恰这个节点居然变化了。导致应用在读/写文件的时候有概率会突然断开。
<6>[ 37.469082] cfg80211: Exceeded CRDA call max attempts. Not calling CRDA <13>[ 51.900401] init: Service 'bootdvfs' (pid 2562) exited with status 0 <3>[ 60.570056] usb usb5-port1: disabled by hub (EMI?), re-enabling... <6>[ 60.576414] rtk-ehci 98013000.ehci: port_event call RTK_usb2_phy_toggle <6>[ 60.576483] rtk-usb-phy-rle0599 98013824.usb_phy_rle0599: rtk_rle0599_phy_toggle ########## to toggle Page1 addr 0xe0 BIT(2) <3>[ 60.577503] usb usb5-port1: port 1, status 0501, change 0002, 480 Mb/s <6>[ 60.584400] usb 5-1: USB disconnect, device number 6 <3>[ 60.909092] usb 5-1: new high-speed USB device number 7 using rtk-ehci (platform) <3>[ 60.945344] usb 5-1: device descriptor read/8, error -71 <7>[ 60.950818] hub_port_init 4966 clear-set port power <3>[ 61.759161] usb 5-1: device not accepting address 7, error -22 <3>[ 61.766127] hub 5-0:1.0: hub port disable on port 1 <3>[ 61.829373] hub 5-0:1.0: hub port disable on port 1 <3>[ 61.834460] hub 5-0:1.0: hub port disable on port 1 <6>[ 61.859160] rtk-ehci 98013000.ehci: port_event call RTK_usb2_phy_toggle <6>[ 61.859221] rtk-usb-phy-rle0599 98013824.usb_phy_rle0599: rtk_rle0599_phy_toggle ########## to toggle Page1 addr 0xe0 BIT(2) <3>[ 61.860234] usb usb5-port1: port 1, status 0100, change 0001, 12 Mb/s <6>[ 62.059124] rtk-ohci 98013400.ohci: port_event call RTK_usb2_phy_toggle <6>[ 62.059187] rtk-usb-phy-rle0599 98013824.usb_phy_rle0599: rtk_rle0599_phy_toggle ########## to toggle Page1 addr 0xe0 BIT(2) <3>[ 62.060200] usb usb6-port1: port 1, status 0101, change 0000, 12 Mb/s logcat |grep "hub (EMI?)" <3>[ 62.239081] usb 6-1: new full-speed USB device number 2 using rtk-ohci (platform) <6>[ 62.275114] usb 6-1: not running at top speed; connect to a high speed hub <6>[ 62.295234] scsi host7: usb-storage 6-1:1.0 <5>[ 63.296209] scsi 7:0:0:0: Direct-Access Kingston DataTraveler 2.0 PMAP PQ: 0 ANSI: 6 <5>[ 63.306156] sd 7:0:0:0: [sdc] 15249408 512-byte logical blocks: (7.80 GB/7.27 GiB) <5>[ 63.312158] sd 7:0:0:0: [sdc] Write Protect is off <7>[ 63.312171] sd 7:0:0:0: [sdc] Mode Sense: 45 00 00 00 <5>[ 63.318145] sd 7:0:0:0: [sdc] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA <6>[ 63.363165] sdc: <6>[ 63.363208] rescan_partitions: rescan device sdc partitions finish.
从上面可以看出节点由 usb 5-1 --> usb 6-1
(详细的可以见 ls -l /sys/dev/block )
/devices/platform/98013000.ehci/usb5/5-1 ---> /devices/platform/98013000.ehci/usb6/6-1
从日志中分析 : usb usb5-port1: disabled by hub (EMI?), re-enabling…
从USB驱动代码中看:
/*
* EM interference sometimes causes badly shielded USB devices
* to be shutdown by the hub, this hack enables them again.
* Works at least with mouse driver.
*/
if (!(portstatus & USB_PORT_STAT_ENABLE)
&& !connect_change && udev) {
dev_err(&port_dev->dev, "disabled by hub (EMI?), re-enabling...\n");
connect_change = 1;
}
根据提示是EM干扰,那么就是从外部因素开始排查,起初判断是个别U盘的问题,在尝试不同的U盘后,发现有些会出现,有些不会出现。但后续在替换HUB外接线后,任何一个U盘都不会出现。所以判定是HUB外接线的问题(运气比较好)。如果不是以上两个问题点的话,那么就是CPU的问题了,根据电路图知道HUB口是由CPU直接控制的。
此文仅记录本人的工作记录(小白一枚),不喜勿喷,欢迎大家一起学习交流进步,谢谢。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。