linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: vinod.koul@intel.com (Vinod Koul)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 3/4] dma: mmp_pdma: add support for residue reporting
Date: Sun, 25 Aug 2013 22:18:42 +0530	[thread overview]
Message-ID: <20130825164842.GF2748@intel.com> (raw)
In-Reply-To: <20130825170151.GW6617@n2100.arm.linux.org.uk>

On Sun, Aug 25, 2013 at 06:01:51PM +0100, Russell King - ARM Linux wrote:
> On Sun, Aug 25, 2013 at 09:41:04PM +0530, Vinod Koul wrote:
> > Also descriptor is returned for a transaction when you invoke .device_prep_xxx.
> > And each descriptor is assigned a cookie value.
Sorry this wasnt meant to be in same timeline, just stating that descriptor is
always assigned a cookie value and yes that will be done _only_ when descriptor
is submitted by invoking .tx_submit(). 

In dma driver, one should use cookie value to check status

Also, the reason for not assigning cookie in prepare is simple. If we preared
three trasactions A, B and C. But sumbitted A, C and then B then whole cookie
logic will fail, so it makes sense to assign cookie in an ordered fashion when
trasactions are submitted not when prepared.

Though i suspect in slave dma case, we would see ordered manner typically.

> The descriptor is not assigned a cookie in the preparation function - it
> is only assigned a cookie when it is submitted, which should always happen
> shortly after preparation.  The submission call returns the assigned
> cookie, so there's no reason for any driver to dereference the descriptor.
> 
> Any driver which does dereference the descriptor after submission is
> potentially a bug; the DMA engine owns it, and can kfree that descriptor
> any moment after submission, or even re-use it for another descriptor.
I would say after callback is invoked in case when one is set. For the ones when
no callback is set, yes after invoking tx_submit() is right one.

Clients should remeber the cookie value returned and use it to track the status
of transactions.

~Vinod
-- 

  reply	other threads:[~2013-08-25 16:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-16 17:05 [PATCH v4 0/4] dma: pdma: cyclic, residue, DMA_PRIVATE Daniel Mack
2013-08-16 17:05 ` [PATCH v4 1/4] dma: mmp_pdma: only complete one transaction from dma_do_tasklet() Daniel Mack
2013-08-20  2:27   ` Xiang Wang
2013-08-20  7:44     ` Daniel Mack
2013-08-25  1:15       ` Robert Jarzmik
2013-08-16 17:05 ` [PATCH v4 2/4] dma: mmp_pdma: add support for cyclic DMA descriptors Daniel Mack
2013-08-16 17:05 ` [PATCH v4 3/4] dma: mmp_pdma: add support for residue reporting Daniel Mack
2013-08-21 11:35   ` Xiang Wang
2013-08-21 11:52     ` Andy Shevchenko
2013-08-21 12:03       ` Daniel Mack
2013-08-21 12:08         ` Andy Shevchenko
2013-08-25 16:11         ` Vinod Koul
2013-08-25 17:01           ` Russell King - ARM Linux
2013-08-25 16:48             ` Vinod Koul [this message]
2013-08-25 18:06               ` Russell King - ARM Linux
2013-08-26  6:07                 ` Robert Jarzmik
2013-08-21 11:55     ` Daniel Mack
2013-08-16 17:05 ` [PATCH v4 4/4] dma: mmp_pdma: set DMA_PRIVATE Daniel Mack

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=20130825164842.GF2748@intel.com \
    --to=vinod.koul@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).