[PATCH] ARM: mvebu: select OF_DMA_DEFAULT_COHERENT if MACH_MVEBU_V7

Marek Behún kabel at kernel.org
Tue Oct 4 01:17:23 PDT 2022


Commit ae626eb97376 ("ARM/dma-mapping: use dma-direct unconditionally")
caused a regression on the mvebu platform, wherein devices that are
dma-coherent are marked as dma-noncoherent, because although
mvebu_hwcc_notifier() after that commit still marks then as coherent,
the arm_coherent_dma_ops() function, which is called later, overwrites
this setting, since it is being called from drivers/of/device.c with
coherency parameter determined by of_dma_is_coherent(), and the
device-trees do not declare the 'dma-coherent' property.

Fix this by defaulting to dma-coherent for this platform in the
of_dma_is_coherent() function, if neither dma-coherent nor
dma-noncoherent is declared.

Fixes: ae626eb97376 ("ARM/dma-mapping: use dma-direct unconditionally")
Link: https://lore.kernel.org/linux-arm-kernel/20220930151028.0e518421@dellmb/
Signed-off-by: Marek Behún <kabel at kernel.org>
---
 arch/arm/mach-mvebu/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
index 9f60a6fe0eaf..846a5c6e1a5e 100644
--- a/arch/arm/mach-mvebu/Kconfig
+++ b/arch/arm/mach-mvebu/Kconfig
@@ -23,6 +23,7 @@ config MACH_MVEBU_V7
 	select ARM_CPU_SUSPEND
 	select MACH_MVEBU_ANY
 	select MVEBU_CLK_COREDIV
+	select OF_DMA_DEFAULT_COHERENT
 
 config MACH_ARMADA_370
 	bool "Marvell Armada 370 boards"
-- 
2.35.1




More information about the linux-arm-kernel mailing list