From: seanwang1 <seanwang1@lenovo.com>
To: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Beata Michalska <beata.michalska@arm.com>,
Lifeng Zheng <zhenglifeng1@huawei.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Sumit Gupta <sumitg@nvidia.com>,
Yunhui Cui <cuiyunhui@bytedance.com>,
seanwang1 <seanwang1@lenovo.com>,
Xuewen Yan <xuewen.yan@unisoc.com>
Subject: [PATCH] arm64: topology: fix arch_cpu_idle_enter()
Date: Fri, 7 Aug 2026 21:52:16 +0800 [thread overview]
Message-ID: <20260807135216.9919-1-seanwang1@lenovo.com> (raw)
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 <xuewen.yan@unisoc.com>
Signed-off-by: Sean Wang <seanwang1@lenovo.com>
Signed-off-by: Xuewen Yan <xuewen.yan@unisoc.com>
---
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();
}
#define AMU_SAMPLE_EXP_MS 20
--
2.25.1
reply other threads:[~2026-08-07 13:53 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=20260807135216.9919-1-seanwang1@lenovo.com \
--to=seanwang1@lenovo.com \
--cc=beata.michalska@arm.com \
--cc=catalin.marinas@arm.com \
--cc=cuiyunhui@bytedance.com \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sumitg@nvidia.com \
--cc=will@kernel.org \
--cc=xuewen.yan@unisoc.com \
--cc=zhenglifeng1@huawei.com \
/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