From: ben.dooks@codethink.co.uk (Ben Dooks)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] dmaengine: pl330: fix return status on pending transfers
Date: Mon, 16 Mar 2015 11:52:45 +0000 [thread overview]
Message-ID: <1426506765-10085-4-git-send-email-ben.dooks@codethink.co.uk> (raw)
In-Reply-To: <1426506765-10085-1-git-send-email-ben.dooks@codethink.co.uk>
The pl330_tx_status() function returns the desc->status if the
dma_cookie_status() call does indicate the cookie completed,
however the desc->status is not look directly compatible. Sparse
throws the following warning:
pl330.c:2262:35: warning: mixing different enum types
pl330.c:2262:35: int enum desc_status versus
pl330.c:2262:35: int enum dma_status
Attempt to fix this by adding a switch statement to turn the
desc->status into a dma_status.
Note, this has only been tested with the dmatest suite.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
--
Vinod Koul <vinod.koul@intel.com>
Dan Williams <dan.j.williams@intel.com>
DMA List <dmaengine@vger.kernel.org>
Maxime Ripard <maxime.ripard@free-electrons.com>
Jassi Brar <jassisinghbrar@gmail.com>
Liviu Dudau <Liviu.Dudau@arm.com>
Linux ARM Kernel <linux-arm-kernel@lists.infradead.org>
---
drivers/dma/pl330.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index d6f677e..a7d9d30 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2259,7 +2259,17 @@ pl330_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
transferred = 0;
residual += desc->bytes_requested - transferred;
if (desc->txd.cookie == cookie) {
- ret = desc->status;
+ switch (desc->status) {
+ case DONE:
+ ret = DMA_COMPLETE;
+ break;
+ case PREP:
+ case BUSY:
+ ret = DMA_IN_PROGRESS;
+ break;
+ default:
+ WARN_ON(1);
+ }
break;
}
if (desc->last)
--
2.1.4
next prev parent reply other threads:[~2015-03-16 11:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-16 11:52 pl330 endian fix and two fixups Ben Dooks
2015-03-16 11:52 ` [PATCH 1/3] dmaengine: pl330: fix issues with big-endian armv7 Ben Dooks
2015-03-16 11:52 ` [PATCH 2/3] dmaengine: pl330: make unexported functions static Ben Dooks
2015-03-16 11:52 ` Ben Dooks [this message]
2015-03-18 17:12 ` pl330 endian fix and two fixups 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=1426506765-10085-4-git-send-email-ben.dooks@codethink.co.uk \
--to=ben.dooks@codethink.co.uk \
--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).