linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gautham R. Shenoy" <gautham.shenoy@amd.com>
To: "Rafael J . Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>,
	Mario Limonciello <mario.limonciello@amd.com>,
	Yunhui Cui <cuiyunhui@bytedance.com>,
	Jeremy Linton <jeremy.linton@arm.com>,
	"Viresh Kumar" <viresh.kumar@linaro.org>,
	Ionela Voinescu <ionela.voinescu@arm.com>
Cc: <linux-acpi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	"Christopher Harris" <chris.harris79@gmail.com>,
	<linux-pm@vger.kernel.org>,
	"Gautham R. Shenoy" <gautham.shenoy@amd.com>,
	"Mario Limonciello (AMD) (kernel.org)" <superm1@kernel.org>
Subject: [PATCH v2 1/5] ACPI: CPPC: Detect preferred core availability on online CPUs
Date: Fri, 7 Nov 2025 13:11:41 +0530	[thread overview]
Message-ID: <20251107074145.2340-2-gautham.shenoy@amd.com> (raw)
In-Reply-To: <20251107074145.2340-1-gautham.shenoy@amd.com>

Commit 279f838a61f9 ("x86/amd: Detect preferred cores in
amd_get_boost_ratio_numerator()") introduced the ability to detect the
preferred core on AMD platforms by checking if there at least two
distinct highest_perf values.

However, it uses for_each_present_cpu() to iterate through all the
CPUs in the platform, which is problematic when the kernel is booted
with "nosmt=force" commandline option.

Hence limit the search to only the online CPUs.

Fixes: 279f838a61f9 ("x86/amd: Detect preferred cores in amd_get_boost_ratio_numerator()")
Reported-by: Christopher Harris <chris.harris79@gmail.com>
Closes: https://lore.kernel.org/lkml/CAM+eXpdDT7KjLV0AxEwOLkSJ2QtrsvGvjA2cCHvt1d0k2_C4Cw@mail.gmail.com/
Reviewed-by: "Mario Limonciello (AMD) (kernel.org)" <superm1@kernel.org>
Tested-by: Chrisopher Harris <chris.harris79@gmail.com>
Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
---
 arch/x86/kernel/acpi/cppc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/acpi/cppc.c b/arch/x86/kernel/acpi/cppc.c
index 7047124490f6..d7c8ef1e354d 100644
--- a/arch/x86/kernel/acpi/cppc.c
+++ b/arch/x86/kernel/acpi/cppc.c
@@ -196,7 +196,7 @@ int amd_detect_prefcore(bool *detected)
 		break;
 	}
 
-	for_each_present_cpu(cpu) {
+	for_each_online_cpu(cpu) {
 		u32 tmp;
 		int ret;
 
-- 
2.34.1


  reply	other threads:[~2025-11-07  7:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07  7:41 [PATCH v2 0/5] CPPC/amd-pstate: Fixes to limit actions to online CPUs Gautham R. Shenoy
2025-11-07  7:41 ` Gautham R. Shenoy [this message]
2025-11-07  7:41 ` [PATCH v2 2/5] ACPI: CPPC: Check _CPC validity for only the " Gautham R. Shenoy
2025-11-07  7:41 ` [PATCH v2 3/5] ACPI: CPPC: Perform fast check switch only for " Gautham R. Shenoy
2025-11-07  7:41 ` [PATCH v2 4/5] ACPI: CPPC: Limit perf ctrs in PCC check only to " Gautham R. Shenoy
2025-11-07  7:41 ` [PATCH v2 5/5] cpufreq/amd-pstate: Call cppc_set_auto_sel() only for " Gautham R. Shenoy
2025-11-07 17:41 ` [PATCH v2 0/5] CPPC/amd-pstate: Fixes to limit actions to " Rafael J. Wysocki
2025-11-09  4:04   ` Chris Harris

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=20251107074145.2340-2-gautham.shenoy@amd.com \
    --to=gautham.shenoy@amd.com \
    --cc=chris.harris79@gmail.com \
    --cc=cuiyunhui@bytedance.com \
    --cc=ionela.voinescu@arm.com \
    --cc=jeremy.linton@arm.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=rafael@kernel.org \
    --cc=superm1@kernel.org \
    --cc=viresh.kumar@linaro.org \
    /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;
as well as URLs for NNTP newsgroup(s).