i.MX8MM USB autosuspend broken with power domain support

Jun Li jun.li at nxp.com
Wed Apr 13 08:58:47 PDT 2022



> -----Original Message-----
> From: Lucas Stach <l.stach at pengutronix.de>
> Sent: Wednesday, April 13, 2022 11:03 PM
> To: Fabio Estevam <festevam at gmail.com>; Frieder Schrempf
> <frieder.schrempf at kontron.de>; Jun Li <jun.li at nxp.com>
> Cc: Peter Chen <peter.chen at kernel.org>; Peng Fan <peng.fan at nxp.com>;
> linux-arm-kernel at lists.infradead.org; dl-linux-imx <linux-imx at nxp.com>;
> marek.vasut at gmail.com; tharvey at gateworks.com; Adam Ford
> <aford173 at gmail.com>; Breno Matheus Lima <breno.lima at nxp.com>
> Subject: Re: i.MX8MM USB autosuspend broken with power domain support
> 
> 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://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flkml.
> org%2Flkml%2F2021%2F5%2F19%2F883&data=04%7C01%7Cjun.li%40nxp.com%7C
> 95df1db516454246d2ef08da1d5eb444%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0
> %7C0%7C637854589844488598%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiL
> CJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Zz447nGg
> 9Rr%2Bvn96v4KJelygmuqFWaScqPIFDWMBdWg%3D&reserved=0
> 
> 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.

Per my current understanding, USB remote wakeup(wakeup host via
USB data line) need PHY power on, but controller can be off, I will
Check internally how those power domains map to each physical part
in SoC, and reproduce the issue Frieder is reporting.

Li Jun
> 
> 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