[PATCH] ARM: mvebu: select OF_DMA_DEFAULT_COHERENT if MACH_MVEBU_V7

Arnd Bergmann arnd at kernel.org
Tue Oct 4 01:30:49 PDT 2022


On Tue, Oct 4, 2022, at 10:17 AM, Marek Behún wrote:
> 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
> 

This is clearly still broken, because doing this would mark all
devices on all arm32 platforms as coherent whenever MACH_MVEBU_V7
is enabled.

     Arnd



More information about the linux-arm-kernel mailing list