[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230222133712.8079-3-jiaxun.yang@flygoat.com>
Date: Wed, 22 Feb 2023 13:37:11 +0000
From: Jiaxun Yang <jiaxun.yang@...goat.com>
To: linux-mips@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
tsbogend@...ha.franken.de, mpe@...erman.id.au,
paul.walmsley@...ive.com, palmer@...belt.com, robh+dt@...nel.org,
hch@....de, m.szyprowski@...sung.com, robin.murphy@....com,
linux-riscv@...ts.infradead.org,
Jiaxun Yang <jiaxun.yang@...goat.com>
Subject: [PATCH 2/3] riscv: Set dma_default_coherent to true
For riscv our assumption is unless a device states it is non-coherent,
we take it to be DMA coherent.
For devicetree probed devices that have been true since very begining
with OF_DMA_DEFAULT_COHERENT selected.
Signed-off-by: Jiaxun Yang <jiaxun.yang@...goat.com>
---
arch/riscv/kernel/setup.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index 376d2827e736..34b371180976 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -300,6 +300,9 @@ void __init setup_arch(char **cmdline_p)
riscv_init_cbom_blocksize();
riscv_fill_hwcap();
apply_boot_alternatives();
+#ifdef CONFIG_RISCV_DMA_NONCOHERENT
+ dma_default_coherent = true;
+#endif
if (IS_ENABLED(CONFIG_RISCV_ISA_ZICBOM) &&
riscv_isa_extension_available(NULL, ZICBOM))
riscv_noncoherent_supported();
--
2.37.1 (Apple Git-137.1)
Powered by blists - more mailing lists