LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Haavard Skinnemoen <hskinnemoen@atmel.com>
To: "Dan Williams" <dan.j.williams@intel.com>
Cc: "David Brownell" <david-b@pacbell.net>,
	linux-kernel@vger.kernel.org,
	"Shannon Nelson" <shannon.nelson@intel.com>,
	kernel@avr32linux.org, "Francis Moreau" <francis.moro@gmail.com>,
	"Paul Mundt" <lethal@linux-sh.org>,
	"Vladimir A. Barinov" <vbarinov@ru.mvista.com>,
	"Pierre Ossman" <drzeus-list@drzeus.cx>
Subject: Re: [RFC v2 0/5] dmaengine: Slave DMA interface and example users
Date: Mon, 4 Feb 2008 16:32:00 +0100	[thread overview]
Message-ID: <20080204163200.550481a7@dhcp-252-066.norway.atmel.com> (raw)
In-Reply-To: <e9c3a7c20801300939w7b73f5a6ld73bde8c3fada569@mail.gmail.com>

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

  reply	other threads:[~2008-02-04 15:32 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-29 18:10 Haavard Skinnemoen
2008-01-29 18:10 ` [RFC v2 1/5] dmaengine: Add dma_client parameter to device_alloc_chan_resources Haavard Skinnemoen
2008-01-29 18:10   ` [RFC v2 2/5] dmaengine: Add slave DMA interface Haavard Skinnemoen
2008-01-29 18:10     ` [RFC v2 3/5] dmaengine: Make DMA Engine menu visible for AVR32 users Haavard Skinnemoen
2008-01-29 18:10       ` [RFC v2 4/5] dmaengine: Driver for the Synopsys DesignWare DMA controller Haavard Skinnemoen
2008-01-29 18:10         ` [RFC v2 5/5] Atmel MCI: Driver for Atmel on-chip MMC controllers Haavard Skinnemoen
2008-02-13 18:30           ` Pierre Ossman
2008-02-13 18:47             ` Haavard Skinnemoen
2008-02-14 14:00             ` MMC core debugfs support (was Re: [RFC v2 5/5] Atmel MCI: Driver for Atmel on-chip MMC controllers) Haavard Skinnemoen
2008-02-25 17:12               ` Pierre Ossman
2008-02-13 19:11           ` [RFC v2 5/5] Atmel MCI: Driver for Atmel on-chip MMC controllers Dan Williams
2008-02-13 21:06             ` Haavard Skinnemoen
2008-02-13 23:55               ` Dan Williams
2008-02-14  8:36                 ` Haavard Skinnemoen
2008-02-14 18:34                   ` Dan Williams
2008-02-14 19:21                     ` Haavard Skinnemoen
2008-01-30 18:53         ` [RFC v2 4/5] dmaengine: Driver for the Synopsys DesignWare DMA controller Dan Williams
2008-01-30  7:30     ` [RFC v2 2/5] dmaengine: Add slave DMA interface David Brownell
2008-01-30  9:27       ` Haavard Skinnemoen
2008-01-30 10:52         ` David Brownell
2008-01-30 12:26           ` Haavard Skinnemoen
2008-01-31  8:27             ` David Brownell
2008-01-31  8:44               ` Paul Mundt
2008-01-31 12:51                 ` David Brownell
2008-01-31 14:12                   ` Haavard Skinnemoen
2008-01-31 13:52               ` Haavard Skinnemoen
2008-02-06 21:08             ` Dan Williams
2008-02-07 17:56               ` Haavard Skinnemoen
2008-01-30 18:28           ` Dan Williams
2008-01-30 20:45             ` David Brownell
2008-01-31  6:35     ` SDIO driver not receiving responses Farbod Nejati
2008-02-07 19:51       ` Pierre Ossman
2008-01-29 20:54 ` [RFC v2 0/5] dmaengine: Slave DMA interface and example users Haavard Skinnemoen
2008-01-30  6:56   ` David Brownell
2008-01-30  8:56     ` Haavard Skinnemoen
2008-01-30 17:39       ` Dan Williams
2008-02-04 15:32         ` Haavard Skinnemoen [this message]
2008-02-06 18:46           ` Dan Williams
2008-02-07 17:52             ` Haavard Skinnemoen

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=20080204163200.550481a7@dhcp-252-066.norway.atmel.com \
    --to=hskinnemoen@atmel.com \
    --cc=dan.j.williams@intel.com \
    --cc=david-b@pacbell.net \
    --cc=drzeus-list@drzeus.cx \
    --cc=francis.moro@gmail.com \
    --cc=kernel@avr32linux.org \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shannon.nelson@intel.com \
    --cc=vbarinov@ru.mvista.com \
    --subject='Re: [RFC v2 0/5] dmaengine: Slave DMA interface and example users' \
    /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;
as well as URLs for NNTP newsgroup(s).