diff options
author | Will Deacon <will.deacon@arm.com> | 2012-04-20 12:21:08 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-04-23 09:21:52 -0400 |
commit | f154fe9b806574437b47f08e924ad10c0e240b23 (patch) | |
tree | 6e681fc5cb9c6ba7fb029b5d50f11b1b53eb4ef6 /arch | |
parent | f0c4b8d653f5ee091fb8d4d02ed7eaad397491bb (diff) |
ARM: 7397/1: l2x0: only apply workaround for erratum #753970 on PL310
The workaround for PL310 erratum #753970 can lead to deadlock on systems
with an L220 cache controller.
This patch makes the workaround effective only when the cache controller
is identified as a PL310 at probe time.
Cc: stable@vger.kernel.org
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mm/cache-l2x0.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index a53fd2aaa2f4..a8d02c048a1f 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c | |||
@@ -32,6 +32,7 @@ static void __iomem *l2x0_base; | |||
32 | static DEFINE_RAW_SPINLOCK(l2x0_lock); | 32 | static DEFINE_RAW_SPINLOCK(l2x0_lock); |
33 | static u32 l2x0_way_mask; /* Bitmask of active ways */ | 33 | static u32 l2x0_way_mask; /* Bitmask of active ways */ |
34 | static u32 l2x0_size; | 34 | static u32 l2x0_size; |
35 | static unsigned long sync_reg_offset = L2X0_CACHE_SYNC; | ||
35 | 36 | ||
36 | struct l2x0_regs l2x0_saved_regs; | 37 | struct l2x0_regs l2x0_saved_regs; |
37 | 38 | ||
@@ -61,12 +62,7 @@ static inline void cache_sync(void) | |||
61 | { | 62 | { |
62 | void __iomem *base = l2x0_base; | 63 | void __iomem *base = l2x0_base; |
63 | 64 | ||
64 | #ifdef CONFIG_PL310_ERRATA_753970 | 65 | writel_relaxed(0, base + sync_reg_offset); |
65 | /* write to an unmmapped register */ | ||
66 | writel_relaxed(0, base + L2X0_DUMMY_REG); | ||
67 | #else | ||
68 | writel_relaxed(0, base + L2X0_CACHE_SYNC); | ||
69 | #endif | ||
70 | cache_wait(base + L2X0_CACHE_SYNC, 1); | 66 | cache_wait(base + L2X0_CACHE_SYNC, 1); |
71 | } | 67 | } |
72 | 68 | ||
@@ -331,6 +327,10 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask) | |||
331 | else | 327 | else |
332 | ways = 8; | 328 | ways = 8; |
333 | type = "L310"; | 329 | type = "L310"; |
330 | #ifdef CONFIG_PL310_ERRATA_753970 | ||
331 | /* Unmapped register. */ | ||
332 | sync_reg_offset = L2X0_DUMMY_REG; | ||
333 | #endif | ||
334 | break; | 334 | break; |
335 | case L2X0_CACHE_ID_PART_L210: | 335 | case L2X0_CACHE_ID_PART_L210: |
336 | ways = (aux >> 13) & 0xf; | 336 | ways = (aux >> 13) & 0xf; |