lkml.org 
[lkml]   [2008]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC v2 0/5] dmaengine: Slave DMA interface and example users
On Wed, 30 Jan 2008 10:39:47 -0700
"Dan Williams" <dan.j.williams@intel.com> wrote:

> Agreed, the issue is how to do this without requiring an
> interrupt+callback sequence for each transaction or requiring the
> client to carry per transaction unmap-data. For example NET_DMA never
> sees a dma_addr_t and assumes that all it needs to care about is the
> last transaction in a sequence. Since it is alive for the duration of
> a transaction, we could put unmap data in dma_async_tx_descriptor
> along with an unmap function pointer since dma_unmap* routines have an
> equal number of parameters. But I just got through making this
> structure smaller so maybe there is a better way.

I have to say I'm not crazy about the idea of adding more callbacks to
the descriptor...

The client must somehow know when the transfer is complete -- after
all, it has to call async_tx_ack() at some point. So additional
callbacks shouldn't be needed.

How about adding more variants of the "ack" function -- one for each
kind of transfer? For example, after an async_memcpy() transaction is
complete, the client must call async_memcpy_ack(), which could be an
inline function containing something along the lines of

static inline void async_memcpy_ack(struct dma_async_tx_descriptor *tx)
{
struct dma_device *dma = tx->chan->device;

dma_unmap_page(dma->dev, tx->src_phys, tx->len, DMA_TO_DEVICE);
dma_unmap_page(dma->dev, tx->dst_phys, tx->len, DMA_FROM_DEVICE);
async_tx_ack(tx);
}

which would evaluate to just async_tx_ack(tx) in most cases, since
dma_unmap_page() usually doesn't actually do anything.

This requires three additional fields in the dma_async_tx_descriptor
structure, but in many cases the driver needs these fields in its own
private descriptor wrapper anyway.

Haavard


\
 
 \ /
  Last update: 2008-02-04 16:35    [W:0.111 / U:0.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site