Re: [PATCH 1/2] arm64: dts: exynos850: Add ACPM firmware node
From: Alexey Klimov
Date: Mon Nov 16 2026 - 11:31:44 EST
Hi Peter,
On Fri Nov 13, 2026 at 4:46 PM GMT, Peter Griffin wrote:
> Hi Alexey,
>
>> >> Eventually to have some sensible/working ->recalc_rate() for ACPM
>> >> cpucl{0,1} clocks.
>> >>
>> >> Which is needed, for instance, for cpufreq_dt because it registers with:
>> >>
>> >> static struct cpufreq_driver dt_cpufreq_driver = {
>> >> .flags = CPUFREQ_NEED_INITIAL_FREQ_CHECK |
>> >> CPUFREQ_IS_COOLING_DEV,
>> >>
>> >> Don't know if it answers the question (if I understood it correctly)?
>> >>
>> >
>> > Thanks, Alexey. I see now that clk-acpm.c uses pdata.fw_name on the
>> > parent (acpm_ipc) DT node to link the ACPM clocks to the CMU PLLs for
>> > ->recalc_rate(). Could you please clarify a few things in the commit
>> > message (and below):
>>
>> Thanks for the good questions. You hit the exact pain points we have been
>> debugging on hardware with cpufreq-dt and Panfrost devfreq.
>>
>> > 1. Physically, CLK_FOUT_CPUCL{0,1}_PLL are not input clocks feeding the
>> > APM hardware, they are the PLLs that ACPM reconfigures behind the
>> > scenes. Meanwhile, acpm_clk_register() sets num_parents = 1 and
>> > pdata.fw_name = name for all 9 clocks in exynos850_acpm_clks[].
>> > Since the DT node only lists "cpucl0" and "cpucl1", won't the other
>> > 7 ACPM clocks (mif, int, g3d, aud, cam, disp, cp) remain permanently
>> > orphaned in CCF with rate = 0?
>>
>> Correct. Is it a problem now since there are no "clients" or consumers or
>> users of these clocks?
>>
>> Or do you suggest to link them all to parents clocks to have a sensible
>> rate?
>
> Since your implementation relies on CCF to get the clock rates I think
> you have two options:
> 1) Only register ACPM clocks that have a corresponding CCF implementation.
> 2) Add the missing CCF clocks for the ACPM clocks you are registerring
Well, if there are other suggestions to implement these clocks without
relying on clock framework, then feel free to share.
Current implementation does indeed registers all clocks from
exynos850_acpm_clks[] and the ones not listed in DT will have no
parents, no rates, with no_connection_id and no users+usage.
Since it seems to be a problem, okay I will fix it.
> Should CCF's ability to set the rate for these ACPM-managed clocks
> also be restricted? It seems undesirable to have two entities (Linux
> and ACPM) able to set the clock rate, with the possible exception of
> it being useful for debugging. These limitations should also be
> clearly mentioned in the commit message or cover letter.
Ideally yes.
>> > 2. Does bypass_acpm_exynos850_get_rate() actually return the updated rate
>> > after clk_set_rate()? When ACPM changes the PLL frequency via IPC,
>> > CCF is unaware that the parent clock (fout_cpucl0_pll) changed in
>> > hardware. Even with CLK_GET_RATE_NOCACHE on the ACPM clock,
>> > __clk_recalc_rates() only reads the cached core->parent->rate without
>> > calling ->recalc_rate() on the parent itself. Won't parent_rate remain
>> > stuck at the initial boot frequency?
>>
>> This was already asked and seems there are no answers. The problem with
>> stale rate is present.
>> https://lore.kernel.org/linux-samsung-soc/DLAZXSNZK6QC.1VFAX37XCXBOV@xxxxxxxxxx/
>
> The question was sent on September 9th, but the series adding support
> into ACPM was sent on September 15th
> (https://lore.kernel.org/lkml/20260915-exynos850-acpm-clk-v2-0-ffad4a6b3fb1@xxxxxxxxxx/).
> The limitation about get_rate returning stale values should have been
> clearly stated in the cover letter or commit messages.
It is a fair point on documenting this in the commit message —
but the gravity of the problem and its consequences were understood quite
recently (you should be aware about that). At the time v2 was sent,
initial testing only exercised one-way rate transitions which appeared to
work, so the full impact of the stale rate wasn't apparent until more
detailed DVFS testing later on. The problems with stale rate were
initially discussed way before September.
>> Any suggestions?
>
> For the benefit of the ML, we discussed this topic off list. The
> consensus was to try and make CCF walk the clock tree, recalculating
> clock rates from the SFRs without using any cached values (as ACPM
> could have changed the SFRs of PLLs, dividers, etc., behind Linux's
> back).
>
> That should in theory mean that clk_summary will always report the
> correct clock rates for everything in the clock tree and we won't
> report (or make decisions) based on stale values.
I'll re-implement and re-send.
>> > 3. In drivers/clk/samsung/clk-exynos850.c, cpucl0_cmu_info and
>> > cpucl1_cmu_info still set `.manual_plls = true`.
>> > Does that conflict with ACPM firmware managing the CPU PLLs?
>>
>> I don't know yet what to do with that. I didn't encounter any problems
>> yet because of this. Is it related to early initialisation only?
>> I thought that exynos CMU driver doesn't touch PLL clocks after init.
>
> You should check this with downstream sources and the TRM.
Erm, I don't think this question relates to downstream unless I am
missing something.
BR,
Alexey.