BLUF
我无法再通过sysfs切换LTE调制解调器的功能,因为现在在发生错误后将其从sysfs中删除。我如何才能将其恢复到USB sysfs并切换电源?
背景
我将USB LTE调制解调器与基于qmi的驱动程序配合使用,但很少会遇到需要重置的错误。过去,我可以通过sysfs切换电源来修复它,如下所示:
echo "0" > /sys/bus/usb/devices/usb2/2-1/power/autosuspend_delay_ms
echo "auto" > /sys/bus/usb/devices/usb2/2-1/power/control
sleep 1
echo "0" > /sys/bus/usb/devices/usb2/2-1/power/autosuspend
sleep 1
echo "2-1" > /sys/bus/usb/drivers/usb/unbind
sleep 1
echo "2-1" > /sys/bus/usb/drivers/usb/bind
sleep 1
不理想,但可行。问题在于,移植到4.14内核后,出现错误后我无法在sysfs中找到该设备,/sys/bus/usb/devices/usb2/2-1
不存在,因此无法使用它重置调制解调器。错误发生时的dmesg
输出如下:
[1889271.903016] qmi_wwan 2-1:1.8: nonzero urb status received: -71
[1889271.903039] qmi_wwan 2-1:1.8: wdm_int_callback - 0 bytes
[1889274.174239] usb 2-1: USB disconnect, device number 2
[1889274.185873] qcserial ttyUSB0: Qualcomm USB modem converter now disconnected from ttyUSB0
[1889274.186457] qcserial 2-1:1.0: device disconnected
[1889274.188294] qcserial ttyUSB1: Qualcomm USB modem converter now disconnected from ttyUSB1
[1889274.188916] qcserial 2-1:1.2: device disconnected
[1889274.206507] qcserial ttyUSB2: Qualcomm USB modem converter now disconnected from ttyUSB2
[1889274.211120] qcserial 2-1:1.3: device disconnected
[1889274.220564] qmi_wwan 2-1:1.8 wwan0: unregister 'qmi_wwan' usb-ci_hdrc.1-1, WWAN/QMI device
[1889274.263106] qmi_wwan 2-1:1.10 wwan1: unregister 'qmi_wwan' usb-ci_hdrc.1-1, WWAN/QMI device
错误71对应一个EPROTO
错误,从我读到的错误触发内核禁用该端口。我想知道如何重新启用端口,使其重新出现在sysfs的USB部分中,以便我切换其电源。