lkml.org 
[lkml]   [2020]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2020-09-11 18:42    [W:0.070 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site