diff options
author | James Morse <james.morse@arm.com> | 2015-07-21 14:23:28 +0200 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2015-07-27 12:08:41 +0200 |
commit | 1c0763037f1e1caef739e36e09c6d41ed7b61b2d (patch) | |
tree | 84306615418b6f7944c628df6170c46647d6d35c /arch/arm64/kernel/cpufeature.c | |
parent | arm64: kernel: Move config_sctlr_el1 (diff) | |
download | linux-1c0763037f1e1caef739e36e09c6d41ed7b61b2d.tar.xz linux-1c0763037f1e1caef739e36e09c6d41ed7b61b2d.zip |
arm64: kernel: Add cpufeature 'enable' callback
This patch adds an 'enable()' callback to cpu capability/feature
detection, allowing features that require some setup or configuration
to get this opportunity once the feature has been detected.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to '')
-rw-r--r-- | arch/arm64/kernel/cpufeature.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 5ad86ceac010..650ffc28bedc 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -55,6 +55,12 @@ void check_cpu_capabilities(const struct arm64_cpu_capabilities *caps, pr_info("%s %s\n", info, caps[i].desc); cpus_set_cap(caps[i].capability); } + + /* second pass allows enable() to consider interacting capabilities */ + for (i = 0; caps[i].desc; i++) { + if (cpus_have_cap(caps[i].capability) && caps[i].enable) + caps[i].enable(); + } } void check_local_cpu_features(void) |