Colibri imx6ull: No USB hotplug with mainline kernels

Hi,

To summarize, I want to use a mainline kernel on the colibri imx6ull.
I have all the basics functions working, but the USB host hotplug does not work,
due to the fact that the roothub suspends itself when no device is plugged, and
does not wakeup when one is inserted again.
The hotplug works when disabling CONFIG_PM.

That works like a charm with Toradex kernel, and I am in the process of bisecting
to find out what is missing to mainline.

I have also posted this issue at NXP’s (imx6ull: usb hotplug not working on mainline kerne... - NXP Community) with no answer yet.

The additional information that I can bring is that I have tested with 5.4.y, 5.14.y and master,
with no better success.

And clues ?
Best regards

Hello tbultel,

Which carrier board are you using?
We did some tests with Colibri imx6ull 1.0A 1.1A with aster carrier board 1.1b and as well as the mainline kernel on BSP 5.5 and we were able to access files from a USB stick (no other device connected) hot-plugging it.
Which USB port have you been using and on which carrier board.

Best Regards,
Matthias

Hi :slight_smile: My carrier board is the Iris 2.0
I am using the host USB (USB-A) port.

Would you mind sharing both

  • the kernel config file
  • the dts(i) file you have been using for your tests

… and tell me what mainline kernel version you had.

Thanks !
Thierry

Dear @tbultel, hope you’re doing good.

The tests that Matthias referred to here were made using either:

  • Toradex Multimedia Reference Image Upstream
    or
  • Toradex Minimal Reference Image Upstream.

They both use the mainline kernel and you can download them here: https://developer-archives.toradex.com/knowledge-base/toradex-easy-installer-os-and-demo-images. The mainline kernel version is based on 5.4 as you can see here: Toradex System/Computer on Modules - Linux BSP Release

The Device Trees were all the default device trees for Colibri iMX6ULL that we usually ship with our images. You can see here a list of device trees per device: High performance, low power Embedded Computing Systems | Toradex Developer Center. You can also have a look on our Github: GitHub - toradex/device-trees: Device tree, device tree overlays and related header files. Used by TorizonCore Builder. It lists device trees for our multiple modules and carrier boards.

Hope this helps you.

Best regards,
Guilherme

Dear Guilherme,
Many thanks for the links.
Has I said, I am pretty sure that the issue I have does not come from the DTS (since it works with
Toradex’s kernel)

But as a coincidence, I can see at the top of the feature request list: Toradex System/Computer on Modules - Linux BSP Release

… that definitively sounds like the issue we are talking about.

Where are these patches please ?
Thanks !
Thierry

I finally found out.
On toradex kernel, there is this patch:

git log --pretty=oneline | grep usb | grep runtime | grep imx
5c557731e747e96db9174eccb5d3d3afde83c332 usb: chipidea: imx: disable runtime pm for imx6ull
e14db48dfcf3ab6ebea212e82dc56036a00b0d6b usb: chipidea: imx: add runtime power management support

$ git show 5c557731e747e96db9174eccb5d3d3afde83c332
commit 5c557731e747e96db9174eccb5d3d3afde83c332
Author: Philippe Schenker <philippe.schenker@toradex.com>
Date:   Fri Jun 26 13:28:07 2020 +0200

    usb: chipidea: imx: disable runtime pm for imx6ull
    
    Runtime power management causes different problems around iMX6ULL usb. Disable
    it.
    
    Related-to: TEI-558
    Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>

diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index df8812c30640..b0444e839cc2 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -56,8 +56,7 @@ static const struct ci_hdrc_imx_platform_flag imx6sx_usb_data = {
 };
 
 static const struct ci_hdrc_imx_platform_flag imx6ul_usb_data = {
-       .flags = CI_HDRC_SUPPORTS_RUNTIME_PM |
-               CI_HDRC_TURN_VBUS_EARLY_ON,
+       .flags = CI_HDRC_TURN_VBUS_EARLY_ON,
 };
 
 static const struct ci_hdrc_imx_platform_flag imx7d_usb_data = {

An indeed, this a workaround that works.
However, if you do not mind, I would like to not mark this thread as closed, for the following reasons:

  • There no mention of this in the documentation
  • The patch seems specific to Toradex hardware, unless I am missing something, but I guess
    that there would have been more people complaining about that if it was not the case.
  • My customer chose the imx6ull due to its very low power needs. And we are chasing microamps,
    so it is quite a shame that both USB controllers keep on, even when there is nothing plugged (which is true most of the time on the application we are developing).

So : Is there a chance that it is fixed differently ? I mean, on an updated hardware design at a time,
or with a smarter patch ?

Best regards

Dear @tbultel, how are you?

Do you mean that there is no proper mention of this specific patch or no mention of the problem at all?


Did you have the opportunity to check, for instance, the NXP Downstream Kernels to see if any patches like these are applied? At the moment, we also don’t have many customers that reported this issue but I’ll check it in better detail.


We don’t think that keeping the USB interface on would increase much to the power consumption especially since it will not be used most of the time. This should not be a significant problem on a first glance.


If an issue is present on our issue tracker and is not marked as a fixed or a new feature in one of the releases, we plan to work on it and even find other solutions. However, I can’t provide you with any timeframe for that at the moment.

Best regards,
Guilherme