LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Dan Williams <dan.j.williams@intel.com>,
	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 2/5] dmaengine: Add slave DMA interface
Date: Tue, 29 Jan 2008 23:30:05 -0800	[thread overview]
Message-ID: <200801292330.05874.david-b@pacbell.net> (raw)
In-Reply-To: <1201630213-31900-3-git-send-email-hskinnemoen@atmel.com>

On Tuesday 29 January 2008, Haavard Skinnemoen wrote:
> @@ -297,6 +356,13 @@ struct dma_device {
>         struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)(
>                 struct dma_chan *chan);
>  
> +       struct dma_slave_descriptor *(*device_prep_slave)(
> +               struct dma_chan *chan, dma_addr_t mem_addr,
> +               enum dma_slave_direction direction,
> +               enum dma_slave_width reg_width,
> +               size_t len, unsigned long flags);

That isn't enough options!  Check out arch/arm/plat-omap/dma.c (and
maybe OMAP5912 DMA docs [1] for not-very-recent specs) as one example.
You'll see more options that drivers need to use, including:

 - DMA priority and arbitration
 - Burst size, packing/unpacking support (for optimized memory access)
 - Multiple DMA quanta (not just reg_width, but also frames and blocks)
 - Multiple synch modes (per element/"width", frame, or block)
 - Multiple addressing modes:   pre-index, post-index, double-index, ...
 - Both descriptor-based and register based transfers
 - ... lots more ...

Example:  USB tends to use one packet per "frame" and have the DMA
request signal mean "give me the next frame".  It's sometimes been
very important to use use the tuning options to avoid some on-chip
race conditions for transfers that cross lots of internal busses and
clock domains, and to have special handling for aborting transfers
and handling "short RX" packets.


I wonder whether a unified programming interface is the right way
to approach peripheral DMA support, given such variability.  The DMAC
from Synopsys that you're working with has some of those options, but
not all of them... and other DMA controllers have their own oddities.

For memcpy() acceleration, sure -- there shouldn't be much scope for
differences.  Source, destination, bytecount ... go!  (Not that it's
anywhere *near* that quick in the current interface.)

For peripheral DMA, maybe it should be a "core plus subclasses"
approach so that platform drivers can make use hardware-specific
knowledge (SOC-specific peripheral drivers using SOC-specific DMA),
sharing core code for dma-memcpy() and DMA channel housekeeping.

- Dave

[1] http://focus.ti.com/docs/prod/folders/print/omap5912.html
    lists spru755c near the bottom; the "System DMA" section.


> +       void (*device_terminate_all)(struct dma_chan *chan);
> +
>         void (*device_dependency_added)(struct dma_chan *chan);
>         enum dma_status (*device_is_tx_complete)(struct dma_chan *chan,
>                         dma_cookie_t cookie, dma_cookie_t *last,



  parent reply	other threads:[~2008-01-30  7:30 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-29 18:10 [RFC v2 0/5] dmaengine: Slave DMA interface and example users 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     ` David Brownell [this message]
2008-01-30  9:27       ` [RFC v2 2/5] dmaengine: Add slave DMA interface 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
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=200801292330.05874.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=dan.j.williams@intel.com \
    --cc=drzeus-list@drzeus.cx \
    --cc=francis.moro@gmail.com \
    --cc=hskinnemoen@atmel.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 2/5] dmaengine: Add slave DMA interface' \
    /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).