This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3358: USB restart

Part Number: AM3358

How do you restart the USB controller and driver in Linux?

I'm sometimes getting into a hung condition and I'd like to power cycle the device (via DRVVBUS) as well as reset the controller and reload the driver. Is that possible? What are the Linux command-line steps?

  • Please post the Linux version you use.

  • Hi Jason,

    I assume you use the latest kernel. The following commands will unload and reload the musb drivers, please give it a try. I am not sure it will solve your issue, since the musb driver doesn't reset the usb controller during init.

    # modprobe -r musb_dsps
    # modprobe musb_dsps

  • Bin Liu said:

    Hi Jason,

    I assume you use the latest kernel. The following commands will unload and reload the musb drivers, please give it a try. I am not sure it will solve your issue, since the musb driver doesn't reset the usb controller during init.

    # modprobe -r musb_dsps
    # modprobe musb_dsps

    Thanks. This is exactly what I wanted and I will report back once I have a chance to test it with the appropriate electro-magnetic interference that was causing the issue from which I'm trying to recover.

    Is there a possibility of patching the musb_dsps kernel module to give the controller a reset? I'd be happy to make a patch based on modprobe parameters if the mechanism for issuing a reset was described.

  • Jason,

    It is kind of challenging to add module reset in the Linux MUSB drivers. The AM335x USB module has

    - 1x USBSS, which has reset for the whole module,
    - 2x MUSB controller,
    - 2x USB2 PHY,
    - 1x CPPI DMA,

    and each has its corresponding kernel driver.

    The kernel driver for USBSS is a dummy, it doesn't do anything useful other than populating the rest of the child DT nodes. Most importantly this driver cannot be unloaded after it is loaded. So it is not feasible to add module reset in this driver for recovery.

    The MUSB controller will be called twice for the init/probe() because there are two MUSB controllers, but the module reset should be called only once, so the locking mechanism would be ugly in the driver. Most importantly the controller shouldn't access USBSS registers which provide the module reset.