From: Stephen Boyd <sboyd@kernel.org>
To: Maxime Ripard <maxime@cerno.tech>,
Michael Turquette <mturquette@baylibre.com>
Cc: linux-clk@vger.kernel.org, Mark Brown <broonie@kernel.org>,
linux-kernel@vger.kernel.org,
Marek Szyprowski <m.szyprowski@samsung.com>,
Maxime Ripard <maxime@cerno.tech>
Subject: Re: [PATCH 1/2] clk: Update req_rate on __clk_recalc_rates()
Date: Mon, 10 Oct 2022 20:43:18 -0700 [thread overview]
Message-ID: <20221011034320.19207C433C1@smtp.kernel.org> (raw)
In-Reply-To: <20221010-rpi-clk-fixes-again-v1-1-d87ba82ac404@cerno.tech>
Quoting Maxime Ripard (2022-10-10 07:47:38)
> Commit cb1b1dd96241 ("clk: Set req_rate on reparenting") introduced a
> new function, clk_core_update_orphan_child_rates(), that updates the
> req_rate field on reparenting.
>
> It turns out that that function will interfere with the clock notifying
> done by __clk_recalc_rates(). This ends up reporting the new rate in
> both the old_rate and new_rate fields of struct clk_notifier_data.
>
> Since clk_core_update_orphan_child_rates() is basically
> __clk_recalc_rates() without the notifiers, and with the req_rate field
> update, we can drop clk_core_update_orphan_child_rates() entirely, and
> make __clk_recalc_rates() update req_rate.
>
> However, __clk_recalc_rates() is being called in several code paths:
> when retrieving a rate (most likely through clk_get_rate()), when changing
> parents (through clk_set_rate() or clk_hw_reparent()), or when updating
> the orphan status (through clk_core_reparent_orphans_nolock(), called at
> registration).
>
> Updating req_rate on reparenting or initialisation makes sense, but we
> shouldn't do it on clk_get_rate(). Thus an extra flag has been added to
> update or not req_rate depending on the context.
>
> Fixes: cb1b1dd96241 ("clk: Set req_rate on reparenting")
> Link: https://lore.kernel.org/linux-clk/0acc7217-762c-7c0d-45a0-55c384824ce4@samsung.com/
> Link: https://lore.kernel.org/linux-clk/Y0QNSx+ZgqKSvPOC@sirena.org.uk/
> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Reported-by: Mark Brown <broonie@kernel.org>
> Suggested-by: Stephen Boyd <sboyd@kernel.org>
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> ---
Applied to clk-next
next prev parent reply other threads:[~2022-10-11 3:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20221010144751eucas1p2edac1b98fa130f6664ece3465f8bd5fb@eucas1p2.samsung.com>
2022-10-10 14:47 ` [PATCH 0/2] clk: More Range Fixes Maxime Ripard
2022-10-10 14:47 ` [PATCH 1/2] clk: Update req_rate on __clk_recalc_rates() Maxime Ripard
2022-10-11 3:43 ` Stephen Boyd [this message]
2022-10-10 14:47 ` [PATCH 2/2] clk: tests: Add tests for notifiers Maxime Ripard
2022-10-11 3:43 ` Stephen Boyd
2022-10-10 17:52 ` [PATCH 0/2] clk: More Range Fixes Marek Szyprowski
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=20221011034320.19207C433C1@smtp.kernel.org \
--to=sboyd@kernel.org \
--cc=broonie@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=maxime@cerno.tech \
--cc=mturquette@baylibre.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).