Re: [PATCH 0/7] DMAENGINE: fixes and PrimeCells

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: jassi brar
Date: Sunday, May 9, 2010 - 3:06 am

On Sun, May 9, 2010 at 4:47 PM, Dan Williams <dan.j.williams@intel.com> wrote:
We must plan for SoCs that have same peripheral IPs but different
DMACs. In that case, we have one client driver and two DMAC drivers
behind the same DMA API. So, if the DMA API doesn't fix such
assumptions, we can't have the driver to work for both SoCs.

Again, the client shouldn't need to know about the backend DMAC driver.
If some client can't stand 'async' ops, there should be some way for it to
ask DMA API and know.
IMHO, DMA API should see async_tx as a special 'relaxed' case. Adding
new flags to differentiate only complicate the client drivers.

Again, please look at the "Same client driver for different SoCs with
different DMACs" situation. DMA API needs to take a stand.

panic'ing is extreme reaction, esp when DMA API doesn't provide any
guarantee of time-bound operations - the client or API could simply
retry after taking appropriate action.

In S3C DMA API driver for PL330 DMAC, I add all unique channels and
DMACs to system wide channel and DMAC pool. DMACs have
a capability mask to help find which channels can be reached vai that DMAC.
That way it becomes possible to do runtime mapping of channels on
DMACs.
About current DMA API? I don't know any easy way. But is sure possible
to implement a generic API to do that.

Sometimes there is limit on the number of concurrrent channels that
the DMAC can handle. For ex, PL330 can have only 8 h/w threads but
32 possible peripherals/channels, allowing only max. 8 channels to be active
at any time. In such situations, the DMAC may refuse channel allocation
until some other client releases a channel thereby freeing up a h/w thread.

That sounds like assuming memset to be writing a value multiple times.

Most DMACs come with optional SRC/DST increment bit to control the
copy operation. That makes memset nicely blend with memcpy requests.

Memset might not have source address, but for most DMACs the driver
would have to allocate 4 dma coherent bytes(if memset unit is int) and
treat it most likely as memcpy request with src_inc := 0 and dst_inc := 1
For DMACs that does support direct memset operation, there wud be a
limit on size of the pattern, making them 'lesser' flexible than those without
direct memset support.

So, IMHO, memset is better seen as writing a data pattern multiple times rather
than writing a value multiple times.
Because with clients and over time, the unit size may vary.
Lets not put limit on unit size for memset operation.
What if i want to set 1800 bytes of memory with a pattern of 9bytes?
200 memcpy requests OR allocate 9 dma coherent bytes and do 1 memset?

Yes, but if a request is defined as a 'SG list of memset ops', we pay
no extra price for having capability for Mem to Mem SG. And one
doesn't need to look at the potential users for the API.
All DMAC drivers would have had just one 'prepare' rather than three.

I admit I have little idea about Dev->Dev implementation, but the other two
should be possible to implement in a generic way.
This discussion is purely about what the current DMA API misses and what
a generic DMA API should do. So, that the current DMA API fills up those
gap, if possible. I would love to get started implementing the generic
DMA API for reference but my priorities are decided by my employer.

This is unlikely to hold for long. SoCs are more and more becoming a
cocktail of off-the-shelf third party device IPs, where the device IPs may
be same but different DMAC IP.

Regards.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/7] DMAENGINE: fixes and PrimeCells, Linus Walleij, (Sun May 2, 5:54 pm)
Re: [PATCH 0/7] DMAENGINE: fixes and PrimeCells, Linus Walleij, (Fri May 7, 2:13 am)
Re: [PATCH 0/7] DMAENGINE: fixes and PrimeCells, Russell King - ARM Linux, (Fri May 7, 2:32 am)
Re: [PATCH 0/7] DMAENGINE: fixes and PrimeCells, Linus Walleij, (Fri May 7, 4:43 am)
Re: [PATCH 0/7] DMAENGINE: fixes and PrimeCells, jassi brar, (Fri May 7, 5:31 am)
Re: [PATCH 0/7] DMAENGINE: fixes and PrimeCells, Linus Walleij, (Fri May 7, 9:10 am)
Re: [PATCH 0/7] DMAENGINE: fixes and PrimeCells, Dan Williams, (Fri May 7, 4:54 pm)
Re: [PATCH 0/7] DMAENGINE: fixes and PrimeCells, jassi brar, (Fri May 7, 7:37 pm)
Re: [PATCH 0/7] DMAENGINE: fixes and PrimeCells, Dan Williams, (Sat May 8, 3:24 pm)
Re: [PATCH 0/7] DMAENGINE: fixes and PrimeCells, jassi brar, (Sat May 8, 8:48 pm)
Re: [PATCH 0/7] DMAENGINE: fixes and PrimeCells, Dan Williams, (Sun May 9, 12:47 am)
Re: [PATCH 0/7] DMAENGINE: fixes and PrimeCells, jassi brar, (Sun May 9, 3:06 am)
Re: [PATCH 0/7] DMAENGINE: fixes and PrimeCells, Dan Williams, (Sun May 9, 10:26 am)
Re: [PATCH 0/7] DMAENGINE: fixes and PrimeCells, jassi brar, (Sun May 9, 3:51 pm)