mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Greg Ungerer <gerg@linux-m68k.org>,
	linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] arch: m68k: Add DMA mapping operations for Coldfire M5441x
Date: Wed, 29 Jan 2025 08:32:52 +0100	[thread overview]
Message-ID: <44398a86-cf85-4c7b-85f1-de9beedc72fc@yoseli.org> (raw)
In-Reply-To: <Z5h9ZySKFwHRjg0O@infradead.org>

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

  reply	other threads:[~2025-01-29  7:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-21 10:54 [PATCH 0/2] m68k: Add basic support for DMA global coherent pool Jean-Michel Hautbois
2025-01-21 10:54 ` [PATCH 1/2] m68k: Enable DMA support for Coldfire M5441x Jean-Michel Hautbois
2025-01-21 10:54 ` [PATCH 2/2] arch: m68k: Add DMA mapping operations " Jean-Michel Hautbois
2025-01-28  6:10   ` Christoph Hellwig
2025-01-28  6:33     ` Jean-Michel Hautbois
2025-01-28  6:40       ` Christoph Hellwig
2025-01-28  6:43         ` Jean-Michel Hautbois
2025-01-28  6:47           ` Christoph Hellwig
2025-01-29  7:32             ` Jean-Michel Hautbois [this message]
2026-09-04 20:26               ` Angelo Dureghello

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44398a86-cf85-4c7b-85f1-de9beedc72fc@yoseli.org \
    --to=jeanmichel.hautbois@yoseli.org \
    --cc=geert@linux-m68k.org \
    --cc=gerg@linux-m68k.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®