From: Catalin Marinas <catalin.marinas@arm.com>
To: Ionela Voinescu <ionela.voinescu@arm.com>
Cc: will@kernel.org, sudeep.holla@arm.com, morten.rasmussen@arm.com,
valentin.schneider@arm.com, souvik.chakravarty@arm.com,
viresh.kumar@linaro.org, dietmar.eggemann@arm.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] arm64: implement CPPC FFH support using AMUs
Date: Fri, 11 Sep 2020 15:40:32 +0100 [thread overview]
Message-ID: <20200911144032.GC12835@gaia> (raw)
In-Reply-To: <20200826130309.28027-5-ionela.voinescu@arm.com>
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
next prev parent reply other threads:[~2020-09-11 16:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-26 13:03 [PATCH 0/4] arm64: cppc: add FFH support using AMUs Ionela Voinescu
2020-08-26 13:03 ` [PATCH 1/4] arm64: cpufeature: restructure AMU feedback function Ionela Voinescu
2020-08-26 13:03 ` [PATCH 2/4] arm64: wrap and generalise counter read functions Ionela Voinescu
2020-08-26 13:03 ` [PATCH 3/4] arm64: split counter validation function Ionela Voinescu
2020-08-26 13:03 ` [PATCH 4/4] arm64: implement CPPC FFH support using AMUs Ionela Voinescu
2020-09-11 14:40 ` Catalin Marinas [this message]
2020-09-22 16:07 ` Ionela Voinescu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200911144032.GC12835@gaia \
--to=catalin.marinas@arm.com \
--cc=dietmar.eggemann@arm.com \
--cc=ionela.voinescu@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=morten.rasmussen@arm.com \
--cc=souvik.chakravarty@arm.com \
--cc=sudeep.holla@arm.com \
--cc=valentin.schneider@arm.com \
--cc=viresh.kumar@linaro.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).