Re: [PATCH] arm64: topology: fix arch_cpu_idle_enter()
Xuewen Yan <[email protected]>
| Newsgroups | gmane.linux.kernel,gmane.linux.ports.arm.kernel |
|---|---|
| Message-ID | <CAB8ipk-qZ+MjSyuUu57pB5uMmzC9sv5=9t4z5quC43_N+QBTPg@mail.gmail.com> |
Hi sean, On Fri, Aug 7, 2026 at 10:07 PM seanwang1 <[email protected]> wrote: > > arch_cpu_idle_enter() directly calls amu_scale_freq_tick() to update > arch_freq_scale when CPU enters idle state. This bypasses the sft_data > pointer check that topology_clear_scale_freq_source() relies on. > > As a result, even after calling topology_clear_scale_freq_source() with > SCALE_FREQ_SOURCE_ARCH to disable AMU-based frequency scaling, the > arch_freq_scale value can still be modified by AMU counters when the > CPU goes idle through the arch_cpu_idle_enter() path. > > Fix by replacing the direct amu_scale_freq_tick() call with > topology_scale_freq_tick(), which is the generic interface for updating > frequency scale and properly respects the sft_data pointer state. > > Co-developed-by: Xuewen Yan <[email protected]> > Signed-off-by: Sean Wang <[email protected]> > Signed-off-by: Xuewen Yan <[email protected]> > --- > arch/arm64/kernel/topology.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c > index b32f13358fbb..f617ef5c9903 100644 > --- a/arch/arm64/kernel/topology.c > +++ b/arch/arm64/kernel/topology.c > @@ -176,7 +176,7 @@ void arch_cpu_idle_enter(void) > /* Kick in AMU update but only if one has not happened already */ > if (housekeeping_cpu(cpu, HK_TYPE_TICK) && > time_is_before_jiffies(per_cpu(cpu_amu_samples.last_scale_update, cpu))) > - amu_scale_freq_tick(); > + topology_scale_freq_tick(); Need we add rcu_lock/unlock? > } > > #define AMU_SAMPLE_EXP_MS 20 > -- > 2.25.1 > >