mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Antony Pavlov <antonynpavlov@gmail.com>,
	Sascha Hauer <sha@pengutronix.de>
Cc: barebox <barebox@lists.infradead.org>
Subject: Re: move dma_ops to common code
Date: Mon, 20 Jun 2022 16:52:18 +0200	[thread overview]
Message-ID: <64676fdd-167f-b440-2642-f171c150b630@pengutronix.de> (raw)
In-Reply-To: <CAA4bVAE09vnuWLv3TvKDn3t7kAPdk1Tgto-TWzyo1-qoYpfO9A@mail.gmail.com>

Hello Antony,

On 16.06.22 09:53, Antony Pavlov wrote:
> Hi!
> 
> In 0e885ce81d0e ('RISC-V: dma: support multiple dma_alloc_coherent backends') ,
> (see https://lore.barebox.org/barebox/20210619045055.779-10-a.fatoum@pengutronix.de/)
> multiple dma_alloc_coherent backends was introduced for RISC-V.
> 
> At the moment MIPS dma_alloc_coherent stuff is messy and I want to rework it.
> I can reuse some parts of 0e885ce81d0e by moving it to the common code.
> Any comments or suggestions?
I have been meaning to clean this dma API stuff up, so I find it very nice
that you are going to do it :)

Currently, we have two ways to influence this:

  - dma_set_ops
  - define static inline helpers in <asm/dma.h> and #define macros, so the generic
    implementation isn't used
    (see https://lore.barebox.org/barebox/20220614091556.1018102-1-a.fatoum@pengutronix.de/T/#t)

As first step, one could clean up the repetition in the <asm/dma.h> files, e.g.
dma_alloc_coherent is nearly identical in a couple of places. Then as next step
we could have (just example names)

  CONFIG_DMA_UNCACHED

     The current !PBL and/or !MMU case

  CONFIG_DMA_PER_ARCH

     For those not using dma_set_ops

  CONFIG_DMA_DYNAMIC_OPS

     For those using dma_set_ops

This should allows us to get rid of the macros and then each arch could just
select the appropriate symbol.

What do you think?

Cheers,
Ahmad

> 


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



      reply	other threads:[~2022-06-20 14:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-16  7:53 Antony Pavlov
2022-06-20 14:52 ` Ahmad Fatoum [this message]

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=64676fdd-167f-b440-2642-f171c150b630@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=sha@pengutronix.de \
    --subject='Re: move dma_ops to common code' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox