Tool/software: Linux
Hi!
I have experienced annoying problem with a am3352 based Linux (4.4.41) board working behind modem connection. Modem firmware seems crashing frequently when connection field or bandwidth is low. Usually modem firmware crash triggers udev to reload usb drivers that re-builds the connection, but not always. Therefore, I do have a connection monitor observing connection periodically (10 minute period). If remote connection is missing, monitor sequences USB power using /sys/kernel/debug/musb-hdrc.YY.auto/softconnect interface. Usually this triggers udev and recovers modem connection, but not always. Therefore, monitor boots the card if connection has been lost for two hours. However, booting disturbs the the operation - all the processing starts from scratch. Most likely this randomly crashing modem crashes random modules. So, something close to kernel gets broken when power sequencing does not help anymore. This is shown from the logs that "new high-speed USB device number XX using musb-hdrc" does not appear anymore after power sequencing. Most likely some usb driver has been frozen - but it's impossible to pinpoint the guilty one? Therefore, whole usb interface should be re-started.
I have studied re-starting usb interface. I tried removing all the usb drivers and reloading them with following sequence:
a) Switch off usb power ( some usb drivers can't be removed otherwise)
b) Remove usb drivers (modprobe -r ...)
c) Reload usb drivers
d) Switch usb power on
The problem with d) is that removing usb driver removes also /sys/kernel/debug/musb-hdrc.YY.auto/softconnect that is not recovered in c).
So, my question are:
1) Is there any simple method reloading usb interface without rebooting card?
2) If not, how can I reload this /sys/kernel/debug/.... interface so that I could follow the sequence above?
Thanks,
Matti