Hi Tony,
On Fri, 4 Jun 2021 12:39:54 +0300
Tony Lindgren [off-list ref] 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
quoted hunk ↗ jump to hunk
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);