Commit 00b58d2c authored by Anup Patel's avatar Anup Patel Committed by Greg Kroah-Hartman
Browse files

RISC-V: Define pgprot_dmacoherent() for non-coherent devices



[ Upstream commit ca525d53 ]

The pgprot_dmacoherent() is used when allocating memory for
non-coherent devices and by default pgprot_dmacoherent() is
same as pgprot_noncached() unless architecture overrides it.

Currently, there is no pgprot_dmacoherent() definition for
RISC-V hence non-coherent device memory is being mapped as
IO thereby making CPU access to such memory slow.

Define pgprot_dmacoherent() to be same as pgprot_writecombine()
for RISC-V so that CPU access non-coherent device memory as
NOCACHE which is better than accessing it as IO.

Fixes: ff689fd2 ("riscv: add RISC-V Svpbmt extension support")
Signed-off-by: default avatarAnup Patel <apatel@ventanamicro.com>
Tested-by: default avatarHan Gao <rabenda.cn@gmail.com>
Tested-by: default avatarGuo Ren (Alibaba DAMO Academy) <guoren@kernel.org>
Link: https://lore.kernel.org/r/20250820152316.1012757-1-apatel@ventanamicro.com


Signed-off-by: default avatarPaul Walmsley <pjw@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent c7849e8c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment