Commit 72bc2b1a authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Russell King

[ARM] 5329/1: Feroceon: fix feroceon_l2_inv_range

Same fix as commit c7cf72dc: when 'start' and 'end' are less than a
cacheline apart and 'start' is unaligned we are done after cleaning and
invalidating the first cacheline.

Cc: <stable@kernel.org>
Signed-off-by: default avatarNicolas Pitre <nico@marvell.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 4bab0ea1
...@@ -150,7 +150,7 @@ static void feroceon_l2_inv_range(unsigned long start, unsigned long end) ...@@ -150,7 +150,7 @@ static void feroceon_l2_inv_range(unsigned long start, unsigned long end)
/* /*
* Clean and invalidate partial last cache line. * Clean and invalidate partial last cache line.
*/ */
if (end & (CACHE_LINE_SIZE - 1)) { if (start < end && end & (CACHE_LINE_SIZE - 1)) {
l2_clean_inv_pa(end & ~(CACHE_LINE_SIZE - 1)); l2_clean_inv_pa(end & ~(CACHE_LINE_SIZE - 1));
end &= ~(CACHE_LINE_SIZE - 1); end &= ~(CACHE_LINE_SIZE - 1);
} }
...@@ -158,7 +158,7 @@ static void feroceon_l2_inv_range(unsigned long start, unsigned long end) ...@@ -158,7 +158,7 @@ static void feroceon_l2_inv_range(unsigned long start, unsigned long end)
/* /*
* Invalidate all full cache lines between 'start' and 'end'. * Invalidate all full cache lines between 'start' and 'end'.
*/ */
while (start != end) { while (start < end) {
unsigned long range_end = calc_range_end(start, end); unsigned long range_end = calc_range_end(start, end);
l2_inv_pa_range(start, range_end - CACHE_LINE_SIZE); l2_inv_pa_range(start, range_end - CACHE_LINE_SIZE);
start = range_end; start = range_end;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment