0

I am using Linux 4.19.55 armv7l on a omap3 processor. On my target there is a usb modem that gets power from a gpio pin value (defined under /sys/class/gpio). There are occasions when I change the value parameter of this gpio pin to bring down the hardware and while doing so I frequently get an error (thrown by musb_handle_intr_disconnect from inside drivers/usb/musb/musb_core.c ) as under:

"musb_handle_intr_disconnect 843: unhandled DISCONNECT transition (a_idle)"

I tried debugging the issue by mounting debugfs and capturing data from the concerned bus by using usbmon. Bus id is identified from lsusb output and confirmed by observing /sys/kernel/debug/usb/devices. I observe that usbmon is unable to capture data whenever the mentioned error shows up. In a no error scenario the usbmon does capture the traffic from the concerned bus. Please help how to debug this issue.

Mukul Mehra
  • 91
  • 1
  • 9
  • 1
    We are at v5.13-rc1 right now. v5.10 is LTS, have you able to reproduce on either? – 0andriy May 10 '21 at 12:14
  • Yes, the issue is reproducible on latest kernel as well. It took me sometime to upgrade the version of drivers. I find the issue exists with latest kernel as well. – Mukul Mehra May 26 '21 at 21:17
  • Hmm... shouldn’t the driver of the modem take care about bus quiescence before toggling the GPIO? If there is no kernel side driver, I am afraid that nothing you can do about it. I would suggest to drop an email to linux-usb@ mailing list. – 0andriy May 26 '21 at 22:18
  • The kernel side usb driver is the one that de-registers the device on any of the buses under hub. The handling of the state machine of the usb driver is still evolving with every new kernel. One of the commits helped me fix the issue. – Mukul Mehra May 30 '21 at 20:07

1 Answers1

0

Just checked that a commit on kernel branch fixes this issue which is present inside the states handled by the glue layer. This is the required commit

0andriy
  • 4,183
  • 1
  • 24
  • 37
Mukul Mehra
  • 91
  • 1
  • 9
  • The mentioned commit is in kernel from v5.6-rc1. How comes you put in the above comment that _the issue is reproducible on latest kernel as well_ I don't understand this. – 0andriy May 31 '21 at 08:11
  • 0andriy it happened since I used v5.13 as mentioned in your first comment. Also, the solution is not so easy to be accomodated on older kernels. I patched 4.19 first with 5.13 and when it did not work as expected I went looking for specific commits made on usb issues accross mutliple kernel versions. Hence, reached the solution. – Mukul Mehra Jun 02 '21 at 07:55