]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - arch/arm64/kernel/cpu_errata.c
arm64: cpu_errata: Add Kryo to Falkor 1003 errata
[mirror_ubuntu-artful-kernel.git] / arch / arm64 / kernel / cpu_errata.c
index 0e27f86ee70976b82cce63ce0b475eb94c2c606b..e4c78630a730cdac00f2f6abb39025e9fbac0a05 100644 (file)
@@ -30,6 +30,20 @@ is_affected_midr_range(const struct arm64_cpu_capabilities *entry, int scope)
                                       entry->midr_range_max);
 }
 
+static bool __maybe_unused
+is_kryo_midr(const struct arm64_cpu_capabilities *entry, int scope)
+{
+       u32 model;
+
+       WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible());
+
+       model = read_cpuid_id();
+       model &= MIDR_IMPLEMENTOR_MASK | (0xf00 << MIDR_PARTNUM_SHIFT) |
+                MIDR_ARCHITECTURE_MASK;
+
+       return model == entry->midr_model;
+}
+
 static bool
 has_mismatched_cache_line_size(const struct arm64_cpu_capabilities *entry,
                                int scope)
@@ -169,6 +183,13 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
                           MIDR_CPU_VAR_REV(0, 0),
                           MIDR_CPU_VAR_REV(0, 0)),
        },
+       {
+               .desc = "Qualcomm Technologies Kryo erratum 1003",
+               .capability = ARM64_WORKAROUND_QCOM_FALKOR_E1003,
+               .def_scope = SCOPE_LOCAL_CPU,
+               .midr_model = MIDR_QCOM_KRYO,
+               .matches = is_kryo_midr,
+       },
 #endif
 #ifdef CONFIG_QCOM_FALKOR_ERRATUM_1009
        {