mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* move dma_ops to common code
@ 2022-06-16  7:53 Antony Pavlov
  2022-06-20 14:52 ` Ahmad Fatoum
  0 siblings, 1 reply; 2+ messages in thread
From: Antony Pavlov @ 2022-06-16  7:53 UTC (permalink / raw)
  To: Sascha Hauer, Ahmad Fatoum; +Cc: barebox

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?

-- 
Best regards,
  Antony Pavlov



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: move dma_ops to common code
  2022-06-16  7:53 move dma_ops to common code Antony Pavlov
@ 2022-06-20 14:52 ` Ahmad Fatoum
  0 siblings, 0 replies; 2+ messages in thread
From: Ahmad Fatoum @ 2022-06-20 14:52 UTC (permalink / raw)
  To: Antony Pavlov, Sascha Hauer; +Cc: barebox

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 |



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-20 14:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-16  7:53 move dma_ops to common code Antony Pavlov
2022-06-20 14:52 ` Ahmad Fatoum

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