Messages in this thread | | | Date | Fri, 11 Sep 2020 15:40:32 +0100 | From | Catalin Marinas <> | Subject | Re: [PATCH 4/4] arm64: implement CPPC FFH support using AMUs |
| |
On Wed, Aug 26, 2020 at 02:03:09PM +0100, Ionela Voinescu wrote: > +/* > + * Refer to drivers/acpi/cppc_acpi.c for the description of the functions > + * below. > + */ > +bool cpc_ffh_supported(void) > +{ > + const struct cpumask *cnt_cpu_mask = cpus_with_amu_counters(); > + int cpu = nr_cpu_ids; > + > + if (cnt_cpu_mask) > + cpu = cpumask_any_and(cnt_cpu_mask, cpu_present_mask); > + > + if ((cpu >= nr_cpu_ids) || !freq_counters_valid(cpu)) > + return false; > + > + return true; > +}
IIUC, the only need for the cpumask is this function, the others would have worked just fine with the existing cpu_has_amu_feat(). So you have a lot more !cnt_cpu_mask checks now.
I wonder whether instead you could add a new function near cpu_has_amu_feat(), something like get_cpu_with_amu_feat() and do the cpumask_any_and() in there.
-- Catalin
| |