arm64: capabilities: Merge duplicate entries for Qualcomm erratum 1003
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Fri, 30 Nov 2018 17:18:02 +0000 (17:18 +0000)
committerWill Deacon <will.deacon@arm.com>
Thu, 6 Dec 2018 11:47:44 +0000 (11:47 +0000)
Remove duplicate entries for Qualcomm erratum 1003. Since the entries
are not purely based on generic MIDR checks, use the multi_cap_entry
type to merge the entries.

Cc: Christopher Covington <cov@codeaurora.org>
Cc: Will Deacon <will.deacon@arm.com>
Reviewed-by: Vladimir Murzin <vladimir.murzin@arm.com>
Tested-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/cpu_errata.c

index 51f70f60fe3b600d6cd955ee7c37855eef3dbd35..bb44635026f8b7ef8cfb005d66360cf216738697 100644 (file)
@@ -592,6 +592,19 @@ static const struct midr_range cavium_erratum_30115_cpus[] = {
 };
 #endif
 
+#ifdef CONFIG_QCOM_FALKOR_ERRATUM_1003
+static const struct arm64_cpu_capabilities qcom_erratum_1003_list[] = {
+       {
+               ERRATA_MIDR_REV(MIDR_QCOM_FALKOR_V1, 0, 0),
+       },
+       {
+               .midr_range.model = MIDR_QCOM_KRYO,
+               .matches = is_kryo_midr,
+       },
+       {},
+};
+#endif
+
 #ifdef CONFIG_ARM64_WORKAROUND_CLEAN_CACHE
 static const struct midr_range workaround_clean_cache[] = {
 #if    defined(CONFIG_ARM64_ERRATUM_826319) || \
@@ -685,16 +698,10 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
        },
 #ifdef CONFIG_QCOM_FALKOR_ERRATUM_1003
        {
-               .desc = "Qualcomm Technologies Falkor erratum 1003",
+               .desc = "Qualcomm Technologies Falkor/Kryo erratum 1003",
                .capability = ARM64_WORKAROUND_QCOM_FALKOR_E1003,
-               ERRATA_MIDR_REV(MIDR_QCOM_FALKOR_V1, 0, 0),
-       },
-       {
-               .desc = "Qualcomm Technologies Kryo erratum 1003",
-               .capability = ARM64_WORKAROUND_QCOM_FALKOR_E1003,
-               .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
-               .midr_range.model = MIDR_QCOM_KRYO,
-               .matches = is_kryo_midr,
+               .matches = multi_entry_cap_matches,
+               .match_list = qcom_erratum_1003_list,
        },
 #endif
 #ifdef CONFIG_QCOM_FALKOR_ERRATUM_1009