[PATCH] ARM: mvebu: select OF_DMA_DEFAULT_COHERENT if MACH_MVEBU_V7

Russell King (Oracle) linux at armlinux.org.uk
Tue Oct 4 02:22:06 PDT 2022


On Tue, Oct 04, 2022 at 11:14:55AM +0200, Thorsten Leemhuis wrote:
> On 04.10.22 10:17, 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/
> 
> Thx for taking care of this. One quick note: You might want to add a
> "Cc: stable at ..." on the patch to ensure it's backported in a timely manner:
> https://lore.kernel.org/lkml/YwZmu1ZTbjVqIY%2FC@kroah.com/

Sadly, this isn't a valid fix for the problem - as Christoph points
out, mvebu is part of a multiplatform kernel, and selecting options
that harm other platforms on a multiplatform kernel can't be allowed
even if it fixes a regression. It will cause a regression for other
platforms.

So, this needs fixing a different way, and there are other discussions
concerning an alternative approach.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!



More information about the linux-arm-kernel mailing list