BLUF
I can no longer toggle the power of an LTE Modem via sysfs because it is now being removed from sysfs after an error occurs. How can I get it back into the usb sysfs and toggle the power?
Background
I am using an USB LTE modem with the qmi-based drivers that infrequently experiences an error that requires a reset. In the past I have been able to fix it by toggling power to it via the sysfs as seen below:
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
Not ideal, but workable. The problem is that that after migrating to the 4.14 kernel, I cannot find the device in the sysfs after an error, /sys/bus/usb/devices/usb2/2-1
does not exist, and therefor I cannot reset the modem with it. The dmesg
output at the time of the error is the following:
[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
The error 71 corresponds to an EPROTO
error, which from what i read triggers the kernel to disable the port. I'd like to know how to re-enable to port so it appears back in the USB section of sysfs so I can toggle its power.