linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Kishon Vijay Abraham I <kishon@ti.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: RE: [PATCH] phy: renesas: rcar-gen3-usb2: fix imbalance powered flag
Date: Fri, 7 Jun 2019 09:00:26 +0000	[thread overview]
Message-ID: <TYAPR01MB3102B60943E7A677B5C17570D8100@TYAPR01MB3102.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <CAMuHMdVHpOULpusZeOJvRs8OMoC2JopOqrK9Q8KeCxtyEbz0qA@mail.gmail.com>

Hi Geert-san,

> From: Geert Uytterhoeven, Sent: Wednesday, June 5, 2019 10:08 PM
<snip>
> > > 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@glider.be>
> >
> > 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.

Thank you for your patch. Finally, I found the other imbalance is caused by
rcar_gen3_phy_usb2_power_on(). rcar_gen3_phy_usb2_power_on() should have
own mutex lock to avoid a race condition between calls rcar_gen3_are_all_rphys_power_off()
and assign the ->powered. So, I'll submit v2 patch later.

Notes:
 - Even if the driver has such an own mutex, sometimes the different phy number
   enables the regulator. But the imbalance enabling the regulator issue disappears.

 - One of the phy channel has 4 phy devices. And the phy channel has a regulator
   so that enabling the regulator by one of the phy devices is enough.

--- Example (v5.2-rc3 on R-Car H3) ---
# ls /sys/class/phy/
phy-e65ee000.usb-phy.12  phy-ee0a0200.usb-phy.0  phy-ee0c0200.usb-phy.5
phy-ee080200.usb-phy.10  phy-ee0a0200.usb-phy.1  phy-ee0c0200.usb-phy.6
phy-ee080200.usb-phy.11  phy-ee0a0200.usb-phy.2  phy-ee0c0200.usb-phy.7
phy-ee080200.usb-phy.8   phy-ee0a0200.usb-phy.3
phy-ee080200.usb-phy.9   phy-ee0c0200.usb-phy.4

- phy-ee080200.usb-phy is one of the phy channel.
-- And the "phy-ee080200.usb-phy" phy channel has a regulator.
-- Other phy channels (phy-ee0[ac]0200.usb-phy) don't have their regulators.

- phy-ee080200.usb-phy.{8,9,10,11} are phy devices.
----

Best regards,
Yoshihiro Shimoda


      reply	other threads:[~2019-06-07  9:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-05  4:49 [PATCH] phy: renesas: rcar-gen3-usb2: fix imbalance powered flag Yoshihiro Shimoda
2019-06-05  9:25 ` Geert Uytterhoeven
2019-06-05 12:12   ` Yoshihiro Shimoda
2019-06-05 13:08     ` Geert Uytterhoeven
2019-06-07  9:00       ` Yoshihiro Shimoda [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=TYAPR01MB3102B60943E7A677B5C17570D8100@TYAPR01MB3102.jpnprd01.prod.outlook.com \
    --to=yoshihiro.shimoda.uh@renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).