linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: dan.j.williams@intel.com (Dan Williams)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/5] ARM: define the PrimeCell DMA API
Date: Wed, 24 Mar 2010 16:30:48 -0700	[thread overview]
Message-ID: <e9c3a7c21003241630u5c4c1f45qc0608c124a062350@mail.gmail.com> (raw)
In-Reply-To: <CEE6BB42CAD6E947908279175AF8470A0391EEB9@EXDCVYMBSTM006.EQ1STM.local>

On Wed, Mar 24, 2010 at 3:13 PM, Linus WALLEIJ
<linus.walleij@stericsson.com> wrote:
> [Dan]
>
>> What are your semantics for keeping the transaction information alive
>> until it gets consumed. ?Currently the dma_ctrl_flags have the
>> DMA_CTRL_ACK bit to specify that the descriptor not be
>> recycled/destroyed until the client has a chance to attach a dependent
>> operation. ?Seems you need something similar to indicate that the
>> residue information not be destroyed until it is consumed. ?In other
>> words how does a client guarantee that the engine provides the
>> information it needs?
>
> Well exactly to avoid that kind of trouble I STOP (or PAUSE),
> get numer of bytes left, then terminate in that order. This
> keeps the descriptor.

But doesn't this assume you win the race with the engine completing
and cleaning up the descriptor before the 'stop' takes effect?

> Perhaps it's better to keep the two functions _pause() and
> _get_residue() and indicate that device_terminate_all()
> may destroy the state.

The configuration issues will always be arch specific I grant you
that, but I think we can define top level "operation query" and
"channel control" apis in a generic/extensible fashion.  Something
like:

1/ Change ->device_terminate_all() into ->device_control():

enum {
	DMA_TERMINATE_ALL, /* legacy semantics */
	DMA_PAUSE, /* your new primecell command semantics */
} dma_crtl;

int (*device_control)(struct dma_chan *chan, enum dma_ctrl cmd);


2/ Change device_is_tx_complete to device_tx_status along the lines of
what Guennadi and I talked about.

--
Dan

  reply	other threads:[~2010-03-24 23:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-08 13:52 [PATCH 1/5] ARM: define the PrimeCell DMA API Linus Walleij
2010-03-24 21:08 ` Dan Williams
2010-03-24 21:38   ` Linus WALLEIJ
2010-03-24 22:01     ` Dan Williams
2010-03-24 22:13       ` Linus WALLEIJ
2010-03-24 23:30         ` Dan Williams [this message]
2010-03-25  7:10           ` Linus WALLEIJ
2010-03-24 21:25 ` Dan Williams
2010-03-24 22:08   ` Linus WALLEIJ
2010-03-24 23:03     ` Dan Williams

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=e9c3a7c21003241630u5c4c1f45qc0608c124a062350@mail.gmail.com \
    --to=dan.j.williams@intel.com \
    --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).