[PATCH v1 2/3] cpufreq: CPPC: Add per_cpu efficiency_class
Marc Zyngier
maz at kernel.org
Thu Mar 17 09:31:30 PDT 2022
On Thu, 17 Mar 2022 16:07:01 +0000,
Pierre Gondois <pierre.gondois at arm.com> wrote:
>
> >> diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
> >> index 27df5c1e6baa..56637cbea5d6 100644
> >> --- a/arch/arm64/kernel/smp.c
> >> +++ b/arch/arm64/kernel/smp.c
> >> @@ -512,6 +512,7 @@ struct acpi_madt_generic_interrupt
> >> *acpi_cpu_get_madt_gicc(int cpu)
> >> {
> >> return &cpu_madt_gicc[cpu];
> >> }
> >> +EXPORT_SYMBOL(acpi_cpu_get_madt_gicc);
> >
> > Why not EXPORT_SYMBOL_GPL()?
>
> From what I understand, this could be made EXPORT_SYMBOL_GPL().
> The only reason was that the other symbol exportation in the
> file wasn't restricted to GPL.
I'm personally keen on keeping this for GPL code only, just like the
current code is. If there is a further need to relax this, we can
discuss it separately.
>
> >
> >>
> >> /*
> >> * acpi_map_gic_cpu_interface - parse processor MADT entry
> >> diff --git a/drivers/cpufreq/cppc_cpufreq.c
> >> b/drivers/cpufreq/cppc_cpufreq.c
> >> index 8f950fe72765..a6cd95c3b474 100644
> >> --- a/drivers/cpufreq/cppc_cpufreq.c
> >> +++ b/drivers/cpufreq/cppc_cpufreq.c
> >> @@ -422,12 +422,66 @@ static unsigned int
> >> cppc_cpufreq_get_transition_delay_us(unsigned int cpu)
> >> return cppc_get_transition_latency(cpu) / NSEC_PER_USEC;
> >> }
> >>
> >> +static bool efficiency_class_populated;
> >> +static DEFINE_PER_CPU(unsigned int, efficiency_class);
> >> +
> >> +static int populate_efficiency_class(void)
> >> +{
> >> + unsigned int min = UINT_MAX, max = 0, class;
> >> + struct acpi_madt_generic_interrupt *gicc;
> >> + int cpu;
> >> +
> >> + for_each_possible_cpu(cpu) {
> >> + gicc = acpi_cpu_get_madt_gicc(cpu);
> >> + if (!gicc)
> >> + return -ENODEV;
> >
> > How can that happen if you made it here using ACPI?
>
> This is effectively an extra check. This could be removed.
Please do.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
More information about the linux-arm-kernel
mailing list