linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cache: ax45mp_cache: Align end size to cache boundary in ax45mp_dma_cache_wback()
@ 2024-02-03 21:26 Prabhakar
  2024-03-25  4:42 ` patchwork-bot+linux-riscv
  0 siblings, 1 reply; 2+ messages in thread
From: Prabhakar @ 2024-02-03 21:26 UTC (permalink / raw)
  To: Geert Uytterhoeven, Conor Dooley
  Cc: linux-riscv, linux-renesas-soc, linux-kernel, Prabhakar,
	Biju Das, Lad Prabhakar, Pavel Machek

From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

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: d34599bcd2e4 ("cache: Add L2 cache management for Andes AX45MP RISC-V core")
Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 drivers/cache/ax45mp_cache.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/cache/ax45mp_cache.c b/drivers/cache/ax45mp_cache.c
index 57186c58dc84..1d7dd3d2c101 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);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cache: ax45mp_cache: Align end size to cache boundary in ax45mp_dma_cache_wback()
  2024-02-03 21:26 [PATCH] cache: ax45mp_cache: Align end size to cache boundary in ax45mp_dma_cache_wback() Prabhakar
@ 2024-03-25  4:42 ` patchwork-bot+linux-riscv
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+linux-riscv @ 2024-03-25  4:42 UTC (permalink / raw)
  To: Prabhakar
  Cc: linux-riscv, geert+renesas, conor, linux-renesas-soc,
	linux-kernel, biju.das.jz, prabhakar.mahadev-lad.rj, pavel

Hello:

This patch was applied to riscv/linux.git (fixes)
by Conor Dooley <conor.dooley@microchip.com>:

On Sat,  3 Feb 2024 21:26:40 +0000 you wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> 
> 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.
> 
> [...]

Here is the summary with links:
  - cache: ax45mp_cache: Align end size to cache boundary in ax45mp_dma_cache_wback()
    https://git.kernel.org/riscv/c/9bd405c48b0a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-25  4:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-03 21:26 [PATCH] cache: ax45mp_cache: Align end size to cache boundary in ax45mp_dma_cache_wback() Prabhakar
2024-03-25  4:42 ` patchwork-bot+linux-riscv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).