Skip to content

Commit 9bd405c

Browse files
prabhakarladConchuOD
authored andcommitted
cache: ax45mp_cache: Align end size to cache boundary in ax45mp_dma_cache_wback()
Align the end size to cache boundary size in ax45mp_dma_cache_wback() callback likewise done in ax45mp_dma_cache_inv() callback. Additionally return early in case of start == end. Fixes: d34599b ("cache: Add L2 cache management for Andes AX45MP RISC-V core") Reported-by: Pavel Machek <[email protected]> Link: https://lore.kernel.org/cip-dev/[email protected]/ Signed-off-by: Lad Prabhakar <[email protected]> Signed-off-by: Conor Dooley <[email protected]>
1 parent 6613476 commit 9bd405c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/cache/ax45mp_cache.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,12 @@ static void ax45mp_dma_cache_wback(phys_addr_t paddr, size_t size)
129129
unsigned long line_size;
130130
unsigned long flags;
131131

132+
if (unlikely(start == end))
133+
return;
134+
132135
line_size = ax45mp_priv.ax45mp_cache_line_size;
133136
start = start & (~(line_size - 1));
137+
end = ((end + line_size - 1) & (~(line_size - 1)));
134138
local_irq_save(flags);
135139
ax45mp_cpu_dcache_wb_range(start, end);
136140
local_irq_restore(flags);

0 commit comments

Comments
 (0)