[Letux-kernel] [PATCH] usb: musb: Check devctl status again for a spurious session request
Andreas Kemnade
andreas at kemnade.info
Fri Jun 4 16:45:01 CEST 2021
Hi Tony,
On Fri, 4 Jun 2021 12:39:54 +0300
Tony Lindgren <tony at atomide.com> wrote:
[...]
> Does the following patch fix things for you or does something else break again? :)
>
It fixes things mostly. If I quickly enter suspend after usb
disconnect, current is still high in suspend (limit approx 2-3 seconds).
But I think this is the right track and these two patches are clearly an
improvement if applied together.
Regards,
Andreas
> Regards,
>
> Tony
>
> 8< --------------
> diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
> --- a/drivers/usb/musb/omap2430.c
> +++ b/drivers/usb/musb/omap2430.c
> @@ -332,6 +332,7 @@ static int omap2430_probe(struct platform_device *pdev)
> glue->musb = musb;
> glue->status = MUSB_UNKNOWN;
> glue->control_otghs = ERR_PTR(-ENODEV);
> + glue->is_runtime_suspended = 1;
>
> pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
> if (!pdata)
> @@ -453,6 +454,9 @@ static int omap2430_runtime_suspend(struct device *dev)
> if (!musb)
> return 0;
>
> + if (glue->is_runtime_suspended)
> + return 0;
> +
> musb->context.otg_interfsel = musb_readl(musb->mregs,
> OTG_INTERFSEL);
>
> @@ -474,6 +478,9 @@ static int omap2430_runtime_resume(struct device *dev)
> if (!musb)
> return 0;
>
> + if (!glue->is_runtime_suspended)
> + return 0;
> +
> phy_init(musb->phy);
> phy_power_on(musb->phy);
>
More information about the Letux-kernel
mailing list