[PATCH v2] arm64: topology: add source check in arch_cpu_idle_enter()

Greg Kroah-Hartman gregkh at linuxfoundation.org
Mon Aug 10 04:37:44 PDT 2026


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 <xuewen.yan at unisoc.com>
> Signed-off-by: Sean Wang <seanwang1 at lenovo.com>
> Signed-off-by: Xuewen Yan <xuewen.yan at unisoc.com>
> ---

The From: line does not match your signed-off-by name :(




More information about the linux-arm-kernel mailing list