From: "Alexey Klimov" <alexey.klimov@linaro.org>
To: "Michael Turquette" <mturquette@baylibre.com>,
"Stephen Boyd" <sboyd@kernel.org>,
"Brian Masney" <bmasney@redhat.com>
Cc: <linux-clk@vger.kernel.org>,
"Sam Protsenko" <semen.protsenko@linaro.org>,
"Tudor Ambarus" <tudor.ambarus@linaro.org>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Peter Griffin" <peter.griffin@linaro.org>,
"Sylwester Nawrocki" <s.nawrocki@samsung.com>,
"Chanwoo Choi" <cw00.choi@samsung.com>,
"Alim Akhtar" <alim.akhtar@samsung.com>,
<linux-samsung-soc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [question] [Exynos850] ACPM firmware doesn't implement ->recalc_rate for acpm clocks
Date: Wed, 09 Sep 2026 19:27:44 +0100 [thread overview]
Message-ID: <DLAZXSNZK6QC.1VFAX37XCXBOV@linaro.org> (raw)
Hi all,
I'm working on Exynos850 platform support and currently trying to deal with
ACPM firmware clocks. ACPM is firmware running on separate co-processor
(like SCPI/SCMI thingy for instance).
Unlike gs101, the ACPM firmware clocks protocol on Exynos850 does not
implement get_rate() ACPM IPC call. Set_rate works fine, but get_rate
returns 0. Downstream reads MMIO registers directly to obtain the rate for
these clocks.
The file is drivers/clk/samsung/clk-acpm.c
static const struct clk_ops acpm_clk_ops = {
.recalc_rate = acpm_clk_recalc_rate, <-- not impl by firmware
.determine_rate = acpm_clk_determine_rate,
.set_rate = acpm_clk_set_rate,
};
Currently I made ACPM clocks childs of corresponding parent clocks, for
instance, for CPU clocks:
clocks = <&cmu_cpucl0 CLK_FOUT_CPUCL0_PLL>,
<&cmu_cpucl1 CLK_FOUT_CPUCL1_PLL>;
clock-names = "cpucl0", "cpucl1";
and just return parent_rate from ->recalc_rate().
The problem is that stale (cached) value is returned all the time despite
CLK_GET_RATE_NOCACHE. I tried different approaches but don't see smth
upstreameable because clock rates are changed behind Linux and I need
to trigger something like clk_get_rate(parent_clock) to let the new rate
propagate down the tree.
Which pattern is preferred for upstream acceptance here?
1. Return parent_rate as is and live with stale parent rate.
2. Cache the set value in ->set_rate() and return it in ->recalc_rate().
3. Utilise clock rate change notifiers somehow and upon POST_RATE_CHANGE
do smth like clk_set_rate(parent, new_rate) but that probably breaks
locking and mixes clk-provider with clk-consumer.
4. Maybe use/play with CLK_SET_RATE_PARENT?
Or something else?
Best regards,
Alexey
reply other threads:[~2026-09-09 18:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=DLAZXSNZK6QC.1VFAX37XCXBOV@linaro.org \
--to=alexey.klimov@linaro.org \
--cc=alim.akhtar@samsung.com \
--cc=bmasney@redhat.com \
--cc=cw00.choi@samsung.com \
--cc=krzk@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=peter.griffin@linaro.org \
--cc=s.nawrocki@samsung.com \
--cc=sboyd@kernel.org \
--cc=semen.protsenko@linaro.org \
--cc=tudor.ambarus@linaro.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