From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: Johannes Zink <j.zink@pengutronix.de>, barebox@lists.infradead.org
Subject: Re: [PATCH] clks: imx7: fix initial clock setup with deep probe enabled
Date: Fri, 2 Sep 2022 20:38:25 +0200 [thread overview]
Message-ID: <20220902183825.GW24324@pengutronix.de> (raw)
In-Reply-To: <5a0c3e08-e47c-d01c-aa9a-b41da6a3f4af@pengutronix.de>
On Fri, Sep 02, 2022 at 04:02:32PM +0200, Ahmad Fatoum wrote:
> Hello,
>
> On 31.08.22 10:21, Johannes Zink wrote:
> > Hi Sascha,
> >
> > On Tue, 2022-08-30 at 17:05 +0200, Sascha Hauer wrote:
> >> On Tue, Aug 30, 2022 at 10:39:37AM +0200, Johannes Zink wrote:
> >>> We register the i.MX7 clock controller driver at core_initcall
> >>> level and
> >>> then do some initial clock setup/reparenting at postcore_initcall
> >>> level.
> >>> This doesn't work as expected when deep probe is enabled, because
> >>> while
> >>> the driver is registered at core_initcall level, it's only probed
> >>> later on, currently at postcore_initcall level because it's a
> >>> dependency
> >>> of the timer for which of_ensure_device_probed is called.
> >>>
> >>> As the initial clock setup is also at postcore_initcall level, it's
> >>> no
> >>> longer guaranteed that the code executes in the same order. Fix
> >>> this by
> >>> directly doing the setup at the end of the probe function.
> >>
> >> Does this still work with deep probe disabled?
> >>
> >> I am asking because this effectively reverts bce79428773 ("clk:
> >> i.MX7: do
> >> clock reparenting when all clocks are initialized"). Switching all
> >> i.MX7 boards to deep probe might be a solution as well.
>
> fixed clocks are registered via CLK_OF_DECLARE, so by the time the
> imx7 clock probe runs, they will always be available, independent of
> whether deep probe is enabled.
So this problem is already fixed, great.
>
> > Though I would not _expect_ any problems here, I would like to check
> > that more thoroughly. This will probably take a bit, please stand by.
>
> I looked at this with Johannes and I am puzzled how the problem
> that bce79428773 aimed to fix occurred. Could you elaborate?
Have a look at the tree at bce79428773. Back then the i.MX7 clock driver
was registered at core_initcall level, the same level that of_probe()
was running which first called of_platform_populate() and then
of_clk_init().
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
prev parent reply other threads:[~2022-09-02 18:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-30 8:39 Johannes Zink
2022-08-30 15:05 ` Sascha Hauer
2022-08-31 8:21 ` Johannes Zink
2022-09-02 14:02 ` Ahmad Fatoum
2022-09-02 18:38 ` Sascha Hauer [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=20220902183825.GW24324@pengutronix.de \
--to=sha@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=j.zink@pengutronix.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