From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754136AbeAQRnB (ORCPT ); Wed, 17 Jan 2018 12:43:01 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:44944 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750969AbeAQRm7 (ORCPT ); Wed, 17 Jan 2018 12:42:59 -0500 From: Suzuki K Poulose To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, dave.martin@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, marc.zyngier@arm.com, mark.rutland@arm.com, james.morse@arm.com, robin.murphy@arm.com, Suzuki K Poulose , Andre Przywara Subject: [PATCH v2 1/2] arm64: capabilities: Clarify argument passed to enable call back Date: Wed, 17 Jan 2018 17:42:19 +0000 Message-Id: <20180117174220.7959-2-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180117174220.7959-1-suzuki.poulose@arm.com> References: <20180117174220.7959-1-suzuki.poulose@arm.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Will Deacon Cc: Robin Murphy Cc: Catalin Marinas Cc: Mark Rutland Cc: Andre Przywara Cc: James Morse Signed-off-by: Suzuki K Poulose --- 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. + * It is upto the callback (especially when multiple entries for the + * same capability exists) to determine if any action should be taken + * based on @matches() applies to thie CPU. + */ + int (*enable)(void *caps); union { struct { /* To be used for erratum handling only */ u32 midr_model; -- 2.13.6