arm64: errata: Calling enable functions for CPU errata too
authorAndre Przywara <andre.przywara@arm.com>
Tue, 28 Jun 2016 17:07:30 +0000 (18:07 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 1 Jul 2016 10:30:28 +0000 (11:30 +0100)
Currently we call the (optional) enable function for CPU _features_
only. As CPU _errata_ descriptions share the same data structure and
having an enable function is useful for errata as well (for instance
to set bits in SCTLR), lets call it when enumerating erratas too.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/cpufeature.h
arch/arm64/kernel/cpu_errata.c
arch/arm64/kernel/cpufeature.c

index 224efe730e4614b4ffd6ab105bacf3de6d6890db..49dd1bd3ea50fe253e95fe6bc0d64d9430687b20 100644 (file)
@@ -191,7 +191,9 @@ void __init setup_cpu_features(void);
 
 void update_cpu_capabilities(const struct arm64_cpu_capabilities *caps,
                            const char *info);
+void enable_cpu_capabilities(const struct arm64_cpu_capabilities *caps);
 void check_local_cpu_errata(void);
+void __init enable_errata_workarounds(void);
 
 void verify_local_cpu_errata(void);
 void verify_local_cpu_capabilities(void);
index d42789499f17eb322a47da83046ca0119e643c75..c2261a7a316efe17010e6eddcbe51eadb56dd10c 100644 (file)
@@ -127,3 +127,8 @@ void check_local_cpu_errata(void)
 {
        update_cpu_capabilities(arm64_errata, "enabling workaround for");
 }
+
+void __init enable_errata_workarounds(void)
+{
+       enable_cpu_capabilities(arm64_errata);
+}
index 811773d1c1d015ca8e47239f5375d3ced3c04b48..916d27ad79c1d2752023b489618615ac360b45c4 100644 (file)
@@ -913,8 +913,7 @@ void update_cpu_capabilities(const struct arm64_cpu_capabilities *caps,
  * Run through the enabled capabilities and enable() it on all active
  * CPUs
  */
-static void __init
-enable_cpu_capabilities(const struct arm64_cpu_capabilities *caps)
+void __init enable_cpu_capabilities(const struct arm64_cpu_capabilities *caps)
 {
        for (; caps->matches; caps++)
                if (caps->enable && cpus_have_cap(caps->capability))
@@ -1036,6 +1035,7 @@ void __init setup_cpu_features(void)
 
        /* Set the CPU feature capabilies */
        setup_feature_capabilities();
+       enable_errata_workarounds();
        setup_elf_hwcaps(arm64_elf_hwcaps);
 
        if (system_supports_32bit_el0())