aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2024-02-23 13:53:30 +0100
committerArnd Bergmann <arnd@arndb.de>2024-02-23 13:53:30 +0100
commitbcb323bd10a1b6e2a041f0730e094f522d18c709 (patch)
treef673163435b3b85405af96f5d08441c5c47fe442
parent704dccec0d490f2ad06f3f16ebed254d81906c3a (diff)
parent9bd405c48b0ac4de087c0c4440fd79597201b8a7 (diff)
downloadlinux-bcb323bd10a1b6e2a041f0730e094f522d18c709.tar.gz
Merge tag 'riscv-cache-fixes-for-v6.8-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux into arm/fixes
RISC-V Cache driver fixes for v6.8-rc6 A single fix for an inconsistency reported during CIP review by Pavel in the newly added ax45mp cache driver. Signed-off-by: Conor Dooley <conor.dooley@microchip.com> * tag 'riscv-cache-fixes-for-v6.8-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux: cache: ax45mp_cache: Align end size to cache boundary in ax45mp_dma_cache_wback() Link: https://lore.kernel.org/r/20240221-keenness-handheld-b930aaa77708@spud Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--drivers/cache/ax45mp_cache.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/cache/ax45mp_cache.c b/drivers/cache/ax45mp_cache.c
index 57186c58dc849..1d7dd3d2c101c 100644
--- a/drivers/cache/ax45mp_cache.c
+++ b/drivers/cache/ax45mp_cache.c
@@ -129,8 +129,12 @@ static void ax45mp_dma_cache_wback(phys_addr_t paddr, size_t size)
unsigned long line_size;
unsigned long flags;
+ if (unlikely(start == end))
+ return;
+
line_size = ax45mp_priv.ax45mp_cache_line_size;
start = start & (~(line_size - 1));
+ end = ((end + line_size - 1) & (~(line_size - 1)));
local_irq_save(flags);
ax45mp_cpu_dcache_wb_range(start, end);
local_irq_restore(flags);