summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Gaignard <benjamin.gaignard@linaro.org>2019-05-21 05:17:39 -0400
committerRussell King <rmk+kernel@armlinux.org.uk>2019-06-21 04:06:06 -0400
commit779eb41ccb2e8cc91b63ad5172dfaadcf663f1fa (patch)
tree92ea74f3a895ea73546c2bd85e7b5009840c7e55
parente6c4375f7c9293ffa65469d16f8ebd2586cb03f2 (diff)
ARM: 8862/1: errata: 814220-B-Cache maintenance by set/way operations can execute out of order
The v7 ARM states that all cache and branch predictor maintenance operations that do not specify an address execute, relative to each other, in program order. However, because of this erratum, an L2 set/way cache maintenance operation can overtake an L1 set/way cache maintenance operation, this would cause the data corruption. This ERRATA affected the Cortex-A7 and present in r0p2, r0p3, r0p4, r0p5. This patch is the SW workaround by adding a DSB before changing cache levels as the ARM ERRATA: ARM/MP: 814220 told in the ARM ERRATA documentation. Signed-off-by: Jason Liu <r64343@freescale.com> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r--arch/arm/Kconfig12
-rw-r--r--arch/arm/mm/cache-v7.S3
2 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 96377e3cd3d8..c87cc9a6fb3c 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1250,6 +1250,18 @@ config PCI_HOST_ITE8152
1250 default y 1250 default y
1251 select DMABOUNCE 1251 select DMABOUNCE
1252 1252
1253config ARM_ERRATA_814220
1254 bool "ARM errata: Cache maintenance by set/way operations can execute out of order"
1255 depends on CPU_V7
1256 help
1257 The v7 ARM states that all cache and branch predictor maintenance
1258 operations that do not specify an address execute, relative to
1259 each other, in program order.
1260 However, because of this erratum, an L2 set/way cache maintenance
1261 operation can overtake an L1 set/way cache maintenance operation.
1262 This ERRATA only affected the Cortex-A7 and present in r0p2, r0p3,
1263 r0p4, r0p5.
1264
1253endmenu 1265endmenu
1254 1266
1255menu "Kernel Features" 1267menu "Kernel Features"
diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S
index db3986708c8a..ea05d6fd53a1 100644
--- a/arch/arm/mm/cache-v7.S
+++ b/arch/arm/mm/cache-v7.S
@@ -171,6 +171,9 @@ loop2:
171skip: 171skip:
172 add r10, r10, #2 @ increment cache number 172 add r10, r10, #2 @ increment cache number
173 cmp r3, r10 173 cmp r3, r10
174#ifdef CONFIG_ARM_ERRATA_814220
175 dsb
176#endif
174 bgt flush_levels 177 bgt flush_levels
175finished: 178finished:
176 mov r10, #0 @ switch back to cache level 0 179 mov r10, #0 @ switch back to cache level 0