diff options
author | Daniel Lezcano <daniel.lezcano@linaro.org> | 2017-04-07 16:23:29 +0200 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2017-04-07 16:23:29 +0200 |
commit | 6f9c89000c3f771c47adacaca2df775a25f27205 (patch) | |
tree | 862f3df0421466dcdc2c7795f5c5d38d21862323 /arch/arm64/kernel/cpufeature.c | |
parent | 28e71e2fe8fe6cdbd1bdc61601ea50d6423d3cf0 (diff) | |
parent | d003d029cea8a28139b4f9b88a36b8fac864f45b (diff) | |
download | kernel_replicant_linux-6f9c89000c3f771c47adacaca2df775a25f27205.tar.gz kernel_replicant_linux-6f9c89000c3f771c47adacaca2df775a25f27205.tar.bz2 kernel_replicant_linux-6f9c89000c3f771c47adacaca2df775a25f27205.zip |
Merge tag 'arch-timer-errata' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into clockevents/4.12
arm64 arch timer workaround series, including the base patches
that will also go via the arm64 tree.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'arch/arm64/kernel/cpufeature.c')
-rw-r--r-- | arch/arm64/kernel/cpufeature.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index abda8e861865..6eb77ae99b79 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1090,20 +1090,29 @@ static void __init setup_feature_capabilities(void) * Check if the current CPU has a given feature capability. * Should be called from non-preemptible context. */ -bool this_cpu_has_cap(unsigned int cap) +static bool __this_cpu_has_cap(const struct arm64_cpu_capabilities *cap_array, + unsigned int cap) { const struct arm64_cpu_capabilities *caps; if (WARN_ON(preemptible())) return false; - for (caps = arm64_features; caps->desc; caps++) + for (caps = cap_array; caps->desc; caps++) if (caps->capability == cap && caps->matches) return caps->matches(caps, SCOPE_LOCAL_CPU); return false; } +extern const struct arm64_cpu_capabilities arm64_errata[]; + +bool this_cpu_has_cap(unsigned int cap) +{ + return (__this_cpu_has_cap(arm64_features, cap) || + __this_cpu_has_cap(arm64_errata, cap)); +} + void __init setup_cpu_features(void) { u32 cwg; |