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] DMA: extend documentation to provide more API details
Date: Mon, 7 Oct 2013 16:09:36 +0530	[thread overview]
Message-ID: <20131007103936.GH2954@intel.com> (raw)
In-Reply-To: <20131007111728.GM12758@n2100.arm.linux.org.uk>

On Mon, Oct 07, 2013 at 12:17:28PM +0100, Russell King - ARM Linux wrote:
> On Mon, Oct 07, 2013 at 12:45:33PM +0200, Guennadi Liakhovetski wrote:
> > No, not something in the middle. I was thinking about
> > 
> > (1) cookie 1-3 are submitted
> > (2) cookie 1 succeeds
> > (3) a DMA error occurs, cookies 2-3 are discarded
discarded using terminate_all right?

> > (4) cookie 4 is submitted and succeeds
> > (5) the user requests status of cookie 2 and gets success back, AFAICS
No you cant!, you can only request for 4..
> 
> This is a side effect of using a sequential cookie based system to indicate
> whether a descriptor has succeeded or not.
In the above case, since user calls terminate_all we can put a rule that
terminate should reset the cookie counter.
So after the terminate_all the cookies are sequentially valid!

Anyways as pointed above user shouldnt check for 2, he should have removed all
refs till 3 before calling terminate.

> What may be better is to change the wording here: not DMA_SUCCESS but
> DMA_COMPLETED.  That doesn't imply that it has been successful, merely
> that the DMA engine has finished with the transaction.
Agreed that its not indication of success but of DMA completetion. I have seen
cases where slave perhiphral got stuck while sending last FIFO but since DMA
finished transferiing to FIFO it says complete.

Dan do you agree?

> How a transaction gets to notify that it's been in error is a problem -
> there is no mechanism to do that (part of that is because DMA engine slave
> support grew out of the async_tx stuff which doesn't really have the
> notion of failure.)
> 
> We can't fetch the descriptor after it has been completed, because it will
> have been freed or recycled depending on the implementation.
> 
> If we want to have some way to report errors against descriptors, I think
> we should augment the descriptor with another callback which gets called
> (again from tasklet context) so that drivers which care about this can be
> notified of errors.
In case DMA engine gets an error interrupt we can do so, but same can be done
with current callback by adding status bit. In more pratical scenarios its that
DMA is stuck due to FIFO not moving, or wrong periphral mapping or some bug. In
these cases dma driver cannot find it is stuck. So recommendation would be for
client to put a timeout and after timeout assume the transfers are not completed

-- 
~Vinod

  reply	other threads:[~2013-10-07 10:39 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-05 17:36 [PATCH] DMA: extend documentation to provide more API details Guennadi Liakhovetski
2013-10-05 19:02 ` Russell King - ARM Linux
2013-10-05 21:00   ` Guennadi Liakhovetski
2013-10-05 23:31     ` Russell King - ARM Linux
2013-10-06  5:20       ` Vinod Koul
2013-10-07 10:45         ` Guennadi Liakhovetski
2013-10-07 10:41           ` Vinod Koul
2013-10-07 12:17             ` Guennadi Liakhovetski
2013-10-07 11:17           ` Russell King - ARM Linux
2013-10-07 10:39             ` Vinod Koul [this message]
2013-10-07 12:15               ` Guennadi Liakhovetski
2013-10-07 14:25                 ` Vinod Koul
2013-10-07 15:28                   ` Guennadi Liakhovetski
2013-10-07 14:43                     ` Vinod Koul
2013-10-07 15:45                       ` Guennadi Liakhovetski
2013-10-07 15:52                         ` Vinod Koul
2013-10-07 20:55                           ` Guennadi Liakhovetski
2013-10-08  3:52                             ` Vinod Koul
2013-10-08  7:28                               ` Guennadi Liakhovetski
2013-10-07 15:48                     ` Vinod Koul
2013-10-07 20:43                       ` Guennadi Liakhovetski
2013-10-08  3:58                         ` Vinod Koul
2013-10-08  7:17                           ` Guennadi Liakhovetski
2013-10-09  1:34               ` Dan Williams
2013-10-10 16:15                 ` Vinod Koul
2013-10-16 19:33                 ` Stephen Warren
2013-10-17  5:16                   ` Vinod Koul
2013-10-17 14:55                     ` Stephen Warren
2013-10-17 17:00                       ` Dan Williams
2013-10-07  7:40       ` Guennadi Liakhovetski
2013-10-09  1:28         ` 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=20131007103936.GH2954@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).