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.

MUSB issue on AM3517EVM with AM35x-OMAP35x-PSP-SDK-03.00.01.06

There is a MUSB issue on AM3517EVM with AM35x-OMAP35x-PSP-SDK-03.00.01.06.

After power the 3517EVM, then insert a USB device without power (mouse, mass storage or powerless hub), linux can enumrate USB device correctly. then remove the device, system can recgonize device unplug.  But if insert the device again, system will not enumerate the device any more.

At this time, if insert a USB HUB with power supply, system can recgonize the hub and devices on the hub again.

Please find trace as attached, several comments shows the activity of USB insert or unplug, marked with #######################.

Can anyone check this issue?thanks.

  • Jennifer,

    Can you confirm that when a self powered hub is connected to 3517 usb port, whether the customer is able to connect and disconnect devices from the hub ports (and 3517 is able to work with the devices)?

    Can you also try with the latest release of the OMAP kernel?

    regards

    swami

  • Hi Swami,

    Thanks for your help.

    If a self powered hub is connected to 3517 usb port, the customer always can connect and disconnect devices from the hub ports. The issue still existed in the latest release of the OMAP kernel.

    kind Regards,

    Jennifer Zou

  • Jennifer,

    MUSB driver switches off the Vbus session when a device is disconnected from it'r root port. We need to start the session using command below after device is connected so that enumeration can proceed.

    $ echo F > /proc/driver/musb_hdrc OR

    $ echo 1 > /sys/devices/platform/musb_hdrc/srp

    Regards,

    Ajay

  • Hi Ajay,

    thanks for your reply.

    I have a further question, can you please indicate how user space detect device connected and then modify state of the variable to enumerate devices?

    thank you.

  • I think you can refer sysfs entries created for all the connected devices at /sys/bus/usb/devices to determine the connect status of any device.

    Regards,
    ajay

  • Hi Ajay,

    Sorry I have little knowledge with SYSFS, so I need your help to elaborate how to check the new file in /sys/bus/usb/devices/ when MUSB have a hotplug, thank you.

    I don’t know following ideas are working or not:

    1. The user space process polling the file created in folder /sys/bus/usb/devices and when MUSB related device file creation detected, use command “echo F > /proc/driver/musb_hdrc”.

    2. Use a process to handle hotplug event, when a hotplug event passed by kernel, this process to check the file created in folder /sys/bus/usb/devices and when MUSB related device file creation detected, use command “echo F > /proc/driver/musb_hdrc”.

     If other options available, please tell me. Thanks.

     

  • Jeniffer,

    Sysfs entries would get created only when device is enumerated which happens once the session is switched on using "echo F" or "echo 1 > ../../srp".

    I think the possible options could be,

     

    1) The user space process starts the session periodically say every 1 second or 100ms. We can stop this process when a device gets detected and restart again whenever a

    device is disconnected. OR

    2) If the use case is only for HOST mode then build the kernel in host only mode instead of OTG mode (default). You can refer the UserGuide for this. This would ensure that

    the session is always on. OR

    3) Use the patch below which removes the session switch off logic in disconnect path,

    ----------------------------------

    diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
    index 98355d3..65c8e73 100644
    --- a/drivers/usb/musb/musb_core.c
    +++ b/drivers/usb/musb/musb_core.c
    @@ -798,9 +798,6 @@ static irqreturn_t musb_stage2_irq(struct musb *musb, u8 int_usb,
                    case OTG_STATE_A_SUSPEND:
                            usb_hcd_resume_root_hub(musb_to_hcd(musb));
                            musb_root_disconnect(musb);
    -                       if (musb->a_wait_bcon != 0 && is_otg_enabled(musb))
    -                               musb_platform_try_idle(musb, jiffies
    -                                       + msecs_to_jiffies(musb->a_wait_bcon));
                            break;
     #endif /* HOST */
     #ifdef CONFIG_USB_MUSB_OTG

    ----------------------------------

    Regards,

    Ajay

  • hi Ajay,

    Thanks a lot for your kind help. It's ok now.

    Kind Regards,

    Jennifer Zou