[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <44398a86-cf85-4c7b-85f1-de9beedc72fc@yoseli.org>
Date: Wed, 29 Jan 2025 08:32:52 +0100
From: Jean-Michel Hautbois <jeanmichel.hautbois@...eli.org>
To: Christoph Hellwig <hch@...radead.org>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>,
Greg Ungerer <gerg@...ux-m68k.org>, linux-m68k@...ts.linux-m68k.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] arch: m68k: Add DMA mapping operations for Coldfire
M5441x
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
Powered by blists - more mailing lists