linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM:SAMSUNG: Move S3C DMA driver to drivers/dma
Date: Tue, 7 Jun 2011 19:29:23 +0100	[thread overview]
Message-ID: <20110607182923.GA28451@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <BANLkTin66PhYGmVSOJcuZr8wDH_iNgjhZQ@mail.gmail.com>

On Tue, Jun 07, 2011 at 03:45:18PM +0530, Jassi Brar wrote:
> On Tue, Jun 7, 2011 at 1:45 PM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> > On Tue, Jun 07, 2011 at 01:39:43PM +0530, Jassi Brar wrote:
> >> Unfortunately, no. There are some features of Samsung's DMA API that
> >> the drivers have come to rely upon.
> >> Besides, I am not particularly a fan of the generic API. And IIRC,
> >> neither is Ben Dooks, the designer of the
> >> Samsung's DMA API.
> >
> > We are now at the point where this is non-optional. ?If the generic API
> > doesn't fit what Samsung needs, then that needs to be discussed and
> > whatever problems there are need to be resolved.
> The discussion did take off a few months ago, but we didn't reach anywhere.
> Being able to queue request from the 'done' callback, the need of
> circular buffer
> API (possibly a free-running one too) and callbacks in irq-context, as
> they happen,
> were a few requirements for having fast peripherals with shallow fifo
> work without underruns.

I can see why you have these concerns; the problem is the slave DMA
engine API was never properly documented.

1. The slave API does permit the done callback to submit new requests
   already (and any DMA engine driver which doesn't allow that is broken.)

Note that slave APIs _should_ permit several requests to be queued up
and as each finish, the next one should be started.  In other words,
once DMA has started it should continue until there is no more work for
the DMA engine to perform.

2. Circular buffer support has been added - see device_prep_dma_cyclic().

However, 2 is not really a requirement for audio - you can queue several
single slave transfers (one per period) initially, and then you get
callbacks as each transfer completes.  In the callback, you can submit
an additional buffer, and continue doing so causing DMA to never end.

I believe that this is a saner approach than the circular buffer support,
and its what I tried to put together for the AMBA PL041 AACI DMA (but
unfortunately, ARMs platforms are totally broken when it comes to DMA.)

This also removes the need for the callback to be in IRQ context.

So I don't see that anything you've mentioned is a problem with the API
as it stands today - there may be issues with the way the DMA engine
driver has been implemented which cause it not to conform to what I've
said above, but those are driver bugs and not a fault of the API.

  reply	other threads:[~2011-06-07 18:29 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-07  7:48 [PATCH] ARM:SAMSUNG: Move S3C DMA driver to drivers/dma root
2011-06-07  8:00 ` Kyungmin Park
2011-06-07  8:09   ` Jassi Brar
2011-06-07  8:15     ` Russell King - ARM Linux
2011-06-07  8:35       ` Kyungmin Park
2011-06-07 10:15       ` Jassi Brar
2011-06-07 18:29         ` Russell King - ARM Linux [this message]
2011-06-07 18:43           ` Mark Brown
2011-06-07 19:01             ` Jassi Brar
2011-06-07 21:41               ` Mark Brown
2011-06-08  2:51                 ` Jassi Brar
2011-06-08  8:55                   ` Mark Brown
2011-06-07 22:28               ` Russell King - ARM Linux
2011-06-08  4:05                 ` Jassi Brar
2011-06-08  7:44                   ` Russell King - ARM Linux
2011-06-07 19:46           ` Jassi Brar
2011-06-07 22:36             ` Russell King - ARM Linux
2011-06-09 18:24               ` Kukjin Kim
2011-06-16 12:56                 ` Kyungmin Park
2011-06-23  6:47                   ` Kukjin Kim
2011-06-07 10:15     ` Linus Walleij
2011-06-07 10:05       ` Koul, Vinod
2011-06-07  8:01 ` Jassi Brar
2011-06-07 15:42 ` Tushar Behera

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=20110607182923.GA28451@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).