lkml.org 
[lkml]   [2021]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v2 03/21] ACPI: CPPC: Check online CPUs for determining _CPC is valid
Date
[AMD Official Use Only]

> -----Original Message-----
> From: Rafael J. Wysocki <rafael@kernel.org>
> Sent: Wednesday, October 20, 2021 12:53 AM
> To: Huang, Ray <Ray.Huang@amd.com>
> Cc: Rafael J . Wysocki <rafael.j.wysocki@intel.com>; Viresh Kumar
> <viresh.kumar@linaro.org>; Shuah Khan <skhan@linuxfoundation.org>;
> Borislav Petkov <bp@suse.de>; Peter Zijlstra <peterz@infradead.org>; Ingo
> Molnar <mingo@kernel.org>; Linux PM <linux-pm@vger.kernel.org>;
> Sharma, Deepak <Deepak.Sharma@amd.com>; Deucher, Alexander
> <Alexander.Deucher@amd.com>; Limonciello, Mario
> <Mario.Limonciello@amd.com>; Fontenot, Nathan
> <Nathan.Fontenot@amd.com>; Su, Jinzhou (Joe) <Jinzhou.Su@amd.com>;
> Du, Xiaojian <Xiaojian.Du@amd.com>; Linux Kernel Mailing List <linux-
> kernel@vger.kernel.org>; the arch/x86 maintainers <x86@kernel.org>
> Subject: Re: [PATCH v2 03/21] ACPI: CPPC: Check online CPUs for
> determining _CPC is valid
>
> On Sun, Sep 26, 2021 at 11:06 AM Huang Rui <ray.huang@amd.com> wrote:
> >
> > From: Mario Limonciello <mario.limonciello@amd.com>
> >
> > As this is a static check, it should be based upon what is currently
> > present on the system. This makes probeing more deterministic.
> >
> > While local APIC flags field (lapic_flags) of cpu core in MADT table
> > is 0, then the cpu core won't be enabled. In this case, _CPC won't be
> > found in this core, and return back to _CPC invalid with walking
> > through possible cpus (include disable cpus). This is not expected, so
> > switch to check online CPUs instead.
> >
> > Reported-by: Jinzhou Su <Jinzhou.Su@amd.com>
> > Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> > Signed-off-by: Huang Rui <ray.huang@amd.com>
> > ---
> > drivers/acpi/cppc_acpi.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index
> > a4d4eebba1da..2efe2ba97d96 100644
> > --- a/drivers/acpi/cppc_acpi.c
> > +++ b/drivers/acpi/cppc_acpi.c
> > @@ -411,7 +411,7 @@ bool acpi_cpc_valid(void)
> > struct cpc_desc *cpc_ptr;
> > int cpu;
> >
> > - for_each_possible_cpu(cpu) {
> > + for_each_online_cpu(cpu) {
>
> Shouldn't this be for_each_present_cpu()? In case a CPU is present, but not
> online when cppc_cpufreq is loaded?
>

OK, got it, thanks! Will update it in V3.

Thanks,
Ray
\
 
 \ /
  Last update: 2021-10-20 13:16    [W:0.117 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site