From: Tom Rini <trini@konsulko.com>
To: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Cc: u-boot@lists.denx.de, Frank Wang <frank.wang@rock-chips.com>,
Andre Przywara <andre.przywara@arm.com>,
Simon Glass <sjg@chromium.org>,
Neil Armstrong <narmstrong@baylibre.com>,
Grant Likely <grant.likely@arm.com>,
Joe Hershberger <joe.hershberger@ni.com>,
Peter Robinson <pbrobinson@gmail.com>,
Jagan Teki <jagan@amarulasolutions.com>,
Patrick Delaunay <patrick.delaunay@foss.st.com>,
Grant Likely <grant.likely@secretlab.ca>,
Icenowy Zheng <icenowy@aosc.io>
Subject: Re: [PATCH v3] phy: Track power-on and init counts in uclass
Date: Sat, 15 Jan 2022 07:38:36 -0500 [thread overview]
Message-ID: <20220115123836.GG9207@bill-the-cat> (raw)
In-Reply-To: <20211230193652.33514-1-alpernebiyasak@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1992 bytes --]
On Thu, Dec 30, 2021 at 10:36:51PM +0300, Alper Nebi Yasak wrote:
> On boards using the RK3399 SoC, the USB OHCI and EHCI controllers share
> the same PHY device instance. While these controllers are being stopped
> they both attempt to power-off and deinitialize it, but trying to
> power-off the deinitialized PHY device results in a hang. This usually
> happens just before booting an OS, and can be explicitly triggered by
> running "usb start; usb stop" in the U-Boot shell.
>
> Implement a uclass-wide counting mechanism for PHY initialization and
> power state change requests, so that we don't power-off/deinitialize a
> PHY instance until all of its users want it done. The Allwinner A10 USB
> PHY driver does this counting in-driver, remove those parts in favour of
> this in-uclass implementation.
>
> The sandbox PHY operations test needs some changes since the uclass will
> no longer call into the drivers for actions matching its tracked state
> (e.g. powering-off a powered-off PHY). Update that test, and add a new
> one which simulates multiple users of a single PHY.
>
> The major complication here is that PHY handles aren't deduplicated per
> instance, so the obvious idea of putting the counts in the PHY handles
> don't immediately work. It seems possible to bind a child udevice per
> PHY instance to the PHY provider and deduplicate the handles in each
> child's uclass-private areas, like in the CLK framework. An alternative
> approach could be to use those bound child udevices themselves as the
> PHY handles. Instead, to avoid the architectural changes those would
> require, this patch solves things by dynamically allocating a list of
> structs (one per instance) in the provider's uclass-private area.
>
> Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Tested-by: Peter Robinson <pbrobinson@gmail.com> - Rock960
Applied to u-boot/master, thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
prev parent reply other threads:[~2022-01-15 12:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-30 19:36 [PATCH v3] phy: Track power-on and init counts in uclass Alper Nebi Yasak
2022-01-02 11:47 ` Peter Robinson
2022-01-15 12:38 ` Tom Rini [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=20220115123836.GG9207@bill-the-cat \
--to=trini@konsulko.com \
--cc=alpernebiyasak@gmail.com \
--cc=andre.przywara@arm.com \
--cc=frank.wang@rock-chips.com \
--cc=grant.likely@arm.com \
--cc=grant.likely@secretlab.ca \
--cc=icenowy@aosc.io \
--cc=jagan@amarulasolutions.com \
--cc=joe.hershberger@ni.com \
--cc=narmstrong@baylibre.com \
--cc=patrick.delaunay@foss.st.com \
--cc=pbrobinson@gmail.com \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/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