Re: [PATCH] phy: renesas: rcar-gen3-usb2: fix imbalance powered flag

From: Geert Uytterhoeven
Date: Wed Jun 05 2019 - 09:12:26 EST


Hi Shimoda-san,

On Wed, Jun 5, 2019 at 2:12 PM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@xxxxxxxxxxx> wrote:
> > From: Geert Uytterhoeven, Sent: Wednesday, June 5, 2019 6:25 PM
> <snip>
> > Thank you, this seems to fix the warning, so
> > Tested-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
>
> Thank you for the testing!
>
> > However, the other imbalance (phy-ee080200.usb-phy.6 enabling its
> > regulator during each system resume phase, but never touching it
> > otherwise) is still present.
>
> Umm, since I'd like to investigate this,
> would you share your debug print patch?

Attached.

Thanks!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
diff --git a/drivers/phy/renesas/phy-rcar-gen3-usb2.c b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
index dd2d7290cfade28d..1d7d28cf0a7730e2 100644
--- a/drivers/phy/renesas/phy-rcar-gen3-usb2.c
+++ b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
@@ -443,10 +443,13 @@ static int rcar_gen3_phy_usb2_power_on(struct phy *p)
goto out;

if (channel->vbus) {
+dev_info(&p->dev, "%s: Enabling regulator\n", __func__);
ret = regulator_enable(channel->vbus);
+dev_info(&p->dev, "%s: regulator_enable() returned %d\n", __func__, ret);
if (ret)
goto out;
}
+else dev_info(&p->dev, "%s: Not enabling regulator\n", __func__);

val = readl(usb2_base + USB2_USBCTR);
val |= USB2_USBCTR_PLL_RST;
@@ -473,7 +476,12 @@ static int rcar_gen3_phy_usb2_power_off(struct phy *p)
return 0;

if (channel->vbus)
+{
+dev_info(&p->dev, "%s: Disabling regulator\n", __func__);
ret = regulator_disable(channel->vbus);
+dev_info(&p->dev, "%s: regulator_disable() returned %d\n", __func__, ret);
+}
+else dev_info(&p->dev, "%s: Not disabling regulator\n", __func__);

return ret;
}