[PATCH 0/4] ACPI: CPPC: Fixes to limit actions to online CPUs

Gautham R. Shenoy posted 4 patches 3 months ago
arch/x86/kernel/acpi/cppc.c | 2 +-
drivers/acpi/cppc_acpi.c    | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
[PATCH 0/4] ACPI: CPPC: Fixes to limit actions to online CPUs
Posted by Gautham R. Shenoy 3 months ago
Hello,

Christopher Harris reported a regression between v6.10 to v6.11 that
the amd-pstate driver failed to load even when the commandline had
"amd_pstate=passive"
(https://lore.kernel.org/lkml/CAM+eXpdDT7KjLV0AxEwOLkSJ2QtrsvGvjA2cCHvt1d0k2_C4Cw@mail.gmail.com/)

On debugging the issue it was observed that when the commandline
contains "nosmt=force", the CPPC code fails when performing certain
checks such as checking for the presence of preferred cores and
validity of the _CPC object since it iterates through all "present"
CPUs while the object state was populated only for "online" CPUs.

This patchset contains fixes to address this issue.

The first two patches in the series address the issue reported by
Chris.

Patches 3 and 4 harden the code in a couple of more functions which
iterated through the present CPUs when it is more apt to restrict the
operations to online CPUs



Gautham R. Shenoy (4):
  ACPI: CPPC: Detect preferred core availability on online CPUs
  ACPI: CPPC: Check _CPC validity for only the online CPUs
  ACPI: CPPC: Perform fast check switch only for online CPUs
  ACPI: CPPC: Limit perf ctrs in PCC check only to online CPUs

 arch/x86/kernel/acpi/cppc.c | 2 +-
 drivers/acpi/cppc_acpi.c    | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

-- 
2.34.1
Re: [PATCH 0/4] ACPI: CPPC: Fixes to limit actions to online CPUs
Posted by Chris H 3 months ago
Confirming: I've tested the first two patches in the series on kernel
v6.17.  The patches successfully resolve the issue described, allowing
one to boot with amd-pstate + nosmt=force.  In other words: receive
the expected amd-pstate scaling driver when SMT logical cores are
disabled.

ACPI: CPPC: Detect preferred core availability on online CPUs
ACPI: CPPC: Check _CPC validity for only the online CPUs

Thank you Mario and Gautham for addressing this so quickly.

Chris Harris

On Wed, Nov 5, 2025 at 6:39 AM Gautham R. Shenoy <gautham.shenoy@amd.com> wrote:
>
> Hello,
>
> Christopher Harris reported a regression between v6.10 to v6.11 that
> the amd-pstate driver failed to load even when the commandline had
> "amd_pstate=passive"
> (https://lore.kernel.org/lkml/CAM+eXpdDT7KjLV0AxEwOLkSJ2QtrsvGvjA2cCHvt1d0k2_C4Cw@mail.gmail.com/)
>
> On debugging the issue it was observed that when the commandline
> contains "nosmt=force", the CPPC code fails when performing certain
> checks such as checking for the presence of preferred cores and
> validity of the _CPC object since it iterates through all "present"
> CPUs while the object state was populated only for "online" CPUs.
>
> This patchset contains fixes to address this issue.
>
> The first two patches in the series address the issue reported by
> Chris.
>
> Patches 3 and 4 harden the code in a couple of more functions which
> iterated through the present CPUs when it is more apt to restrict the
> operations to online CPUs
>
>
>
> Gautham R. Shenoy (4):
>   ACPI: CPPC: Detect preferred core availability on online CPUs
>   ACPI: CPPC: Check _CPC validity for only the online CPUs
>   ACPI: CPPC: Perform fast check switch only for online CPUs
>   ACPI: CPPC: Limit perf ctrs in PCC check only to online CPUs
>
>  arch/x86/kernel/acpi/cppc.c | 2 +-
>  drivers/acpi/cppc_acpi.c    | 6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> --
> 2.34.1
>
Re: [PATCH 0/4] ACPI: CPPC: Fixes to limit actions to online CPUs
Posted by Mario Limonciello (AMD) (kernel.org) 3 months ago

On 11/5/2025 8:38 AM, Gautham R. Shenoy wrote:
> Hello,
> 
> Christopher Harris reported a regression between v6.10 to v6.11 that
> the amd-pstate driver failed to load even when the commandline had
> "amd_pstate=passive"
> (https://lore.kernel.org/lkml/CAM+eXpdDT7KjLV0AxEwOLkSJ2QtrsvGvjA2cCHvt1d0k2_C4Cw@mail.gmail.com/)
> 
> On debugging the issue it was observed that when the commandline
> contains "nosmt=force", the CPPC code fails when performing certain
> checks such as checking for the presence of preferred cores and
> validity of the _CPC object since it iterates through all "present"
> CPUs while the object state was populated only for "online" CPUs.
> 
> This patchset contains fixes to address this issue.
> 
> The first two patches in the series address the issue reported by
> Chris.
> 
> Patches 3 and 4 harden the code in a couple of more functions which
> iterated through the present CPUs when it is more apt to restrict the
> operations to online CPUs
> 
> 
> 
> Gautham R. Shenoy (4):
>    ACPI: CPPC: Detect preferred core availability on online CPUs
>    ACPI: CPPC: Check _CPC validity for only the online CPUs
>    ACPI: CPPC: Perform fast check switch only for online CPUs
>    ACPI: CPPC: Limit perf ctrs in PCC check only to online CPUs
> 
>   arch/x86/kernel/acpi/cppc.c | 2 +-
>   drivers/acpi/cppc_acpi.c    | 6 +++---
>   2 files changed, 4 insertions(+), 4 deletions(-)
> 

The series looks good to me.

Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>

But I would say I noticed we are also using for_each_present_cpu() in 
amd-pstate with amd_pstate_change_mode_without_dvr_change().

Should that also get a similar change?
Re: [PATCH 0/4] ACPI: CPPC: Fixes to limit actions to online CPUs
Posted by Gautham R. Shenoy 3 months ago
On Wed, Nov 05, 2025 at 10:00:25AM -0600, Mario Limonciello (AMD) (kernel.org) wrote:
> 
> > 
> 
> The series looks good to me.
> 
> Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>

Thank you!

> 
> But I would say I noticed we are also using for_each_present_cpu() in
> amd-pstate with amd_pstate_change_mode_without_dvr_change().
> 
> Should that also get a similar change?

Good catch! Yes, that too needs to be fixed to for_each_online_cpu().

I will spin a v2 to include that patch and pick up your Reviewed-by
tag for the earlier ones, and also Chris's Tested-by tag for the first
two patches.

-- 
Thanks and Regards
gautham.