summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtish Patra <atish.patra@wdc.com>2021-06-13 02:52:26 +0300
committerEmil Renner Berthing <kernel@esmil.dk>2021-08-30 01:20:05 +0300
commit8b6ac6e73ae902122d44596182f1da931cac2f5a (patch)
tree5c60b944b2633ab12594ac922e89669e9985b466
parent793cfc9bfc4a8f1de8e7a09ee3877ab3703e86d3 (diff)
downloadlinux-8b6ac6e73ae902122d44596182f1da931cac2f5a.tar.xz
sifive/sifive_l2_cache: Align the address to cache line
[Emil: fix suggested by Geert Uytterhoeven <geert@linux-m68k.org>] Signed-off-by: Atish Patra <atish.patra@wdc.com> Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
-rw-r--r--drivers/soc/sifive/sifive_l2_cache.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/soc/sifive/sifive_l2_cache.c b/drivers/soc/sifive/sifive_l2_cache.c
index 626b664547e5..fb39be6c730a 100644
--- a/drivers/soc/sifive/sifive_l2_cache.c
+++ b/drivers/soc/sifive/sifive_l2_cache.c
@@ -139,6 +139,9 @@ void sifive_l2_flush64_range(unsigned long start, unsigned long len)
return;
}
+ len = len + (start % SIFIVE_L2_FLUSH64_LINE_LEN);
+ start = ALIGN_DOWN(start, SIFIVE_L2_FLUSH64_LINE_LEN);
+
/* make sure the address is in the range */
if(start < CONFIG_SIFIVE_L2_FLUSH_START ||
(start + len) > (CONFIG_SIFIVE_L2_FLUSH_START +