i.MX8MM USB autosuspend broken with power domain support

Lucas Stach l.stach at pengutronix.de
Wed Apr 13 08:02:59 PDT 2022


Am Mittwoch, dem 13.04.2022 um 11:40 -0300 schrieb Fabio Estevam:
> [Adding Jun Li]
> 
> On Wed, Apr 13, 2022 at 11:35 AM Frieder Schrempf
> <frieder.schrempf at kontron.de> wrote:
> > 
> > Hi,
> > 
> > when power domain support was added for i.MX8MM, it seems like this
> > broke the USB autosuspend feature.
> > 
> > I reported this previously when testing the gpcv2 patches before they
> > were merged [1] and the issue can also be reproduced on v5.18-rc2.
> > 
> > Did anyone else encounter such a problem? Can anyone help with debugging
> > or proposing a fix?
> > 
> > Do the USB power domains need to stay enabled for autosuspend to work?
> > If yes how can this be achieved?
> > 
> > Below is some more information on how to reproduce the issue including
> > some debug output.
> > 
> > Thanks a lot and best regards
> > Frieder
> > 
> > 1. Plug in USB device on host port, device is not enumerated, no debug
> > output
> > 
> > 2. Disable autosuspend, device gets enumerated
> > 
> > ~# echo on > /sys/bus/usb/devices/usb1/power/control
> > [ 2986.582786] imx_usb 32e40000.usb: genpd_runtime_resume()
> > [ 2986.588155] imx-pgc imx-pgc-domain.2: genpd_runtime_resume()
> > [ 2986.593876] imx-pgc imx-pgc-domain.2: resume latency exceeded, 1125 ns
> > [ 2986.600446] PM: usb-otg1: Power-on latency exceeded, new value
> > 12295000 ns
> > [ 2986.607342] imx_usb 32e40000.usb: at imx_controller_resume
> > [ 2986.612850] ci_hdrc ci_hdrc.0: genpd_runtime_resume()
> > [ 2986.617919] ci_hdrc ci_hdrc.0: at ci_controller_resume
> > [ 2986.858565] usb 1-1: new full-speed USB device number 10 using ci_hdrc
> > 
> > [1] https://lkml.org/lkml/2021/5/19/883

Now that I think about it again, it seems putting the USB controllers
into the OTG1/2 power domains is wrong. I guess the controllers are
actually located in the HSIOMIX domain, which probably needs to stay
enabled even if there is no device connected, so that the wakeup logic
works properly. It's the USB PHYs that should be placed in the OTG
domains and which I expect can be powered down as long as no device is
connected.

The i.MX8MM support currently handles the PHYs via usb-nop-xceiv, which
AFAICS doesn't properly handle runtime PM. :/

Regards,
Lucas




More information about the linux-arm-kernel mailing list