From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: vinod.koul@intel.com, linux@arm.linux.org.uk
Cc: tony@atomide.com, linux-kernel@vger.kernel.org,
linux-omap@vger.kernel.org, dmaengine@vger.kernel.org
Subject: [PATCH 4/4] dmaengine: omap-dma: Handle cases when the channel is polled for completion
Date: Wed, 11 Nov 2015 12:37:58 +0200 [thread overview]
Message-ID: <1447238278-15863-5-git-send-email-peter.ujfalusi@ti.com> (raw)
In-Reply-To: <1447238278-15863-1-git-send-email-peter.ujfalusi@ti.com>
When a DMA client driver decides that it is not providing callback for
completion of a transfer (and/or does not set the DMA_PREP_INTERRUPT) but
it will poll the status of the transfer (in case of short memcpy for
example) we will not get interrupt for the completion of the transfer and
will not mark the transaction as done.
Check the channel enable bit in the CCR when the status is queried and if
the channel is no longer active, we call the omap_dma_callback() to handle
the transfer completion.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
drivers/dma/omap-dma.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index 4e4642f561f5..f86827ac0c8a 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -673,8 +673,14 @@ static enum dma_status omap_dma_tx_status(struct dma_chan *chan,
struct omap_chan *c = to_omap_dma_chan(chan);
struct virt_dma_desc *vd;
enum dma_status ret;
+ uint32_t ccr;
unsigned long flags;
+ ccr = omap_dma_chan_read(c, CCR);
+ /* The channel is no longer active, handle the completion right away */
+ if (!(ccr & CCR_ENABLE))
+ omap_dma_callback(c->dma_ch, 0, c);
+
ret = dma_cookie_status(chan, cookie, txstate);
if (ret == DMA_COMPLETE || !txstate)
return ret;
--
2.6.2
next prev parent reply other threads:[~2015-11-11 10:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-11 10:37 [PATCH 0/4] dmaengine: omap-dma: transfer start and short memcpy improvement Peter Ujfalusi
2015-11-11 10:37 ` [PATCH 1/4] dmaengine: omap-dma: Correct status reporting for memcpy Peter Ujfalusi
2015-11-11 10:37 ` [PATCH 2/4] dmaengine: omap-dma: Clean up the prep_slave_sg sg list walk code Peter Ujfalusi
2015-11-11 10:37 ` [PATCH 3/4] dmaengine: omap-dma: Remove tasklet to start the transfers Peter Ujfalusi
2015-11-11 10:37 ` Peter Ujfalusi [this message]
2015-12-05 8:07 ` [PATCH 0/4] dmaengine: omap-dma: transfer start and short memcpy improvement Vinod Koul
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=1447238278-15863-5-git-send-email-peter.ujfalusi@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=tony@atomide.com \
--cc=vinod.koul@intel.com \
/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