diff options
author | Gregory CLEMENT <gregory.clement@free-electrons.com> | 2013-01-07 05:27:14 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-01-07 10:04:17 -0500 |
commit | 8b827c60a1d984ef8c3ed175c99a33dd451348ff (patch) | |
tree | 59aac11c91a9452a3985a261f4994cf4567a3f6e | |
parent | d106de38ca927f2a53cd56ef94c506e8f6bd37e1 (diff) |
ARM: 7615/1: cache-l2x0: aurora: Invalidate during clean operation with WT enable
This patch fixes a bug for Aurora L2 cache controller when the
write-through mode is enable. For the clean operation even if we don't
have to flush the lines we still need to invalidate them.
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mm/cache-l2x0.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 05d577613b13..55ca637a4930 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c | |||
@@ -506,15 +506,21 @@ static void aurora_clean_range(unsigned long start, unsigned long end) | |||
506 | 506 | ||
507 | static void aurora_flush_range(unsigned long start, unsigned long end) | 507 | static void aurora_flush_range(unsigned long start, unsigned long end) |
508 | { | 508 | { |
509 | if (!l2_wt_override) { | 509 | start &= ~(CACHE_LINE_SIZE - 1); |
510 | start &= ~(CACHE_LINE_SIZE - 1); | 510 | end = ALIGN(end, CACHE_LINE_SIZE); |
511 | end = ALIGN(end, CACHE_LINE_SIZE); | 511 | while (start != end) { |
512 | while (start != end) { | 512 | unsigned long range_end = calc_range_end(start, end); |
513 | unsigned long range_end = calc_range_end(start, end); | 513 | /* |
514 | * If L2 is forced to WT, the L2 will always be clean and we | ||
515 | * just need to invalidate. | ||
516 | */ | ||
517 | if (l2_wt_override) | ||
514 | aurora_pa_range(start, range_end - CACHE_LINE_SIZE, | 518 | aurora_pa_range(start, range_end - CACHE_LINE_SIZE, |
515 | AURORA_FLUSH_RANGE_REG); | 519 | AURORA_INVAL_RANGE_REG); |
516 | start = range_end; | 520 | else |
517 | } | 521 | aurora_pa_range(start, range_end - CACHE_LINE_SIZE, |
522 | AURORA_FLUSH_RANGE_REG); | ||
523 | start = range_end; | ||
518 | } | 524 | } |
519 | } | 525 | } |
520 | 526 | ||