From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/2] arm64: capabilities: Clarify argument passed to enable call back
Date: Mon, 22 Jan 2018 12:42:15 +0000 [thread overview]
Message-ID: <20180122124214.GA28589@arm.com> (raw)
In-Reply-To: <20180117174220.7959-2-suzuki.poulose@arm.com>
On Wed, Jan 17, 2018 at 05:42:19PM +0000, Suzuki K Poulose wrote:
> We issue the enable() call back for all CPU hwcaps capabilities
> available on the system, on all the CPUs. So far we have ignored
> the argument passed to the call back, which had a prototype to
> accept a "void *" for use with on_each_cpu() and later with
> stop_machine(). However, with commit 0a0d111d40fd1
> ("arm64: cpufeature: Pass capability structure to ->enable callback"),
> there are some users of the argument who wants the matching capability
> struct pointer where there are multiple matching criteria for a single
> capability. Changing the prototype is quite an invasive change and
> will be part of a future series. For now, add a comment to clarify
> what is expected.
>
> Suggested-by: Dave Martin <dave.martin@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Andre Przywara <andre.przywara@arm.com>
> Cc: James Morse <james.morse@arm.com>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> ---
> arch/arm64/include/asm/cpufeature.h | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h
> index ac67cfc2585a..c049e28274d4 100644
> --- a/arch/arm64/include/asm/cpufeature.h
> +++ b/arch/arm64/include/asm/cpufeature.h
> @@ -97,7 +97,14 @@ struct arm64_cpu_capabilities {
> u16 capability;
> int def_scope; /* default scope */
> bool (*matches)(const struct arm64_cpu_capabilities *caps, int scope);
> - int (*enable)(void *); /* Called on all active CPUs */
> + /*
> + * For each @capability set in CPU hwcaps, @enable() is called on all
> + * active CPUs with const struct arm64_cpu_capabilities * as argument.
its argument.
> + * It is upto the callback (especially when multiple entries for the
s/upto/up to/
> + * same capability exists) to determine if any action should be taken
s/exists/exit/
> + * based on @matches() applies to thie CPU.
s/thie/this/
Still, the second half of the sentence doesn't really make a lot of
sense. Instead of:
"to determine if any action should be taken based on @matches() applies
to this CPU"
how about:
"to determine if any action should be taken based on the result of
@matches() for the local CPU."
Otherwise:
Acked-by: Will Deacon <will.deacon@arm.com>
Will
next prev parent reply other threads:[~2018-01-22 12:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-17 17:42 [PATCH v2 0/2] arm64: Run enable method for errata work arounds on late CPUs Suzuki K Poulose
2018-01-17 17:42 ` [PATCH v2 1/2] arm64: capabilities: Clarify argument passed to enable call back Suzuki K Poulose
2018-01-22 12:42 ` Will Deacon [this message]
2018-01-17 17:42 ` [PATCH v2 2/2] arm64: Run enable method for errata work arounds on late CPUs Suzuki K Poulose
2018-01-18 11:45 ` [PATCH v2 0/2] " Dave Martin
2018-01-18 12:00 ` Robin Murphy
2018-01-18 12:08 ` Robin Murphy
2018-01-18 14:21 ` Dave Martin
2018-01-18 14:25 ` Suzuki K Poulose
2018-01-18 18:31 ` Suzuki K Poulose
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=20180122124214.GA28589@arm.com \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.infradead.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).