From: Andrew Lunn <andrew@lunn.ch>
To: Rob Herring <robh+dt@kernel.org>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
netdev <netdev@vger.kernel.org>,
adam.rudzinski@arf.net.pl, Marco Felsch <m.felsch@pengutronix.de>,
Heiner Kallweit <hkallweit1@gmail.com>,
Richard Leitner <richard.leitner@skidata.com>,
Dejin Zheng <zhengdejin5@gmail.com>,
devicetree@vger.kernel.org, Sascha Hauer <kernel@pengutronix.de>,
Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH net-next 1/3] net: phy: Support enabling clocks prior to bus probe
Date: Thu, 3 Sep 2020 23:42:38 +0200 [thread overview]
Message-ID: <20200903214238.GF3112546@lunn.ch> (raw)
In-Reply-To: <CAL_JsqL=XLJo9nrX+AMs41QvA3qpW6zoyB8qNwRx3V-+U-+uLg@mail.gmail.com>
On Thu, Sep 03, 2020 at 03:28:22PM -0600, Rob Herring wrote:
> What if a device requires clocks enabled in a certain order or timing?
> It's not just clocks, you could have some GPIOs or a regulator that
> need enabling first. It's device specific, so really needs a per
> device solution. This is not just an issue with MDIO. I think we
> really need some sort of pre-probe hook in the driver model in order
> to do any non-discoverable init for discoverable buses.
Hi Rob
How do you solve the chicken/egg of knowing what device specific init
is needed before you can discover what device you have on the bus?
> Or perhaps forcing probe when there are devices defined in DT if
> they're not discovered by normal means.
The PHY subsystem has this. You came specify in DT the ID of the
device which we would normally read during bus discovery. The correct
driver is then loaded and probed. But it is good practice to avoid
this. OEMs are known to change the PHY in order to perform cost
optimisation. So we prefer to do discover and do the right thing if
the PHY has changed.
As for GPIOS and regulators, i expect this code will expand pretty
soon after being merged to handle those. There are users wanting
it. We already have some standard properties defined, in terms of
gpios, delay while off, delay after turning it on. As for ordering, i
guess it would make sense to enable the clocks and then hit it with a
reset? If there is a device which cannot be handled like this, it can
always hard code its ID in device tree, and fully control its
resources in the driver.
Andrew
next prev parent reply other threads:[~2020-09-03 21:42 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-03 4:39 [PATCH net-next 0/3] net: phy: Support enabling clocks prior to bus probe Florian Fainelli
2020-09-03 4:39 ` [PATCH net-next 1/3] " Florian Fainelli
2020-09-03 20:39 ` Andrew Lunn
2020-09-03 21:25 ` Andrew Lunn
2020-09-03 21:28 ` Rob Herring
2020-09-03 21:42 ` Andrew Lunn [this message]
2020-09-03 21:50 ` Florian Fainelli
2020-09-03 21:43 ` Florian Fainelli
2020-09-03 4:39 ` [PATCH net-next 2/3] net: phy: mdio-bcm-unimac: Enable GPHY resources during bus reset Florian Fainelli
2020-09-03 4:39 ` [PATCH net-next 3/3] net: phy: bcm7xxx: request and manage GPHY clock Florian Fainelli
2020-09-04 6:15 ` Marco Felsch
2020-09-04 15:37 ` Florian Fainelli
2020-09-07 7:34 ` Marco Felsch
2020-09-07 19:07 ` Marco Felsch
2020-09-04 6:18 ` Marco Felsch
2020-09-04 15:38 ` Florian Fainelli
2020-09-07 7:37 ` Marco Felsch
2020-09-04 4:04 ` [PATCH net-next 0/3] net: phy: Support enabling clocks prior to bus probe Florian Fainelli
2020-09-04 6:19 ` Adam Rudziński
2020-09-04 13:45 ` Andrew Lunn
2020-09-04 14:00 ` Adam Rudziński
2020-09-04 14:23 ` Andrew Lunn
2020-09-04 17:21 ` Adam Rudziński
2020-09-04 13:58 ` Andrew Lunn
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=20200903214238.GF3112546@lunn.ch \
--to=andrew@lunn.ch \
--cc=adam.rudzinski@arf.net.pl \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=m.felsch@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=richard.leitner@skidata.com \
--cc=robh+dt@kernel.org \
--cc=zhengdejin5@gmail.com \
/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).