Re: [PATCH 2/2] arch: m68k: Add DMA mapping operations for Coldfire M5441x
From: Angelo Dureghello
Date: Fri Sep 04 2026 - 16:26:56 EST
Hi Jean-Muchel and all,
just asking if this job is in progress, since i have the same
dspi issue open, and need dma eventually for other drivers.
I can eventually help on this, i have hardware for testing.
On Wed, Jan 29, 2025 at 08:32:52AM +0100, Jean-Michel Hautbois wrote:
> Hi Christoph,
>
> On 28/01/2025 07:47, Christoph Hellwig wrote:
> > On Tue, Jan 28, 2025 at 07:43:23AM +0100, Jean-Michel Hautbois wrote:
> > > > It really should not be hard. The dynamic mappings already work fine
> > > > as m68k is using the generic code. So the only thing you want is
> > > > to dip into the glonal pool for coherent allocations. For that you
> > > > need to select the DMA_GLOBAL_POOL config option and fill the pool
> > > > with dma_init_global_coherent().
> > > >
> > >
> > > Isn't it done in patch 1/2 ? Or did I miss something ?
> >
> > The point is that this is all you need. No need for new dma ops.
> >
>
> Indeed, I tested it and it works fine.
> I have removed the test in fec_main to be certain, but I think it would be
> better to change the COLDFIRE_COHERENT_DMA conditional ?
> What sounds like the most efficient way ?
> I can' do:
>
> - #if defined(CONFIG_COLDFIRE) && !defined(CONFIG_COLDFIRE_COHERENT_DMA)
> + #if defined(CONFIG_COLDFIRE) && !defined(CONFIG_COLDFIRE_COHERENT_DMA) &&
> !defined(CONFIG_DMA_GLOBAL_POOL)
>
> I suppose it would be better to modify it in the Kconfig, but I can't find a
> nice way to do it without having a circular dependency:
> arch/m68k/Kconfig.cpu
> @@ -555,6 +555,7 @@ config COLDFIRE_COHERENT_DMA
> default y
> depends on COLDFIRE
> depends on !HAVE_CACHE_CB && !CACHE_D && !CACHE_BOTH
> + depends on DMA_GLOBAL_POOL
>
> =>
> error: recursive dependency detected!
> symbol DMA_DIRECT_REMAP is selected by M68K_NONCOHERENT_DMA
> symbol M68K_NONCOHERENT_DMA depends on COLDFIRE_COHERENT_DMA
> symbol COLDFIRE_COHERENT_DMA depends on DMA_GLOBAL_POOL
> symbol DMA_GLOBAL_POOL depends on DMA_DIRECT_REMAP
>
>
> I will send a v2 with the global pool.
>
> Thanks !
> JM
>
>
Regards,
angelo
>