Re: [PATCH v2] arm64: topology: add source check in arch_cpu_idle_enter()
Greg Kroah-Hartman <[email protected]>
| Newsgroups | dev.linux.lists.driver-core,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <2026081025-rummage-rifling-982e@gregkh> |
On Mon, Aug 10, 2026 at 06:20:06PM +0800, seanwang1 wrote: > arch_cpu_idle_enter() directly calls amu_scale_freq_tick() to update > arch_freq_scale when a CPU enters idle. 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. > > Add topology_scale_freq_source() helper to check whether a specific > frequency scaling source is currently registered for a CPU. Use it > in arch_cpu_idle_enter() to verify that AMU is the active source > before calling amu_scale_freq_tick(). > > This ensures that topology_clear_scale_freq_source() properly > disables AMU updates in both the tick path (already handled by > topology_scale_freq_tick()) and the idle path. > > Co-developed-by: Xuewen Yan <[email protected]> > Signed-off-by: Sean Wang <[email protected]> > Signed-off-by: Xuewen Yan <[email protected]> > --- The From: line does not match your signed-off-by name :(