From: wangx@marvell.com (Xiang Wang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 1/4] dma: mmp_pdma: only complete one transaction from dma_do_tasklet()
Date: Tue, 20 Aug 2013 10:27:37 +0800 [thread overview]
Message-ID: <5212D419.5030504@marvell.com> (raw)
In-Reply-To: <1376672707-24527-2-git-send-email-zonque@gmail.com>
On 08/17/2013 01:05 AM, Daniel Mack wrote:
> Currently, when an interrupt has occured for a channel, the tasklet
> worker code will only look at the very last entry in the running list
> and complete its cookie, and then dispose the entire running chain.
> Hence, the first transaction's cookie will never complete.
>
> In fact, the interrupt we should handle will be the one related to the
> first descriptor in the chain with the ENDIRQEN bit set, so complete
> the second transaction that is in fact still running.
>
> As a result, the driver can't currently handle multiple transactions on
> one chanel, and it's likely that no drivers exist that rely on this
> feature.
>
> Fix this by walking the running_chain and look for the first
> descriptor that has the interrupt-enable bit set. Only queue
> descriptors up to that point for completion handling, while leaving
> the rest intact. Also, only make the channel idle if the list is
> completely empty after such a cycle.
>
> Signed-off-by: Daniel Mack <zonque@gmail.com>
> ---
> drivers/dma/mmp_pdma.c | 35 +++++++++++++++++++++--------------
> 1 file changed, 21 insertions(+), 14 deletions(-)
>
Hi, Daniel
I think we would not run into the situation that there is a descriptor
with ENDIRQEN set in the middle of the running chain.
in mmp_pdma.c:
mmp_pdma_tx_submit() -> append_pending_queue() ->
tail->desc.dcmd &= ~DCMD_ENDIRQEN;
So in the pending list (same for running list), only the last descriptor
will have ENDIRQEN set.
Please correct me if any problems.
--
Regards,
Xiang
next prev parent reply other threads:[~2013-08-20 2:27 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 [this message]
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
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=5212D419.5030504@marvell.com \
--to=wangx@marvell.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.