linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status
@ 2013-10-16 16:28 Vinod Koul
  2013-10-16 16:28 ` [PATCH 01/28] " Vinod Koul
                   ` (28 more replies)
  0 siblings, 29 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

As we recently discussed in [1], the DMA_SUCCESS is an misnomer. The dmaengine
does not acknowledge that dma completed succesfully. It can only signal dma was
completed by it. Hence we should use DMA_COMPLTE as status instead of
DMA_SUCCESS

[1]: http://www.spinics.net/lists/arm-kernel/msg278346.html 

Vinod Koul (28):
  dmaengine: use DMA_COMPLETE for dma completion status
  dmaengine: amba-pl08x: use DMA_COMPLETE for dma completion status
  dmaengine: at_hdma: use DMA_COMPLETE for dma completion status
  dmaengine: coh901318: use DMA_COMPLETE for dma completion status
  dmaengine: cppi41: use DMA_COMPLETE for dma completion status
  dmaengine: jz4740: use DMA_COMPLETE for dma completion status
  dmaengine: dmatest: use DMA_COMPLETE for dma completion status
  dmaengine: dw: use DMA_COMPLETE for dma completion status
  dmaengine: edma: use DMA_COMPLETE for dma completion status
  dmaengine: imx-dma: use DMA_COMPLETE for dma completion status
  dmaengine: imx-sdma: use DMA_COMPLETE for dma completion status
  dmaengine: intel_mid_dma: use DMA_COMPLETE for dma completion status
  dmaengine: ioat: use DMA_COMPLETE for dma completion status
  dmaengine: iop: use DMA_COMPLETE for dma completion status
  dmaengine: k3dma: use DMA_COMPLETE for dma completion status
  dmaengine: mmp_tdma: use DMA_COMPLETE for dma completion status
  dmaengine: mv_xor: use DMA_COMPLETE for dma completion status
  dmaengine: mxs-dma: use DMA_COMPLETE for dma completion status
  dmaengine: omap: use DMA_COMPLETE for dma completion status
  dmaengine: ppc4xx: use DMA_COMPLETE for dma completion status
  dmaengine: sa11x0: use DMA_COMPLETE for dma completion status
  dmaengine: sh: use DMA_COMPLETE for dma completion status
  dmaengine: ste: use DMA_COMPLETE for dma completion status
  dmaengine: tegra: use DMA_COMPLETE for dma completion status
  dmaengine: txx9: use DMA_COMPLETE for dma completion status
  async_tx: use DMA_COMPLETE for dma completion status
  serial: sh: use DMA_COMPLETE for dma completion status
  net: use DMA_COMPLETE for dma completion status

 crypto/async_tx/async_tx.c    |    4 ++--
 drivers/dma/amba-pl08x.c      |    4 ++--
 drivers/dma/at_hdmac.c        |    2 +-
 drivers/dma/coh901318.c       |    2 +-
 drivers/dma/cppi41.c          |    2 +-
 drivers/dma/dma-jz4740.c      |    2 +-
 drivers/dma/dmaengine.c       |    2 +-
 drivers/dma/dmatest.c         |    2 +-
 drivers/dma/dw/core.c         |    4 ++--
 drivers/dma/edma.c            |    2 +-
 drivers/dma/imx-dma.c         |    2 +-
 drivers/dma/imx-sdma.c        |    2 +-
 drivers/dma/intel_mid_dma.c   |    4 ++--
 drivers/dma/ioat/dma.c        |    4 ++--
 drivers/dma/ioat/dma_v3.c     |    8 ++++----
 drivers/dma/iop-adma.c        |   16 ++++++++--------
 drivers/dma/k3dma.c           |    2 +-
 drivers/dma/mmp_tdma.c        |    6 +++---
 drivers/dma/mv_xor.c          |    6 +++---
 drivers/dma/mxs-dma.c         |    6 +++---
 drivers/dma/omap-dma.c        |    2 +-
 drivers/dma/ppc4xx/adma.c     |    2 +-
 drivers/dma/sa11x0-dma.c      |    2 +-
 drivers/dma/sh/shdma-base.c   |    2 +-
 drivers/dma/ste_dma40.c       |    2 +-
 drivers/dma/tegra20-apb-dma.c |    4 ++--
 drivers/dma/txx9dmac.c        |    4 ++--
 drivers/tty/serial/sh-sci.c   |    2 +-
 include/linux/dmaengine.h     |   12 ++++++------
 net/ipv4/tcp.c                |    4 ++--
 30 files changed, 59 insertions(+), 59 deletions(-)


Thanks
~Vinod

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 18:29   ` Guennadi Liakhovetski
  2013-10-16 16:28 ` [PATCH 02/28] dmaengine: amba-pl08x: " Vinod Koul
                   ` (27 subsequent siblings)
  28 siblings, 1 reply; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

the DMA_SUCCESS is a misnomer as dmaengine indicates the transfer is complete and
gives no guarantee of the transfer success. Hence we should use DMA_COMPLTE
instead of DMA_SUCCESS

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 drivers/dma/dmaengine.c   |    2 +-
 include/linux/dmaengine.h |   12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index 9162ac8..81d8765 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -1062,7 +1062,7 @@ dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx)
 	unsigned long dma_sync_wait_timeout = jiffies + msecs_to_jiffies(5000);
 
 	if (!tx)
-		return DMA_SUCCESS;
+		return DMA_COMPLETE;
 
 	while (tx->cookie == -EBUSY) {
 		if (time_after_eq(jiffies, dma_sync_wait_timeout)) {
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 0bc7275..4b460a6 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -45,13 +45,13 @@ static inline int dma_submit_error(dma_cookie_t cookie)
 
 /**
  * enum dma_status - DMA transaction status
- * @DMA_SUCCESS: transaction completed successfully
+ * @DMA_COMPLETE: transaction completed
  * @DMA_IN_PROGRESS: transaction not yet processed
  * @DMA_PAUSED: transaction is paused
  * @DMA_ERROR: transaction failed
  */
 enum dma_status {
-	DMA_SUCCESS,
+	DMA_COMPLETE,
 	DMA_IN_PROGRESS,
 	DMA_PAUSED,
 	DMA_ERROR,
@@ -979,10 +979,10 @@ static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie,
 {
 	if (last_complete <= last_used) {
 		if ((cookie <= last_complete) || (cookie > last_used))
-			return DMA_SUCCESS;
+			return DMA_COMPLETE;
 	} else {
 		if ((cookie <= last_complete) && (cookie > last_used))
-			return DMA_SUCCESS;
+			return DMA_COMPLETE;
 	}
 	return DMA_IN_PROGRESS;
 }
@@ -1013,11 +1013,11 @@ static inline struct dma_chan *dma_find_channel(enum dma_transaction_type tx_typ
 }
 static inline enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie)
 {
-	return DMA_SUCCESS;
+	return DMA_COMPLETE;
 }
 static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx)
 {
-	return DMA_SUCCESS;
+	return DMA_COMPLETE;
 }
 static inline void dma_issue_pending_all(void)
 {
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 02/28] dmaengine: amba-pl08x: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
  2013-10-16 16:28 ` [PATCH 01/28] " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 16:28 ` [PATCH 03/28] dmaengine: at_hdma: " Vinod Koul
                   ` (26 subsequent siblings)
  28 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
CC: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/dma/amba-pl08x.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index 9b50257..4ee6533 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -1252,7 +1252,7 @@ static enum dma_status pl08x_dma_tx_status(struct dma_chan *chan,
 	size_t bytes = 0;
 
 	ret = dma_cookie_status(chan, cookie, txstate);
-	if (ret == DMA_SUCCESS)
+	if (ret == DMA_COMPLETE)
 		return ret;
 
 	/*
@@ -1267,7 +1267,7 @@ static enum dma_status pl08x_dma_tx_status(struct dma_chan *chan,
 
 	spin_lock_irqsave(&plchan->vc.lock, flags);
 	ret = dma_cookie_status(chan, cookie, txstate);
-	if (ret != DMA_SUCCESS) {
+	if (ret != DMA_COMPLETE) {
 		vd = vchan_find_desc(&plchan->vc, cookie);
 		if (vd) {
 			/* On the issued list, so hasn't been processed yet */
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 03/28] dmaengine: at_hdma: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
  2013-10-16 16:28 ` [PATCH 01/28] " Vinod Koul
  2013-10-16 16:28 ` [PATCH 02/28] dmaengine: amba-pl08x: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-17  8:08   ` Nicolas Ferre
  2013-10-16 16:28 ` [PATCH 04/28] dmaengine: coh901318: " Vinod Koul
                   ` (25 subsequent siblings)
  28 siblings, 1 reply; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
CC: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/dma/at_hdmac.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index c787f38..1ef7457 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -1102,7 +1102,7 @@ atc_tx_status(struct dma_chan *chan,
 	int bytes = 0;
 
 	ret = dma_cookie_status(chan, cookie, txstate);
-	if (ret == DMA_SUCCESS)
+	if (ret == DMA_COMPLETE)
 		return ret;
 	/*
 	 * There's no point calculating the residue if there's
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 04/28] dmaengine: coh901318: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (2 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 03/28] dmaengine: at_hdma: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 16:28 ` [PATCH 05/28] dmaengine: cppi41: " Vinod Koul
                   ` (24 subsequent siblings)
  28 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
CC: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/dma/coh901318.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/coh901318.c b/drivers/dma/coh901318.c
index 3025b91..3c6716e 100644
--- a/drivers/dma/coh901318.c
+++ b/drivers/dma/coh901318.c
@@ -2369,7 +2369,7 @@ coh901318_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
 	enum dma_status ret;
 
 	ret = dma_cookie_status(chan, cookie, txstate);
-	if (ret == DMA_SUCCESS)
+	if (ret == DMA_COMPLETE)
 		return ret;
 
 	dma_set_residue(txstate, coh901318_get_bytes_left(chan));
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 05/28] dmaengine: cppi41: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (3 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 04/28] dmaengine: coh901318: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 16:28 ` [PATCH 06/28] dmaengine: jz4740: " Vinod Koul
                   ` (23 subsequent siblings)
  28 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
CC: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/dma/cppi41.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c
index 167c022..278b305 100644
--- a/drivers/dma/cppi41.c
+++ b/drivers/dma/cppi41.c
@@ -353,7 +353,7 @@ static enum dma_status cppi41_dma_tx_status(struct dma_chan *chan,
 
 	/* lock */
 	ret = dma_cookie_status(chan, cookie, txstate);
-	if (txstate && ret == DMA_SUCCESS)
+	if (txstate && ret == DMA_COMPLETE)
 		txstate->residue = c->residue;
 	/* unlock */
 
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 06/28] dmaengine: jz4740: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (4 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 05/28] dmaengine: cppi41: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 16:28 ` [PATCH 07/28] dmaengine: dmatest: " Vinod Koul
                   ` (22 subsequent siblings)
  28 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
CC: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/dma/dma-jz4740.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/dma-jz4740.c b/drivers/dma/dma-jz4740.c
index b0c0c82..94c380f 100644
--- a/drivers/dma/dma-jz4740.c
+++ b/drivers/dma/dma-jz4740.c
@@ -491,7 +491,7 @@ static enum dma_status jz4740_dma_tx_status(struct dma_chan *c,
 	unsigned long flags;
 
 	status = dma_cookie_status(c, cookie, state);
-	if (status == DMA_SUCCESS || !state)
+	if (status == DMA_COMPLETE || !state)
 		return status;
 
 	spin_lock_irqsave(&chan->vchan.lock, flags);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 07/28] dmaengine: dmatest: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (5 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 06/28] dmaengine: jz4740: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 16:28 ` [PATCH 08/28] dmaengine: dw: " Vinod Koul
                   ` (21 subsequent siblings)
  28 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 drivers/dma/dmatest.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index 92f796c..59e287f 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -740,7 +740,7 @@ static int dmatest_func(void *data)
 					  len, 0);
 			failed_tests++;
 			continue;
-		} else if (status != DMA_SUCCESS) {
+		} else if (status != DMA_COMPLETE) {
 			enum dmatest_error_type type = (status == DMA_ERROR) ?
 				DMATEST_ET_DMA_ERROR : DMATEST_ET_DMA_IN_PROGRESS;
 			thread_result_add(info, result, type,
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 08/28] dmaengine: dw: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (6 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 07/28] dmaengine: dmatest: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-17 13:43   ` Andy Shevchenko
  2013-10-21  7:33   ` Viresh Kumar
  2013-10-16 16:28 ` [PATCH 09/28] dmaengine: edma: " Vinod Koul
                   ` (20 subsequent siblings)
  28 siblings, 2 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
CC: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/dma/dw/core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
index 89eb89f..2c29331 100644
--- a/drivers/dma/dw/core.c
+++ b/drivers/dma/dw/core.c
@@ -1098,13 +1098,13 @@ dwc_tx_status(struct dma_chan *chan,
 	enum dma_status		ret;
 
 	ret = dma_cookie_status(chan, cookie, txstate);
-	if (ret == DMA_SUCCESS)
+	if (ret == DMA_COMPLETE)
 		return ret;
 
 	dwc_scan_descriptors(to_dw_dma(chan->device), dwc);
 
 	ret = dma_cookie_status(chan, cookie, txstate);
-	if (ret != DMA_SUCCESS)
+	if (ret != DMA_COMPLETE)
 		dma_set_residue(txstate, dwc_get_residue(dwc));
 
 	if (dwc->paused && ret == DMA_IN_PROGRESS)
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 09/28] dmaengine: edma: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (7 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 08/28] dmaengine: dw: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-17  0:31   ` Joel Fernandes
  2013-10-16 16:28 ` [PATCH 10/28] dmaengine: imx-dma: " Vinod Koul
                   ` (19 subsequent siblings)
  28 siblings, 1 reply; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
CC: Joel Fernandes <joelf@ti.com>
---
 drivers/dma/edma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 098a8da..29fa358 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -576,7 +576,7 @@ static enum dma_status edma_tx_status(struct dma_chan *chan,
 	unsigned long flags;
 
 	ret = dma_cookie_status(chan, cookie, txstate);
-	if (ret == DMA_SUCCESS || !txstate)
+	if (ret == DMA_COMPLETE || !txstate)
 		return ret;
 
 	spin_lock_irqsave(&echan->vchan.lock, flags);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 10/28] dmaengine: imx-dma: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (8 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 09/28] dmaengine: edma: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 16:28 ` [PATCH 11/28] dmaengine: imx-sdma: " Vinod Koul
                   ` (18 subsequent siblings)
  28 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
CC: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/dma/imx-dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index 55852c0..2af4028 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -771,7 +771,7 @@ static int imxdma_alloc_chan_resources(struct dma_chan *chan)
 		desc->desc.tx_submit = imxdma_tx_submit;
 		/* txd.flags will be overwritten in prep funcs */
 		desc->desc.flags = DMA_CTRL_ACK;
-		desc->status = DMA_SUCCESS;
+		desc->status = DMA_COMPLETE;
 
 		list_add_tail(&desc->node, &imxdmac->ld_free);
 		imxdmac->descs_allocated++;
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 11/28] dmaengine: imx-sdma: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (9 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 10/28] dmaengine: imx-dma: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 16:28 ` [PATCH 12/28] dmaengine: intel_mid_dma: " Vinod Koul
                   ` (17 subsequent siblings)
  28 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
CC: Acked-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/dma/imx-sdma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index fc43603..0e03b31 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -638,7 +638,7 @@ static void mxc_sdma_handle_channel_normal(struct sdma_channel *sdmac)
 	if (error)
 		sdmac->status = DMA_ERROR;
 	else
-		sdmac->status = DMA_SUCCESS;
+		sdmac->status = DMA_COMPLETE;
 
 	dma_cookie_complete(&sdmac->desc);
 	if (sdmac->desc.callback)
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 12/28] dmaengine: intel_mid_dma: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (10 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 11/28] dmaengine: imx-sdma: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 16:28 ` [PATCH 13/28] dmaengine: ioat: " Vinod Koul
                   ` (16 subsequent siblings)
  28 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 drivers/dma/intel_mid_dma.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/intel_mid_dma.c b/drivers/dma/intel_mid_dma.c
index a975ebe..1aab813 100644
--- a/drivers/dma/intel_mid_dma.c
+++ b/drivers/dma/intel_mid_dma.c
@@ -309,7 +309,7 @@ static void midc_descriptor_complete(struct intel_mid_dma_chan *midc,
 		callback_txd(param_txd);
 	}
 	if (midc->raw_tfr) {
-		desc->status = DMA_SUCCESS;
+		desc->status = DMA_COMPLETE;
 		if (desc->lli != NULL) {
 			pci_pool_free(desc->lli_pool, desc->lli,
 						desc->lli_phys);
@@ -481,7 +481,7 @@ static enum dma_status intel_mid_dma_tx_status(struct dma_chan *chan,
 	enum dma_status ret;
 
 	ret = dma_cookie_status(chan, cookie, txstate);
-	if (ret != DMA_SUCCESS) {
+	if (ret != DMA_COMPLETE) {
 		spin_lock_bh(&midc->lock);
 		midc_scan_descriptors(to_middma_device(chan->device), midc);
 		spin_unlock_bh(&midc->lock);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 13/28] dmaengine: ioat: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (11 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 12/28] dmaengine: intel_mid_dma: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 16:28 ` [PATCH 14/28] dmaengine: iop: " Vinod Koul
                   ` (15 subsequent siblings)
  28 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
CC: Dave Jiang <dave.jiang@intel.com>
---
 drivers/dma/ioat/dma.c    |    4 ++--
 drivers/dma/ioat/dma_v3.c |    8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c
index 5ff6fc1..a0f0fce 100644
--- a/drivers/dma/ioat/dma.c
+++ b/drivers/dma/ioat/dma.c
@@ -733,7 +733,7 @@ ioat_dma_tx_status(struct dma_chan *c, dma_cookie_t cookie,
 	enum dma_status ret;
 
 	ret = dma_cookie_status(c, cookie, txstate);
-	if (ret == DMA_SUCCESS)
+	if (ret == DMA_COMPLETE)
 		return ret;
 
 	device->cleanup_fn((unsigned long) c);
@@ -859,7 +859,7 @@ int ioat_dma_self_test(struct ioatdma_device *device)
 
 	if (tmo == 0 ||
 	    dma->device_tx_status(dma_chan, cookie, NULL)
-					!= DMA_SUCCESS) {
+					!= DMA_COMPLETE) {
 		dev_err(dev, "Self-test copy timed out, disabling\n");
 		err = -ENODEV;
 		goto unmap_dma;
diff --git a/drivers/dma/ioat/dma_v3.c b/drivers/dma/ioat/dma_v3.c
index d8ececa..806b4ce 100644
--- a/drivers/dma/ioat/dma_v3.c
+++ b/drivers/dma/ioat/dma_v3.c
@@ -807,7 +807,7 @@ ioat3_tx_status(struct dma_chan *c, dma_cookie_t cookie,
 	enum dma_status ret;
 
 	ret = dma_cookie_status(c, cookie, txstate);
-	if (ret == DMA_SUCCESS)
+	if (ret == DMA_COMPLETE)
 		return ret;
 
 	ioat3_cleanup(ioat);
@@ -1468,7 +1468,7 @@ static int ioat_xor_val_self_test(struct ioatdma_device *device)
 
 	tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000));
 
-	if (dma->device_tx_status(dma_chan, cookie, NULL) != DMA_SUCCESS) {
+	if (dma->device_tx_status(dma_chan, cookie, NULL) != DMA_COMPLETE) {
 		dev_err(dev, "Self-test xor timed out\n");
 		err = -ENODEV;
 		goto dma_unmap;
@@ -1530,7 +1530,7 @@ static int ioat_xor_val_self_test(struct ioatdma_device *device)
 
 	tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000));
 
-	if (dma->device_tx_status(dma_chan, cookie, NULL) != DMA_SUCCESS) {
+	if (dma->device_tx_status(dma_chan, cookie, NULL) != DMA_COMPLETE) {
 		dev_err(dev, "Self-test validate timed out\n");
 		err = -ENODEV;
 		goto dma_unmap;
@@ -1577,7 +1577,7 @@ static int ioat_xor_val_self_test(struct ioatdma_device *device)
 
 	tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000));
 
-	if (dma->device_tx_status(dma_chan, cookie, NULL) != DMA_SUCCESS) {
+	if (dma->device_tx_status(dma_chan, cookie, NULL) != DMA_COMPLETE) {
 		dev_err(dev, "Self-test 2nd validate timed out\n");
 		err = -ENODEV;
 		goto dma_unmap;
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 14/28] dmaengine: iop: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (12 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 13/28] dmaengine: ioat: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 16:28 ` [PATCH 15/28] dmaengine: k3dma: " Vinod Koul
                   ` (14 subsequent siblings)
  28 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 drivers/dma/iop-adma.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c
index dd8b44a..408fe6b 100644
--- a/drivers/dma/iop-adma.c
+++ b/drivers/dma/iop-adma.c
@@ -864,7 +864,7 @@ static enum dma_status iop_adma_status(struct dma_chan *chan,
 	int ret;
 
 	ret = dma_cookie_status(chan, cookie, txstate);
-	if (ret == DMA_SUCCESS)
+	if (ret == DMA_COMPLETE)
 		return ret;
 
 	iop_adma_slot_cleanup(iop_chan);
@@ -983,7 +983,7 @@ static int iop_adma_memcpy_self_test(struct iop_adma_device *device)
 	msleep(1);
 
 	if (iop_adma_status(dma_chan, cookie, NULL) !=
-			DMA_SUCCESS) {
+			DMA_COMPLETE) {
 		dev_err(dma_chan->device->dev,
 			"Self-test copy timed out, disabling\n");
 		err = -ENODEV;
@@ -1083,7 +1083,7 @@ iop_adma_xor_val_self_test(struct iop_adma_device *device)
 	msleep(8);
 
 	if (iop_adma_status(dma_chan, cookie, NULL) !=
-		DMA_SUCCESS) {
+		DMA_COMPLETE) {
 		dev_err(dma_chan->device->dev,
 			"Self-test xor timed out, disabling\n");
 		err = -ENODEV;
@@ -1129,7 +1129,7 @@ iop_adma_xor_val_self_test(struct iop_adma_device *device)
 	iop_adma_issue_pending(dma_chan);
 	msleep(8);
 
-	if (iop_adma_status(dma_chan, cookie, NULL) != DMA_SUCCESS) {
+	if (iop_adma_status(dma_chan, cookie, NULL) != DMA_COMPLETE) {
 		dev_err(dma_chan->device->dev,
 			"Self-test zero sum timed out, disabling\n");
 		err = -ENODEV;
@@ -1158,7 +1158,7 @@ iop_adma_xor_val_self_test(struct iop_adma_device *device)
 	iop_adma_issue_pending(dma_chan);
 	msleep(8);
 
-	if (iop_adma_status(dma_chan, cookie, NULL) != DMA_SUCCESS) {
+	if (iop_adma_status(dma_chan, cookie, NULL) != DMA_COMPLETE) {
 		dev_err(dma_chan->device->dev,
 			"Self-test non-zero sum timed out, disabling\n");
 		err = -ENODEV;
@@ -1254,7 +1254,7 @@ iop_adma_pq_zero_sum_self_test(struct iop_adma_device *device)
 	msleep(8);
 
 	if (iop_adma_status(dma_chan, cookie, NULL) !=
-		DMA_SUCCESS) {
+		DMA_COMPLETE) {
 		dev_err(dev, "Self-test pq timed out, disabling\n");
 		err = -ENODEV;
 		goto free_resources;
@@ -1291,7 +1291,7 @@ iop_adma_pq_zero_sum_self_test(struct iop_adma_device *device)
 	msleep(8);
 
 	if (iop_adma_status(dma_chan, cookie, NULL) !=
-		DMA_SUCCESS) {
+		DMA_COMPLETE) {
 		dev_err(dev, "Self-test pq-zero-sum timed out, disabling\n");
 		err = -ENODEV;
 		goto free_resources;
@@ -1323,7 +1323,7 @@ iop_adma_pq_zero_sum_self_test(struct iop_adma_device *device)
 	msleep(8);
 
 	if (iop_adma_status(dma_chan, cookie, NULL) !=
-		DMA_SUCCESS) {
+		DMA_COMPLETE) {
 		dev_err(dev, "Self-test !pq-zero-sum timed out, disabling\n");
 		err = -ENODEV;
 		goto free_resources;
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 15/28] dmaengine: k3dma: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (13 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 14/28] dmaengine: iop: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-17 14:18   ` zhangfei gao
  2013-10-16 16:28 ` [PATCH 16/28] dmaengine: mmp_tdma: " Vinod Koul
                   ` (13 subsequent siblings)
  28 siblings, 1 reply; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
CC: Zhangfei Gao <zhangfei.gao@linaro.org>
---
 drivers/dma/k3dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c
index da43062..e260754 100644
--- a/drivers/dma/k3dma.c
+++ b/drivers/dma/k3dma.c
@@ -344,7 +344,7 @@ static enum dma_status k3_dma_tx_status(struct dma_chan *chan,
 	size_t bytes = 0;
 
 	ret = dma_cookie_status(&c->vc.chan, cookie, state);
-	if (ret == DMA_SUCCESS)
+	if (ret == DMA_COMPLETE)
 		return ret;
 
 	spin_lock_irqsave(&c->vc.lock, flags);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 16/28] dmaengine: mmp_tdma: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (14 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 15/28] dmaengine: k3dma: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-17 14:19   ` zhangfei gao
  2013-10-16 16:28 ` [PATCH 17/28] dmaengine: mv_xor: " Vinod Koul
                   ` (12 subsequent siblings)
  28 siblings, 1 reply; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
CC: Zhangfei Gao <zhangfei.gao@gmail.com>
---
 drivers/dma/mmp_tdma.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c
index 8f3e865..2b4026d 100644
--- a/drivers/dma/mmp_tdma.c
+++ b/drivers/dma/mmp_tdma.c
@@ -163,7 +163,7 @@ static void mmp_tdma_disable_chan(struct mmp_tdma_chan *tdmac)
 	/* disable irq */
 	writel(0, tdmac->reg_base + TDIMR);
 
-	tdmac->status = DMA_SUCCESS;
+	tdmac->status = DMA_COMPLETE;
 }
 
 static void mmp_tdma_resume_chan(struct mmp_tdma_chan *tdmac)
@@ -398,7 +398,7 @@ static struct dma_async_tx_descriptor *mmp_tdma_prep_dma_cyclic(
 	int num_periods = buf_len / period_len;
 	int i = 0, buf = 0;
 
-	if (tdmac->status != DMA_SUCCESS)
+	if (tdmac->status != DMA_COMPLETE)
 		return NULL;
 
 	if (period_len > TDMA_MAX_XFER_BYTES) {
@@ -532,7 +532,7 @@ static int mmp_tdma_chan_init(struct mmp_tdma_device *tdev,
 	tdmac->idx	   = idx;
 	tdmac->type	   = type;
 	tdmac->reg_base	   = (unsigned long)tdev->base + idx * 4;
-	tdmac->status = DMA_SUCCESS;
+	tdmac->status = DMA_COMPLETE;
 	tdev->tdmac[tdmac->idx] = tdmac;
 	tasklet_init(&tdmac->tasklet, dma_do_tasklet, (unsigned long)tdmac);
 
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 17/28] dmaengine: mv_xor: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (15 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 16/28] dmaengine: mmp_tdma: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 16:28 ` [PATCH 18/28] dmaengine: mxs-dma: " Vinod Koul
                   ` (11 subsequent siblings)
  28 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 drivers/dma/mv_xor.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index 536dcb8..8d5bce9 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -749,7 +749,7 @@ static enum dma_status mv_xor_status(struct dma_chan *chan,
 	enum dma_status ret;
 
 	ret = dma_cookie_status(chan, cookie, txstate);
-	if (ret == DMA_SUCCESS) {
+	if (ret == DMA_COMPLETE) {
 		mv_xor_clean_completed_slots(mv_chan);
 		return ret;
 	}
@@ -874,7 +874,7 @@ static int mv_xor_memcpy_self_test(struct mv_xor_chan *mv_chan)
 	msleep(1);
 
 	if (mv_xor_status(dma_chan, cookie, NULL) !=
-	    DMA_SUCCESS) {
+	    DMA_COMPLETE) {
 		dev_err(dma_chan->device->dev,
 			"Self-test copy timed out, disabling\n");
 		err = -ENODEV;
@@ -968,7 +968,7 @@ mv_xor_xor_self_test(struct mv_xor_chan *mv_chan)
 	msleep(8);
 
 	if (mv_xor_status(dma_chan, cookie, NULL) !=
-	    DMA_SUCCESS) {
+	    DMA_COMPLETE) {
 		dev_err(dma_chan->device->dev,
 			"Self-test xor timed out, disabling\n");
 		err = -ENODEV;
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 18/28] dmaengine: mxs-dma: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (16 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 17/28] dmaengine: mv_xor: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 16:28 ` [PATCH 19/28] dmaengine: omap: " Vinod Koul
                   ` (10 subsequent siblings)
  28 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
CC: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/dma/mxs-dma.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index ccd13df..7ab7cec 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -224,7 +224,7 @@ static void mxs_dma_enable_chan(struct mxs_dma_chan *mxs_chan)
 
 static void mxs_dma_disable_chan(struct mxs_dma_chan *mxs_chan)
 {
-	mxs_chan->status = DMA_SUCCESS;
+	mxs_chan->status = DMA_COMPLETE;
 }
 
 static void mxs_dma_pause_chan(struct mxs_dma_chan *mxs_chan)
@@ -312,12 +312,12 @@ static irqreturn_t mxs_dma_int_handler(int irq, void *dev_id)
 			if (mxs_chan->flags & MXS_DMA_SG_LOOP)
 				mxs_chan->status = DMA_IN_PROGRESS;
 			else
-				mxs_chan->status = DMA_SUCCESS;
+				mxs_chan->status = DMA_COMPLETE;
 		}
 
 		stat1 &= ~(1 << channel);
 
-		if (mxs_chan->status == DMA_SUCCESS)
+		if (mxs_chan->status == DMA_COMPLETE)
 			dma_cookie_complete(&mxs_chan->desc);
 
 		/* schedule tasklet on this channel */
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 19/28] dmaengine: omap: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (17 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 18/28] dmaengine: mxs-dma: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 16:28 ` [PATCH 20/28] dmaengine: ppc4xx: " Vinod Koul
                   ` (9 subsequent siblings)
  28 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 drivers/dma/omap-dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index ec3fc4f..2f66cf4 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -248,7 +248,7 @@ static enum dma_status omap_dma_tx_status(struct dma_chan *chan,
 	unsigned long flags;
 
 	ret = dma_cookie_status(chan, cookie, txstate);
-	if (ret == DMA_SUCCESS || !txstate)
+	if (ret == DMA_COMPLETE || !txstate)
 		return ret;
 
 	spin_lock_irqsave(&c->vc.lock, flags);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 20/28] dmaengine: ppc4xx: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (18 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 19/28] dmaengine: omap: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 16:28 ` [PATCH 21/28] dmaengine: sa11x0: " Vinod Koul
                   ` (8 subsequent siblings)
  28 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
CC: Anatolij Gustschin <agust@denx.de>
---
 drivers/dma/ppc4xx/adma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c
index 370ff82..60e02ae 100644
--- a/drivers/dma/ppc4xx/adma.c
+++ b/drivers/dma/ppc4xx/adma.c
@@ -3891,7 +3891,7 @@ static enum dma_status ppc440spe_adma_tx_status(struct dma_chan *chan,
 
 	ppc440spe_chan = to_ppc440spe_adma_chan(chan);
 	ret = dma_cookie_status(chan, cookie, txstate);
-	if (ret == DMA_SUCCESS)
+	if (ret == DMA_COMPLETE)
 		return ret;
 
 	ppc440spe_adma_slot_cleanup(ppc440spe_chan);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 21/28] dmaengine: sa11x0: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (19 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 20/28] dmaengine: ppc4xx: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 16:28 ` [PATCH 22/28] dmaengine: sh: " Vinod Koul
                   ` (7 subsequent siblings)
  28 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 drivers/dma/sa11x0-dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/sa11x0-dma.c b/drivers/dma/sa11x0-dma.c
index 461a91a..ab26d46 100644
--- a/drivers/dma/sa11x0-dma.c
+++ b/drivers/dma/sa11x0-dma.c
@@ -436,7 +436,7 @@ static enum dma_status sa11x0_dma_tx_status(struct dma_chan *chan,
 	enum dma_status ret;
 
 	ret = dma_cookie_status(&c->vc.chan, cookie, state);
-	if (ret == DMA_SUCCESS)
+	if (ret == DMA_COMPLETE)
 		return ret;
 
 	if (!state)
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 22/28] dmaengine: sh: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (20 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 21/28] dmaengine: sa11x0: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 16:28 ` [PATCH 23/28] dmaengine: ste: " Vinod Koul
                   ` (6 subsequent siblings)
  28 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
CC: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
---
 drivers/dma/sh/shdma-base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/sh/shdma-base.c b/drivers/dma/sh/shdma-base.c
index d94ab59..2e7b394 100644
--- a/drivers/dma/sh/shdma-base.c
+++ b/drivers/dma/sh/shdma-base.c
@@ -724,7 +724,7 @@ static enum dma_status shdma_tx_status(struct dma_chan *chan,
 	 * If we don't find cookie on the queue, it has been aborted and we have
 	 * to report error
 	 */
-	if (status != DMA_SUCCESS) {
+	if (status != DMA_COMPLETE) {
 		struct shdma_desc *sdesc;
 		status = DMA_ERROR;
 		list_for_each_entry(sdesc, &schan->ld_queue, node)
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 23/28] dmaengine: ste: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (21 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 22/28] dmaengine: sh: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 16:28 ` [PATCH 24/28] dmaengine: tegra: " Vinod Koul
                   ` (5 subsequent siblings)
  28 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
CC: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/dma/ste_dma40.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 3d5e4ee..b8c031b 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -2627,7 +2627,7 @@ static enum dma_status d40_tx_status(struct dma_chan *chan,
 	}
 
 	ret = dma_cookie_status(chan, cookie, txstate);
-	if (ret != DMA_SUCCESS)
+	if (ret != DMA_COMPLETE)
 		dma_set_residue(txstate, stedma40_residue(chan));
 
 	if (d40_is_paused(d40c))
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 24/28] dmaengine: tegra: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (22 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 23/28] dmaengine: ste: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 16:28 ` [PATCH 25/28] dmaengine: txx9: " Vinod Koul
                   ` (4 subsequent siblings)
  28 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
CC: Stephen Warren <swarren@wwwdotorg.org>
---
 drivers/dma/tegra20-apb-dma.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
index 67a6752..73654e3 100644
--- a/drivers/dma/tegra20-apb-dma.c
+++ b/drivers/dma/tegra20-apb-dma.c
@@ -570,7 +570,7 @@ static void handle_once_dma_done(struct tegra_dma_channel *tdc,
 
 	list_del(&sgreq->node);
 	if (sgreq->last_sg) {
-		dma_desc->dma_status = DMA_SUCCESS;
+		dma_desc->dma_status = DMA_COMPLETE;
 		dma_cookie_complete(&dma_desc->txd);
 		if (!dma_desc->cb_count)
 			list_add_tail(&dma_desc->cb_node, &tdc->cb_desc);
@@ -768,7 +768,7 @@ static enum dma_status tegra_dma_tx_status(struct dma_chan *dc,
 	unsigned int residual;
 
 	ret = dma_cookie_status(dc, cookie, txstate);
-	if (ret == DMA_SUCCESS)
+	if (ret == DMA_COMPLETE)
 		return ret;
 
 	spin_lock_irqsave(&tdc->lock, flags);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 25/28] dmaengine: txx9: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (23 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 24/28] dmaengine: tegra: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 16:28 ` [PATCH 26/28] async_tx: " Vinod Koul
                   ` (3 subsequent siblings)
  28 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 drivers/dma/txx9dmac.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/txx9dmac.c b/drivers/dma/txx9dmac.c
index 71e8e77..c2829b4 100644
--- a/drivers/dma/txx9dmac.c
+++ b/drivers/dma/txx9dmac.c
@@ -962,8 +962,8 @@ txx9dmac_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
 	enum dma_status ret;
 
 	ret = dma_cookie_status(chan, cookie, txstate);
-	if (ret == DMA_SUCCESS)
-		return DMA_SUCCESS;
+	if (ret == DMA_COMPLETE)
+		return DMA_COMPLETE;
 
 	spin_lock_bh(&dc->lock);
 	txx9dmac_scan_descriptors(dc);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 26/28] async_tx: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (24 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 25/28] dmaengine: txx9: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 16:28 ` [PATCH 27/28] serial: sh: " Vinod Koul
                   ` (2 subsequent siblings)
  28 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 crypto/async_tx/async_tx.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/crypto/async_tx/async_tx.c b/crypto/async_tx/async_tx.c
index 7be3424..39ea479 100644
--- a/crypto/async_tx/async_tx.c
+++ b/crypto/async_tx/async_tx.c
@@ -128,7 +128,7 @@ async_tx_channel_switch(struct dma_async_tx_descriptor *depend_tx,
 		}
 		device->device_issue_pending(chan);
 	} else {
-		if (dma_wait_for_async_tx(depend_tx) != DMA_SUCCESS)
+		if (dma_wait_for_async_tx(depend_tx) != DMA_COMPLETE)
 			panic("%s: DMA error waiting for depend_tx\n",
 			      __func__);
 		tx->tx_submit(tx);
@@ -280,7 +280,7 @@ void async_tx_quiesce(struct dma_async_tx_descriptor **tx)
 		 * we are referring to the correct operation
 		 */
 		BUG_ON(async_tx_test_ack(*tx));
-		if (dma_wait_for_async_tx(*tx) != DMA_SUCCESS)
+		if (dma_wait_for_async_tx(*tx) != DMA_COMPLETE)
 			panic("%s: DMA error waiting for transaction\n",
 			      __func__);
 		async_tx_ack(*tx);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 27/28] serial: sh: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (25 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 26/28] async_tx: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-16 20:17   ` Greg Kroah-Hartman
  2013-10-16 16:28 ` [PATCH 28/28] net: " Vinod Koul
  2013-10-17  9:00 ` [PATCH 00/28]: dmaengine: " Linus Walleij
  28 siblings, 1 reply; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Greg, pls ack this as it has depedency on my tree

 drivers/tty/serial/sh-sci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 5377502..7d8103c 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1433,7 +1433,7 @@ static void work_fn_rx(struct work_struct *work)
 	desc = s->desc_rx[new];
 
 	if (dma_async_is_tx_complete(s->chan_rx, s->active_rx, NULL, NULL) !=
-	    DMA_SUCCESS) {
+	    DMA_COMPLETE) {
 		/* Handle incomplete DMA receive */
 		struct dma_chan *chan = s->chan_rx;
 		struct shdma_desc *sh_desc = container_of(desc,
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 28/28] net: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (26 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 27/28] serial: sh: " Vinod Koul
@ 2013-10-16 16:28 ` Vinod Koul
  2013-10-17  2:16   ` [PATCH 29/29] dmaengine: remove unused DMA_SUCCESS Vinod Koul
  2013-10-17  4:55   ` [PATCH 28/28] net: use DMA_COMPLETE for dma completion status David Miller
  2013-10-17  9:00 ` [PATCH 00/28]: dmaengine: " Linus Walleij
  28 siblings, 2 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-16 16:28 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
CC: "David S. Miller" <davem@davemloft.net>
---
David pls ack this as it has dependency on my tree

 net/ipv4/tcp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 6e5617b..d2652fb 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1429,7 +1429,7 @@ static void tcp_service_net_dma(struct sock *sk, bool wait)
 	do {
 		if (dma_async_is_tx_complete(tp->ucopy.dma_chan,
 					      last_issued, &done,
-					      &used) == DMA_SUCCESS) {
+					      &used) == DMA_COMPLETE) {
 			/* Safe to free early-copied skbs now */
 			__skb_queue_purge(&sk->sk_async_wait_queue);
 			break;
@@ -1437,7 +1437,7 @@ static void tcp_service_net_dma(struct sock *sk, bool wait)
 			struct sk_buff *skb;
 			while ((skb = skb_peek(&sk->sk_async_wait_queue)) &&
 			       (dma_async_is_complete(skb->dma_cookie, done,
-						      used) == DMA_SUCCESS)) {
+						      used) == DMA_COMPLETE)) {
 				__skb_dequeue(&sk->sk_async_wait_queue);
 				kfree_skb(skb);
 			}
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 ` [PATCH 01/28] " Vinod Koul
@ 2013-10-16 18:29   ` Guennadi Liakhovetski
  2013-10-16 18:45     ` Dan Williams
  0 siblings, 1 reply; 59+ messages in thread
From: Guennadi Liakhovetski @ 2013-10-16 18:29 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Vinod,

On Wed, 16 Oct 2013, Vinod Koul wrote:

> the DMA_SUCCESS is a misnomer as dmaengine indicates the transfer is complete and
> gives no guarantee of the transfer success. Hence we should use DMA_COMPLTE
> instead of DMA_SUCCESS
> 
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> ---
>  drivers/dma/dmaengine.c   |    2 +-
>  include/linux/dmaengine.h |   12 ++++++------
>  2 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
> index 9162ac8..81d8765 100644
> --- a/drivers/dma/dmaengine.c
> +++ b/drivers/dma/dmaengine.c
> @@ -1062,7 +1062,7 @@ dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx)
>  	unsigned long dma_sync_wait_timeout = jiffies + msecs_to_jiffies(5000);
>  
>  	if (!tx)
> -		return DMA_SUCCESS;
> +		return DMA_COMPLETE;
>  
>  	while (tx->cookie == -EBUSY) {
>  		if (time_after_eq(jiffies, dma_sync_wait_timeout)) {
> diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
> index 0bc7275..4b460a6 100644
> --- a/include/linux/dmaengine.h
> +++ b/include/linux/dmaengine.h
> @@ -45,13 +45,13 @@ static inline int dma_submit_error(dma_cookie_t cookie)
>  
>  /**
>   * enum dma_status - DMA transaction status
> - * @DMA_SUCCESS: transaction completed successfully
> + * @DMA_COMPLETE: transaction completed
>   * @DMA_IN_PROGRESS: transaction not yet processed
>   * @DMA_PAUSED: transaction is paused
>   * @DMA_ERROR: transaction failed
>   */
>  enum dma_status {
> -	DMA_SUCCESS,
> +	DMA_COMPLETE,
>  	DMA_IN_PROGRESS,
>  	DMA_PAUSED,
>  	DMA_ERROR,

Doesn't this break kernel compilation for a total of 27 commits? Or am I 
missing anything?

Thanks
Guennadi

> @@ -979,10 +979,10 @@ static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie,
>  {
>  	if (last_complete <= last_used) {
>  		if ((cookie <= last_complete) || (cookie > last_used))
> -			return DMA_SUCCESS;
> +			return DMA_COMPLETE;
>  	} else {
>  		if ((cookie <= last_complete) && (cookie > last_used))
> -			return DMA_SUCCESS;
> +			return DMA_COMPLETE;
>  	}
>  	return DMA_IN_PROGRESS;
>  }
> @@ -1013,11 +1013,11 @@ static inline struct dma_chan *dma_find_channel(enum dma_transaction_type tx_typ
>  }
>  static inline enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie)
>  {
> -	return DMA_SUCCESS;
> +	return DMA_COMPLETE;
>  }
>  static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx)
>  {
> -	return DMA_SUCCESS;
> +	return DMA_COMPLETE;
>  }
>  static inline void dma_issue_pending_all(void)
>  {
> -- 
> 1.7.0.4
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-10-16 18:29   ` Guennadi Liakhovetski
@ 2013-10-16 18:45     ` Dan Williams
  2013-10-17  2:07       ` Vinod Koul
  0 siblings, 1 reply; 59+ messages in thread
From: Dan Williams @ 2013-10-16 18:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Oct 16, 2013 at 11:29 AM, Guennadi Liakhovetski
<g.liakhovetski@gmx.de> wrote:
> Hi Vinod,
>
> On Wed, 16 Oct 2013, Vinod Koul wrote:
>
>> the DMA_SUCCESS is a misnomer as dmaengine indicates the transfer is complete and
>> gives no guarantee of the transfer success. Hence we should use DMA_COMPLTE
>> instead of DMA_SUCCESS
>>
>> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
>> ---
>>  drivers/dma/dmaengine.c   |    2 +-
>>  include/linux/dmaengine.h |   12 ++++++------
>>  2 files changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
>> index 9162ac8..81d8765 100644
>> --- a/drivers/dma/dmaengine.c
>> +++ b/drivers/dma/dmaengine.c
>> @@ -1062,7 +1062,7 @@ dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx)
>>       unsigned long dma_sync_wait_timeout = jiffies + msecs_to_jiffies(5000);
>>
>>       if (!tx)
>> -             return DMA_SUCCESS;
>> +             return DMA_COMPLETE;
>>
>>       while (tx->cookie == -EBUSY) {
>>               if (time_after_eq(jiffies, dma_sync_wait_timeout)) {
>> diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
>> index 0bc7275..4b460a6 100644
>> --- a/include/linux/dmaengine.h
>> +++ b/include/linux/dmaengine.h
>> @@ -45,13 +45,13 @@ static inline int dma_submit_error(dma_cookie_t cookie)
>>
>>  /**
>>   * enum dma_status - DMA transaction status
>> - * @DMA_SUCCESS: transaction completed successfully
>> + * @DMA_COMPLETE: transaction completed
>>   * @DMA_IN_PROGRESS: transaction not yet processed
>>   * @DMA_PAUSED: transaction is paused
>>   * @DMA_ERROR: transaction failed
>>   */
>>  enum dma_status {
>> -     DMA_SUCCESS,
>> +     DMA_COMPLETE,
>>       DMA_IN_PROGRESS,
>>       DMA_PAUSED,
>>       DMA_ERROR,
>
> Doesn't this break kernel compilation for a total of 27 commits? Or am I
> missing anything?

Yes, I think at the start DMA_COMPLETE should just be a alias for
DMA_SUCCESS, then after all the driver renames are in delete
DMA_SUCCESS.

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 27/28] serial: sh: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 ` [PATCH 27/28] serial: sh: " Vinod Koul
@ 2013-10-16 20:17   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 59+ messages in thread
From: Greg Kroah-Hartman @ 2013-10-16 20:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Oct 16, 2013 at 09:58:45PM +0530, Vinod Koul wrote:
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> Greg, pls ack this as it has depedency on my tree

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 09/28] dmaengine: edma: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 ` [PATCH 09/28] dmaengine: edma: " Vinod Koul
@ 2013-10-17  0:31   ` Joel Fernandes
  0 siblings, 0 replies; 59+ messages in thread
From: Joel Fernandes @ 2013-10-17  0:31 UTC (permalink / raw)
  To: linux-arm-kernel

On 10/16/2013 11:28 AM, Vinod Koul wrote:
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> CC: Joel Fernandes <joelf@ti.com>

The audio davinci-pcm driver once converted to dmaengine usage would be the
first user of tx_status so I will get to testing this patch better then.

Anyway, with this patch applied I compile-tested and boot-tested it and it
doesn't appear to break anything.

Tested-by: Joel Fernandes <joelf@ti.com>

thanks,

-Joel

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-10-16 18:45     ` Dan Williams
@ 2013-10-17  2:07       ` Vinod Koul
  2013-10-17  8:27         ` Guennadi Liakhovetski
  2013-10-17 14:27         ` Sebastian Andrzej Siewior
  0 siblings, 2 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-17  2:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Oct 16, 2013 at 11:45:48AM -0700, Dan Williams wrote:
> On Wed, Oct 16, 2013 at 11:29 AM, Guennadi Liakhovetski
> >
> > Doesn't this break kernel compilation for a total of 27 commits? Or am I
> > missing anything?
> 
> Yes, I think at the start DMA_COMPLETE should just be a alias for
> DMA_SUCCESS, then after all the driver renames are in delete
> DMA_SUCCESS.
Oops, taht was bad of me. ffixes in v2 and sending patch 29 for removal case

--

>From 7768309422a1345d32857974fe8b57805adfd561 Mon Sep 17 00:00:00 2001
From: Vinod Koul <vinod.koul@intel.com>
Date: Wed, 16 Oct 2013 13:29:02 +0530
Subject: [PATCH] dmaengine: use DMA_COMPLETE for dma completion status

the DMA_SUCCESS is a misnomer as dmaengine indicates the transfer is complete and
gives no guarantee of the transfer success. Hence we should use DMA_COMPLTE
instead of DMA_SUCCESS

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 drivers/dma/dmaengine.c   |    2 +-
 include/linux/dmaengine.h |   13 +++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index 9162ac8..81d8765 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -1062,7 +1062,7 @@ dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx)
 	unsigned long dma_sync_wait_timeout = jiffies + msecs_to_jiffies(5000);
 
 	if (!tx)
-		return DMA_SUCCESS;
+		return DMA_COMPLETE;
 
 	while (tx->cookie == -EBUSY) {
 		if (time_after_eq(jiffies, dma_sync_wait_timeout)) {
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 0bc7275..683c380 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -45,16 +45,17 @@ static inline int dma_submit_error(dma_cookie_t cookie)
 
 /**
  * enum dma_status - DMA transaction status
- * @DMA_SUCCESS: transaction completed successfully
+ * @DMA_COMPLETE: transaction completed
  * @DMA_IN_PROGRESS: transaction not yet processed
  * @DMA_PAUSED: transaction is paused
  * @DMA_ERROR: transaction failed
  */
 enum dma_status {
-	DMA_SUCCESS,
+	DMA_COMPLETE,
 	DMA_IN_PROGRESS,
 	DMA_PAUSED,
 	DMA_ERROR,
+	DMA_SUCCESS,
 };
 
 /**
@@ -979,10 +980,10 @@ static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie,
 {
 	if (last_complete <= last_used) {
 		if ((cookie <= last_complete) || (cookie > last_used))
-			return DMA_SUCCESS;
+			return DMA_COMPLETE;
 	} else {
 		if ((cookie <= last_complete) && (cookie > last_used))
-			return DMA_SUCCESS;
+			return DMA_COMPLETE;
 	}
 	return DMA_IN_PROGRESS;
 }
@@ -1013,11 +1014,11 @@ static inline struct dma_chan *dma_find_channel(enum dma_transaction_type tx_typ
 }
 static inline enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie)
 {
-	return DMA_SUCCESS;
+	return DMA_COMPLETE;
 }
 static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx)
 {
-	return DMA_SUCCESS;
+	return DMA_COMPLETE;
 }
 static inline void dma_issue_pending_all(void)
 {
-- 
1.7.0.4

-- 

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 29/29] dmaengine: remove unused DMA_SUCCESS
  2013-10-16 16:28 ` [PATCH 28/28] net: " Vinod Koul
@ 2013-10-17  2:16   ` Vinod Koul
  2013-10-17  4:55   ` [PATCH 28/28] net: use DMA_COMPLETE for dma completion status David Miller
  1 sibling, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-17  2:16 UTC (permalink / raw)
  To: linux-arm-kernel

after all the users are converted

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 include/linux/dmaengine.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 683c380..4b460a6 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -55,7 +55,6 @@ enum dma_status {
 	DMA_IN_PROGRESS,
 	DMA_PAUSED,
 	DMA_ERROR,
-	DMA_SUCCESS,
 };
 
 /**
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 28/28] net: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 ` [PATCH 28/28] net: " Vinod Koul
  2013-10-17  2:16   ` [PATCH 29/29] dmaengine: remove unused DMA_SUCCESS Vinod Koul
@ 2013-10-17  4:55   ` David Miller
  1 sibling, 0 replies; 59+ messages in thread
From: David Miller @ 2013-10-17  4:55 UTC (permalink / raw)
  To: linux-arm-kernel

From: Vinod Koul <vinod.koul@intel.com>
Date: Wed, 16 Oct 2013 21:58:46 +0530

> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> CC: "David S. Miller" <davem@davemloft.net>

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 03/28] dmaengine: at_hdma: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 ` [PATCH 03/28] dmaengine: at_hdma: " Vinod Koul
@ 2013-10-17  8:08   ` Nicolas Ferre
  0 siblings, 0 replies; 59+ messages in thread
From: Nicolas Ferre @ 2013-10-17  8:08 UTC (permalink / raw)
  To: linux-arm-kernel

On 16/10/2013 18:28, Vinod Koul :
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> CC: Nicolas Ferre <nicolas.ferre@atmel.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

> ---
>   drivers/dma/at_hdmac.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
> index c787f38..1ef7457 100644
> --- a/drivers/dma/at_hdmac.c
> +++ b/drivers/dma/at_hdmac.c
> @@ -1102,7 +1102,7 @@ atc_tx_status(struct dma_chan *chan,
>   	int bytes = 0;
>
>   	ret = dma_cookie_status(chan, cookie, txstate);
> -	if (ret == DMA_SUCCESS)
> +	if (ret == DMA_COMPLETE)
>   		return ret;
>   	/*
>   	 * There's no point calculating the residue if there's
>


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-10-17  2:07       ` Vinod Koul
@ 2013-10-17  8:27         ` Guennadi Liakhovetski
  2013-10-17  9:53           ` Vinod Koul
  2013-10-17 14:27         ` Sebastian Andrzej Siewior
  1 sibling, 1 reply; 59+ messages in thread
From: Guennadi Liakhovetski @ 2013-10-17  8:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 17 Oct 2013, Vinod Koul wrote:

> On Wed, Oct 16, 2013 at 11:45:48AM -0700, Dan Williams wrote:
> > On Wed, Oct 16, 2013 at 11:29 AM, Guennadi Liakhovetski
> > >
> > > Doesn't this break kernel compilation for a total of 27 commits? Or am I
> > > missing anything?
> > 
> > Yes, I think at the start DMA_COMPLETE should just be a alias for
> > DMA_SUCCESS, then after all the driver renames are in delete
> > DMA_SUCCESS.
> Oops, taht was bad of me. ffixes in v2 and sending patch 29 for removal case

Ok, yes, this should work now. I'm wondering though - is DMA_COMPLTE 
really a better name? AFAICS, we can only differentiate between 2 
possibilities with the current API: a transfer is "in progress" - between 
last used and last completed, and "unknown" - either completed, or 
aborted, or not yet submitted - if the cookie is larger, than last 
completed and we assume, that it has wrapped.

Actually for a driver, that I'm currently working on, I implemented a 
cache of N last cookies (e.g. 128), which is a bitfield, where I just 
record a 1, if that descriptor has failed, and a 0, if completed 
successfully. That way I can report one of 4 states: cookie on queue, 
completed successfully, failed, unknown. I'm not sure, whether I'll keep 
this in the final version, this doesn't really fit the present dmaengine 
API concept. We could make this generic, if desired. Otherwise your 
proposed error callback should help too. But in either case I think with 
the current implementation we cannot find out whether a specific cookie 
completed successfully or failed.

One more observation: I looked at a couple of drivers, using the DMA_ERROR 
state. E.g. mmp_tdma.c, mxs-dma.c. They store errors in a .status field in 
their private data. Then they return that status in their 
.device_tx_status() methods - independent on the cookie! This doesn't look 
right to me... at_hdmac.c does something similarly strange.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
                   ` (27 preceding siblings ...)
  2013-10-16 16:28 ` [PATCH 28/28] net: " Vinod Koul
@ 2013-10-17  9:00 ` Linus Walleij
  28 siblings, 0 replies; 59+ messages in thread
From: Linus Walleij @ 2013-10-17  9:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Oct 16, 2013 at 6:28 PM, Vinod Koul <vinod.koul@intel.com> wrote:

> As we recently discussed in [1], the DMA_SUCCESS is an misnomer. The dmaengine
> does not acknowledge that dma completed succesfully. It can only signal dma was
> completed by it. Hence we should use DMA_COMPLTE as status instead of
> DMA_SUCCESS
>
> [1]: http://www.spinics.net/lists/arm-kernel/msg278346.html

This make things more clear. The series:
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-10-17  8:27         ` Guennadi Liakhovetski
@ 2013-10-17  9:53           ` Vinod Koul
  0 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-17  9:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Oct 17, 2013 at 10:27:13AM +0200, Guennadi Liakhovetski wrote:
> On Thu, 17 Oct 2013, Vinod Koul wrote:
> 
> > On Wed, Oct 16, 2013 at 11:45:48AM -0700, Dan Williams wrote:
> > > On Wed, Oct 16, 2013 at 11:29 AM, Guennadi Liakhovetski
> > > >
> > > > Doesn't this break kernel compilation for a total of 27 commits? Or am I
> > > > missing anything?
> > > 
> > > Yes, I think at the start DMA_COMPLETE should just be a alias for
> > > DMA_SUCCESS, then after all the driver renames are in delete
> > > DMA_SUCCESS.
> > Oops, taht was bad of me. ffixes in v2 and sending patch 29 for removal case
> 
> Ok, yes, this should work now. I'm wondering though - is DMA_COMPLTE 
> really a better name? AFAICS, we can only differentiate between 2 
> possibilities with the current API: a transfer is "in progress" - between 
> last used and last completed, and "unknown" - either completed, or 
> aborted, or not yet submitted - if the cookie is larger, than last 
> completed and we assume, that it has wrapped.
well, once you submit N, and chekcing status, if you get last > N, then you
assume it completed. If last is M then M is completed and M + 1 running and rest
in queue. You know which one is last submitted in client

> Actually for a driver, that I'm currently working on, I implemented a 
> cache of N last cookies (e.g. 128), which is a bitfield, where I just 
> record a 1, if that descriptor has failed, and a 0, if completed 
> successfully. That way I can report one of 4 states: cookie on queue, 
> completed successfully, failed, unknown. I'm not sure, whether I'll keep 
> this in the final version, this doesn't really fit the present dmaengine 
> API concept. We could make this generic, if desired. Otherwise your 
> proposed error callback should help too. But in either case I think with 
> the current implementation we cannot find out whether a specific cookie 
> completed successfully or failed.
The propsed error callback will tell you if dmaengine detected a failure or not.
That should with above cover well

> One more observation: I looked at a couple of drivers, using the DMA_ERROR 
> state. E.g. mmp_tdma.c, mxs-dma.c. They store errors in a .status field in 
> their private data. Then they return that status in their 
> .device_tx_status() methods - independent on the cookie! This doesn't look 
> right to me... at_hdmac.c does something similarly strange.
Yup bunch of ones arent being good citizens..

~Vinod
-- 

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 08/28] dmaengine: dw: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 ` [PATCH 08/28] dmaengine: dw: " Vinod Koul
@ 2013-10-17 13:43   ` Andy Shevchenko
  2013-10-21  7:33   ` Viresh Kumar
  1 sibling, 0 replies; 59+ messages in thread
From: Andy Shevchenko @ 2013-10-17 13:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2013-10-16 at 21:58 +0530, Vinod Koul wrote:
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> CC: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  drivers/dma/dw/core.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
> index 89eb89f..2c29331 100644
> --- a/drivers/dma/dw/core.c
> +++ b/drivers/dma/dw/core.c
> @@ -1098,13 +1098,13 @@ dwc_tx_status(struct dma_chan *chan,
>  	enum dma_status		ret;
>  
>  	ret = dma_cookie_status(chan, cookie, txstate);
> -	if (ret == DMA_SUCCESS)
> +	if (ret == DMA_COMPLETE)
>  		return ret;
>  
>  	dwc_scan_descriptors(to_dw_dma(chan->device), dwc);
>  
>  	ret = dma_cookie_status(chan, cookie, txstate);
> -	if (ret != DMA_SUCCESS)
> +	if (ret != DMA_COMPLETE)
>  		dma_set_residue(txstate, dwc_get_residue(dwc));
>  
>  	if (dwc->paused && ret == DMA_IN_PROGRESS)

Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-10-17 14:27         ` Sebastian Andrzej Siewior
@ 2013-10-17 13:48           ` Vinod Koul
  2013-10-24 21:28             ` Guennadi Liakhovetski
  2013-10-17 14:39           ` Guennadi Liakhovetski
  1 sibling, 1 reply; 59+ messages in thread
From: Vinod Koul @ 2013-10-17 13:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Oct 17, 2013 at 04:27:55PM +0200, Sebastian Andrzej Siewior wrote:
> On Thu, Oct 17, 2013 at 07:37:45AM +0530, Vinod Koul wrote:
> > index 0bc7275..683c380 100644
> > --- a/include/linux/dmaengine.h
> > +++ b/include/linux/dmaengine.h
> > @@ -45,16 +45,17 @@ static inline int dma_submit_error(dma_cookie_t cookie)
> >  
> >  /**
> >   * enum dma_status - DMA transaction status
> > - * @DMA_SUCCESS: transaction completed successfully
> > + * @DMA_COMPLETE: transaction completed
> >   * @DMA_IN_PROGRESS: transaction not yet processed
> >   * @DMA_PAUSED: transaction is paused
> >   * @DMA_ERROR: transaction failed
> >   */
> >  enum dma_status {
> > -	DMA_SUCCESS,
> > +	DMA_COMPLETE,
> >  	DMA_IN_PROGRESS,
> >  	DMA_PAUSED,
> >  	DMA_ERROR,
> > +	DMA_SUCCESS,
> >  };
> 
> There are some drivers which compare against == or != DMA_SUCCESS. Shouldn't this
> become
>   enum dma_status {
>  -	DMA_SUCCESS,
>  +	DMA_COMPLETE = 0, DMA_SUCCESS = 0,
>   	DMA_IN_PROGRESS,
>   	DMA_PAUSED,
>   	DMA_ERROR,
>   };
> 
> so nothing breaks during the transition?
Yes i missed it in first place update the patch to fix that

~Vinod

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 15/28] dmaengine: k3dma: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 ` [PATCH 15/28] dmaengine: k3dma: " Vinod Koul
@ 2013-10-17 14:18   ` zhangfei gao
  0 siblings, 0 replies; 59+ messages in thread
From: zhangfei gao @ 2013-10-17 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Oct 17, 2013 at 12:28 AM, Vinod Koul <vinod.koul@intel.com> wrote:
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> CC: Zhangfei Gao <zhangfei.gao@linaro.org>

Thanks Vinod

 Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 16/28] dmaengine: mmp_tdma: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 ` [PATCH 16/28] dmaengine: mmp_tdma: " Vinod Koul
@ 2013-10-17 14:19   ` zhangfei gao
  0 siblings, 0 replies; 59+ messages in thread
From: zhangfei gao @ 2013-10-17 14:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Oct 17, 2013 at 12:28 AM, Vinod Koul <vinod.koul@intel.com> wrote:
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> CC: Zhangfei Gao <zhangfei.gao@gmail.com>

Thanks Vinod

Acked-by: Zhangfei Gao <zhangfei.gao@gmail.com>

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-10-17  2:07       ` Vinod Koul
  2013-10-17  8:27         ` Guennadi Liakhovetski
@ 2013-10-17 14:27         ` Sebastian Andrzej Siewior
  2013-10-17 13:48           ` Vinod Koul
  2013-10-17 14:39           ` Guennadi Liakhovetski
  1 sibling, 2 replies; 59+ messages in thread
From: Sebastian Andrzej Siewior @ 2013-10-17 14:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Oct 17, 2013 at 07:37:45AM +0530, Vinod Koul wrote:
> index 0bc7275..683c380 100644
> --- a/include/linux/dmaengine.h
> +++ b/include/linux/dmaengine.h
> @@ -45,16 +45,17 @@ static inline int dma_submit_error(dma_cookie_t cookie)
>  
>  /**
>   * enum dma_status - DMA transaction status
> - * @DMA_SUCCESS: transaction completed successfully
> + * @DMA_COMPLETE: transaction completed
>   * @DMA_IN_PROGRESS: transaction not yet processed
>   * @DMA_PAUSED: transaction is paused
>   * @DMA_ERROR: transaction failed
>   */
>  enum dma_status {
> -	DMA_SUCCESS,
> +	DMA_COMPLETE,
>  	DMA_IN_PROGRESS,
>  	DMA_PAUSED,
>  	DMA_ERROR,
> +	DMA_SUCCESS,
>  };

There are some drivers which compare against == or != DMA_SUCCESS. Shouldn't this
become
  enum dma_status {
 -	DMA_SUCCESS,
 +	DMA_COMPLETE = 0, DMA_SUCCESS = 0,
  	DMA_IN_PROGRESS,
  	DMA_PAUSED,
  	DMA_ERROR,
  };

so nothing breaks during the transition?

Sebastian

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-10-17 14:27         ` Sebastian Andrzej Siewior
  2013-10-17 13:48           ` Vinod Koul
@ 2013-10-17 14:39           ` Guennadi Liakhovetski
  1 sibling, 0 replies; 59+ messages in thread
From: Guennadi Liakhovetski @ 2013-10-17 14:39 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Sebastian

On Thu, 17 Oct 2013, Sebastian Andrzej Siewior wrote:

> On Thu, Oct 17, 2013 at 07:37:45AM +0530, Vinod Koul wrote:
> > index 0bc7275..683c380 100644
> > --- a/include/linux/dmaengine.h
> > +++ b/include/linux/dmaengine.h
> > @@ -45,16 +45,17 @@ static inline int dma_submit_error(dma_cookie_t cookie)
> >  
> >  /**
> >   * enum dma_status - DMA transaction status
> > - * @DMA_SUCCESS: transaction completed successfully
> > + * @DMA_COMPLETE: transaction completed
> >   * @DMA_IN_PROGRESS: transaction not yet processed
> >   * @DMA_PAUSED: transaction is paused
> >   * @DMA_ERROR: transaction failed
> >   */
> >  enum dma_status {
> > -	DMA_SUCCESS,
> > +	DMA_COMPLETE,
> >  	DMA_IN_PROGRESS,
> >  	DMA_PAUSED,
> >  	DMA_ERROR,
> > +	DMA_SUCCESS,
> >  };
> 
> There are some drivers which compare against == or != DMA_SUCCESS. Shouldn't this
> become
>   enum dma_status {
>  -	DMA_SUCCESS,
>  +	DMA_COMPLETE = 0, DMA_SUCCESS = 0,
>   	DMA_IN_PROGRESS,
>   	DMA_PAUSED,
>   	DMA_ERROR,
>   };
> 
> so nothing breaks during the transition?

Good catch. I would do

 enum dma_status {
-	DMA_SUCCESS,
+	DMA_COMPLETE,
 	DMA_IN_PROGRESS,
 	DMA_PAUSED,
 	DMA_ERROR,
 };
 
+ #define DMA_SUCCESS DMA_COMPLETE

and then just remove the last line again

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 08/28] dmaengine: dw: use DMA_COMPLETE for dma completion status
  2013-10-16 16:28 ` [PATCH 08/28] dmaengine: dw: " Vinod Koul
  2013-10-17 13:43   ` Andy Shevchenko
@ 2013-10-21  7:33   ` Viresh Kumar
  1 sibling, 0 replies; 59+ messages in thread
From: Viresh Kumar @ 2013-10-21  7:33 UTC (permalink / raw)
  To: linux-arm-kernel

On 16 October 2013 21:58, Vinod Koul <vinod.koul@intel.com> wrote:
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> CC: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  drivers/dma/dw/core.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
> index 89eb89f..2c29331 100644
> --- a/drivers/dma/dw/core.c
> +++ b/drivers/dma/dw/core.c
> @@ -1098,13 +1098,13 @@ dwc_tx_status(struct dma_chan *chan,
>         enum dma_status         ret;
>
>         ret = dma_cookie_status(chan, cookie, txstate);
> -       if (ret == DMA_SUCCESS)
> +       if (ret == DMA_COMPLETE)
>                 return ret;
>
>         dwc_scan_descriptors(to_dw_dma(chan->device), dwc);
>
>         ret = dma_cookie_status(chan, cookie, txstate);
> -       if (ret != DMA_SUCCESS)
> +       if (ret != DMA_COMPLETE)
>                 dma_set_residue(txstate, dwc_get_residue(dwc));
>
>         if (dwc->paused && ret == DMA_IN_PROGRESS)

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-10-17 13:48           ` Vinod Koul
@ 2013-10-24 21:28             ` Guennadi Liakhovetski
  2013-10-25  4:23               ` Vinod Koul
  0 siblings, 1 reply; 59+ messages in thread
From: Guennadi Liakhovetski @ 2013-10-24 21:28 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Vinod

On Thu, 17 Oct 2013, Vinod Koul wrote:

> On Thu, Oct 17, 2013 at 04:27:55PM +0200, Sebastian Andrzej Siewior wrote:
> > On Thu, Oct 17, 2013 at 07:37:45AM +0530, Vinod Koul wrote:
> > > index 0bc7275..683c380 100644
> > > --- a/include/linux/dmaengine.h
> > > +++ b/include/linux/dmaengine.h
> > > @@ -45,16 +45,17 @@ static inline int dma_submit_error(dma_cookie_t cookie)
> > >  
> > >  /**
> > >   * enum dma_status - DMA transaction status
> > > - * @DMA_SUCCESS: transaction completed successfully
> > > + * @DMA_COMPLETE: transaction completed
> > >   * @DMA_IN_PROGRESS: transaction not yet processed
> > >   * @DMA_PAUSED: transaction is paused
> > >   * @DMA_ERROR: transaction failed
> > >   */
> > >  enum dma_status {
> > > -	DMA_SUCCESS,
> > > +	DMA_COMPLETE,
> > >  	DMA_IN_PROGRESS,
> > >  	DMA_PAUSED,
> > >  	DMA_ERROR,
> > > +	DMA_SUCCESS,
> > >  };
> > 
> > There are some drivers which compare against == or != DMA_SUCCESS. Shouldn't this
> > become
> >   enum dma_status {
> >  -	DMA_SUCCESS,
> >  +	DMA_COMPLETE = 0, DMA_SUCCESS = 0,
> >   	DMA_IN_PROGRESS,
> >   	DMA_PAUSED,
> >   	DMA_ERROR,
> >   };
> > 
> > so nothing breaks during the transition?
> Yes i missed it in first place update the patch to fix that

Are you planning to post a fixed version of this patch or you just fix it 
internally? Would be good to have it posted to be able to ack it and other 
relevant patches.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-10-24 21:28             ` Guennadi Liakhovetski
@ 2013-10-25  4:23               ` Vinod Koul
  2013-10-25  6:32                 ` Guennadi Liakhovetski
  0 siblings, 1 reply; 59+ messages in thread
From: Vinod Koul @ 2013-10-25  4:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Oct 24, 2013 at 11:28:29PM +0200, Guennadi Liakhovetski wrote:
> Hi Vinod
> 
> On Thu, 17 Oct 2013, Vinod Koul wrote:
> > Yes i missed it in first place update the patch to fix that
> 
> Are you planning to post a fixed version of this patch or you just fix it 
> internally? Would be good to have it posted to be able to ack it and other 
> relevant patches.
looks like you missed it... I had posted updated patch [1] in this thread here
and I posted 29th patch as removal one [2]

Both were pushed to -next after few days

[1]: http://marc.info/?l=linux-kernel&m=138197886521699&w=2
[2]: http://marc.info/?l=linux-kernel&m=138197936321767&w=2

-- 
~Vinod

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-10-25  6:32                 ` Guennadi Liakhovetski
@ 2013-10-25  5:43                   ` Vinod Koul
  2013-10-25  6:43                     ` Guennadi Liakhovetski
  0 siblings, 1 reply; 59+ messages in thread
From: Vinod Koul @ 2013-10-25  5:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Oct 25, 2013 at 08:32:12AM +0200, Guennadi Liakhovetski wrote:
> Hi Vinod
> 
> On Fri, 25 Oct 2013, Vinod Koul wrote:
> 
> > On Thu, Oct 24, 2013 at 11:28:29PM +0200, Guennadi Liakhovetski wrote:
> > > Hi Vinod
> > > 
> > > On Thu, 17 Oct 2013, Vinod Koul wrote:
> > > > Yes i missed it in first place update the patch to fix that
> > > 
> > > Are you planning to post a fixed version of this patch or you just fix it 
> > > internally? Would be good to have it posted to be able to ack it and other 
> > > relevant patches.
> > looks like you missed it... I had posted updated patch [1] in this thread here
> > and I posted 29th patch as removal one [2]
> 
> No, I didn't miss those, but as Sebastian pointed out and as I commented 
> too, also that v2 version wasn't correct, so, a fixed v3 was needed. 
> Consider this:
> 
> In patch 1 you do:
> 
> diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
> index 0bc7275..683c380 100644
> --- a/include/linux/dmaengine.h
> +++ b/include/linux/dmaengine.h
> @@ -45,16 +45,17 @@ static inline int dma_submit_error(dma_cookie_t cookie)
>  
>  /**
>   * enum dma_status - DMA transaction status
> - * @DMA_SUCCESS: transaction completed successfully
> + * @DMA_COMPLETE: transaction completed
>   * @DMA_IN_PROGRESS: transaction not yet processed
>   * @DMA_PAUSED: transaction is paused
>   * @DMA_ERROR: transaction failed
>   */
>  enum dma_status {
> -	DMA_SUCCESS,
> +	DMA_COMPLETE,
>  	DMA_IN_PROGRESS,
>  	DMA_PAUSED,
>  	DMA_ERROR,
> +	DMA_SUCCESS,
>  };
>  
>  /**
> 
> and then in a couple of places
> 
> -			return DMA_SUCCESS;
> +			return DMA_COMPLETE;
> 
> So, after that your patch dmaengine would be returning DMA_COMPLETE in 
> case of success, i.e. 0. But all the DMAC and user drivers would still be 
> checking for
> 
> 	if (status != DMA_COMPLETE) {
> 
> i.e. comparing status with 4 and thus detecting false errors, until your 
> further 28 patches fix them. That's why, as Sebastian pointed out it was 
> important to define DMA_COMPLETE and DMA_SUCCESS with the _same_ numerical 
> value in your patch 1.
Sure, I will fix this up now as suggested

  enum dma_status {
 -	DMA_SUCCESS,
 +	DMA_COMPLETE = 0, DMA_SUCCESS = 0,

Thanks for poiting out.

--
~Vinod

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-10-25  4:23               ` Vinod Koul
@ 2013-10-25  6:32                 ` Guennadi Liakhovetski
  2013-10-25  5:43                   ` Vinod Koul
  0 siblings, 1 reply; 59+ messages in thread
From: Guennadi Liakhovetski @ 2013-10-25  6:32 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Vinod

On Fri, 25 Oct 2013, Vinod Koul wrote:

> On Thu, Oct 24, 2013 at 11:28:29PM +0200, Guennadi Liakhovetski wrote:
> > Hi Vinod
> > 
> > On Thu, 17 Oct 2013, Vinod Koul wrote:
> > > Yes i missed it in first place update the patch to fix that
> > 
> > Are you planning to post a fixed version of this patch or you just fix it 
> > internally? Would be good to have it posted to be able to ack it and other 
> > relevant patches.
> looks like you missed it... I had posted updated patch [1] in this thread here
> and I posted 29th patch as removal one [2]

No, I didn't miss those, but as Sebastian pointed out and as I commented 
too, also that v2 version wasn't correct, so, a fixed v3 was needed. 
Consider this:

In patch 1 you do:

diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 0bc7275..683c380 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -45,16 +45,17 @@ static inline int dma_submit_error(dma_cookie_t cookie)
 
 /**
  * enum dma_status - DMA transaction status
- * @DMA_SUCCESS: transaction completed successfully
+ * @DMA_COMPLETE: transaction completed
  * @DMA_IN_PROGRESS: transaction not yet processed
  * @DMA_PAUSED: transaction is paused
  * @DMA_ERROR: transaction failed
  */
 enum dma_status {
-	DMA_SUCCESS,
+	DMA_COMPLETE,
 	DMA_IN_PROGRESS,
 	DMA_PAUSED,
 	DMA_ERROR,
+	DMA_SUCCESS,
 };
 
 /**

and then in a couple of places

-			return DMA_SUCCESS;
+			return DMA_COMPLETE;

So, after that your patch dmaengine would be returning DMA_COMPLETE in 
case of success, i.e. 0. But all the DMAC and user drivers would still be 
checking for

	if (status != DMA_COMPLETE) {

i.e. comparing status with 4 and thus detecting false errors, until your 
further 28 patches fix them. That's why, as Sebastian pointed out it was 
important to define DMA_COMPLETE and DMA_SUCCESS with the _same_ numerical 
value in your patch 1.

> Both were pushed to -next after few days

That's a pity, but I still don't see them in upstream -next, so, maybe 
it's still possible to fix?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-10-25  5:43                   ` Vinod Koul
@ 2013-10-25  6:43                     ` Guennadi Liakhovetski
  2013-10-29 16:47                       ` Olof Johansson
  0 siblings, 1 reply; 59+ messages in thread
From: Guennadi Liakhovetski @ 2013-10-25  6:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 25 Oct 2013, Vinod Koul wrote:

> On Fri, Oct 25, 2013 at 08:32:12AM +0200, Guennadi Liakhovetski wrote:
> > Hi Vinod
> > 
> > On Fri, 25 Oct 2013, Vinod Koul wrote:
> > 
> > > On Thu, Oct 24, 2013 at 11:28:29PM +0200, Guennadi Liakhovetski wrote:
> > > > Hi Vinod
> > > > 
> > > > On Thu, 17 Oct 2013, Vinod Koul wrote:
> > > > > Yes i missed it in first place update the patch to fix that
> > > > 
> > > > Are you planning to post a fixed version of this patch or you just fix it 
> > > > internally? Would be good to have it posted to be able to ack it and other 
> > > > relevant patches.
> > > looks like you missed it... I had posted updated patch [1] in this thread here
> > > and I posted 29th patch as removal one [2]
> > 
> > No, I didn't miss those, but as Sebastian pointed out and as I commented 
> > too, also that v2 version wasn't correct, so, a fixed v3 was needed. 
> > Consider this:
> > 
> > In patch 1 you do:
> > 
> > diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
> > index 0bc7275..683c380 100644
> > --- a/include/linux/dmaengine.h
> > +++ b/include/linux/dmaengine.h
> > @@ -45,16 +45,17 @@ static inline int dma_submit_error(dma_cookie_t cookie)
> >  
> >  /**
> >   * enum dma_status - DMA transaction status
> > - * @DMA_SUCCESS: transaction completed successfully
> > + * @DMA_COMPLETE: transaction completed
> >   * @DMA_IN_PROGRESS: transaction not yet processed
> >   * @DMA_PAUSED: transaction is paused
> >   * @DMA_ERROR: transaction failed
> >   */
> >  enum dma_status {
> > -	DMA_SUCCESS,
> > +	DMA_COMPLETE,
> >  	DMA_IN_PROGRESS,
> >  	DMA_PAUSED,
> >  	DMA_ERROR,
> > +	DMA_SUCCESS,
> >  };
> >  
> >  /**
> > 
> > and then in a couple of places
> > 
> > -			return DMA_SUCCESS;
> > +			return DMA_COMPLETE;
> > 
> > So, after that your patch dmaengine would be returning DMA_COMPLETE in 
> > case of success, i.e. 0. But all the DMAC and user drivers would still be 
> > checking for
> > 
> > 	if (status != DMA_COMPLETE) {
> > 
> > i.e. comparing status with 4 and thus detecting false errors, until your 
> > further 28 patches fix them. That's why, as Sebastian pointed out it was 
> > important to define DMA_COMPLETE and DMA_SUCCESS with the _same_ numerical 
> > value in your patch 1.
> Sure, I will fix this up now as suggested
> 
>   enum dma_status {
>  -	DMA_SUCCESS,
>  +	DMA_COMPLETE = 0, DMA_SUCCESS = 0,
> 
> Thanks for poiting out.

Great! In my reply to Sebastian I proposed an equivlent but slightly 
different version:

 enum dma_status {
-	DMA_SUCCESS,
+	DMA_COMPLETE,
 	DMA_IN_PROGRESS,
 	DMA_PAUSED,
 	DMA_ERROR,
 };
 
+ #define DMA_SUCCESS DMA_COMPLETE

but it doesn't really matter. Feel free to use whichever version you 
prefer.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-10-25  6:43                     ` Guennadi Liakhovetski
@ 2013-10-29 16:47                       ` Olof Johansson
  2013-10-30 13:03                         ` Vinod Koul
  0 siblings, 1 reply; 59+ messages in thread
From: Olof Johansson @ 2013-10-29 16:47 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Thu, Oct 24, 2013 at 11:43 PM, Guennadi Liakhovetski
<g.liakhovetski@gmx.de> wrote:
> On Fri, 25 Oct 2013, Vinod Koul wrote:
>
>> On Fri, Oct 25, 2013 at 08:32:12AM +0200, Guennadi Liakhovetski wrote:
>> > Hi Vinod
>> >
>> > On Fri, 25 Oct 2013, Vinod Koul wrote:
>> >
>> > > On Thu, Oct 24, 2013 at 11:28:29PM +0200, Guennadi Liakhovetski wrote:
>> > > > Hi Vinod
>> > > >
>> > > > On Thu, 17 Oct 2013, Vinod Koul wrote:
>> > > > > Yes i missed it in first place update the patch to fix that
>> > > >
>> > > > Are you planning to post a fixed version of this patch or you just fix it
>> > > > internally? Would be good to have it posted to be able to ack it and other
>> > > > relevant patches.
>> > > looks like you missed it... I had posted updated patch [1] in this thread here
>> > > and I posted 29th patch as removal one [2]
>> >
>> > No, I didn't miss those, but as Sebastian pointed out and as I commented
>> > too, also that v2 version wasn't correct, so, a fixed v3 was needed.
>> > Consider this:
>> >
>> > In patch 1 you do:
>> >
>> > diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
>> > index 0bc7275..683c380 100644
>> > --- a/include/linux/dmaengine.h
>> > +++ b/include/linux/dmaengine.h
>> > @@ -45,16 +45,17 @@ static inline int dma_submit_error(dma_cookie_t cookie)
>> >
>> >  /**
>> >   * enum dma_status - DMA transaction status
>> > - * @DMA_SUCCESS: transaction completed successfully
>> > + * @DMA_COMPLETE: transaction completed
>> >   * @DMA_IN_PROGRESS: transaction not yet processed
>> >   * @DMA_PAUSED: transaction is paused
>> >   * @DMA_ERROR: transaction failed
>> >   */
>> >  enum dma_status {
>> > -   DMA_SUCCESS,
>> > +   DMA_COMPLETE,
>> >     DMA_IN_PROGRESS,
>> >     DMA_PAUSED,
>> >     DMA_ERROR,
>> > +   DMA_SUCCESS,
>> >  };
>> >
>> >  /**
>> >
>> > and then in a couple of places
>> >
>> > -                   return DMA_SUCCESS;
>> > +                   return DMA_COMPLETE;
>> >
>> > So, after that your patch dmaengine would be returning DMA_COMPLETE in
>> > case of success, i.e. 0. But all the DMAC and user drivers would still be
>> > checking for
>> >
>> >     if (status != DMA_COMPLETE) {
>> >
>> > i.e. comparing status with 4 and thus detecting false errors, until your
>> > further 28 patches fix them. That's why, as Sebastian pointed out it was
>> > important to define DMA_COMPLETE and DMA_SUCCESS with the _same_ numerical
>> > value in your patch 1.
>> Sure, I will fix this up now as suggested
>>
>>   enum dma_status {
>>  -    DMA_SUCCESS,
>>  +    DMA_COMPLETE = 0, DMA_SUCCESS = 0,
>>
>> Thanks for poiting out.
>
> Great! In my reply to Sebastian I proposed an equivlent but slightly
> different version:
>
>  enum dma_status {
> -       DMA_SUCCESS,
> +       DMA_COMPLETE,
>         DMA_IN_PROGRESS,
>         DMA_PAUSED,
>         DMA_ERROR,
>  };
>
> + #define DMA_SUCCESS DMA_COMPLETE
>
> but it doesn't really matter. Feel free to use whichever version you
> prefer.


This patch broke some TI platforms (using edma) due to namespace
conflicts. The error is:

../../include/linux/dmaengine.h:54:2: error: expected identifier
before numeric constant   (for DMA_COMPLETE)

.. it's because they define DMA_COMPLETE in include/platform_data/edma.h.

The edma driver seems to overall lack prefixes and thus pollutes
global namespaces, so it should be fixed up.


-Olof

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-10-29 16:47                       ` Olof Johansson
@ 2013-10-30 13:03                         ` Vinod Koul
  2013-11-04 12:51                           ` Sebastian Andrzej Siewior
  2013-11-11 19:13                           ` Olof Johansson
  0 siblings, 2 replies; 59+ messages in thread
From: Vinod Koul @ 2013-10-30 13:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Oct 29, 2013 at 09:47:55AM -0700, Olof Johansson wrote:
> This patch broke some TI platforms (using edma) due to namespace
> conflicts. The error is:
> 
> ../../include/linux/dmaengine.h:54:2: error: expected identifier
> before numeric constant   (for DMA_COMPLETE)
> 
> .. it's because they define DMA_COMPLETE in include/platform_data/edma.h.
> 
> The edma driver seems to overall lack prefixes and thus pollutes
> global namespaces, so it should be fixed up.
Yup this needs some work.

I fixed up the error with below, can you pls verify. Pls note this is compile
tested only!

-----><8---------------------------

From: Vinod Koul <vinod.koul@intel.com>
Date: Wed, 30 Oct 2013 18:22:30 +0530
Subject: [PATCH] dmanengine: fix edma driver to not define DMA_COMPLETE

edma header defines DMA_COMPLETE, this causes issues as commit adfedd9a32e4 move
DMA_SUCCESS to DMA_COMPLETE. edma should properly namespace its defines and
needs a future fix

Reported-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 arch/arm/common/edma.c             |    4 ++--
 drivers/dma/edma.c                 |    4 ++--
 include/linux/platform_data/edma.h |    8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
index 8e1a024..41bca32 100644
--- a/arch/arm/common/edma.c
+++ b/arch/arm/common/edma.c
@@ -404,7 +404,7 @@ static irqreturn_t dma_irq_handler(int irq, void *data)
 					BIT(slot));
 			if (edma_cc[ctlr]->intr_data[channel].callback)
 				edma_cc[ctlr]->intr_data[channel].callback(
-					channel, DMA_COMPLETE,
+					channel, EDMA_DMA_COMPLETE,
 					edma_cc[ctlr]->intr_data[channel].data);
 		}
 	} while (sh_ipr);
@@ -459,7 +459,7 @@ static irqreturn_t dma_ccerr_handler(int irq, void *data)
 								callback) {
 						edma_cc[ctlr]->intr_data[k].
 						callback(k,
-						DMA_CC_ERROR,
+						EDMA_DMA_CC_ERROR,
 						edma_cc[ctlr]->intr_data
 						[k].data);
 					}
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 29fa358..cb69f3a 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -407,7 +407,7 @@ static void edma_callback(unsigned ch_num, u16 ch_status, void *data)
 	edma_pause(echan->ch_num);
 
 	switch (ch_status) {
-	case DMA_COMPLETE:
+	case EDMA_DMA_COMPLETE:
 		spin_lock_irqsave(&echan->vchan.lock, flags);
 
 		edesc = echan->edesc;
@@ -426,7 +426,7 @@ static void edma_callback(unsigned ch_num, u16 ch_status, void *data)
 		spin_unlock_irqrestore(&echan->vchan.lock, flags);
 
 		break;
-	case DMA_CC_ERROR:
+	case EDMA_DMA_CC_ERROR:
 		spin_lock_irqsave(&echan->vchan.lock, flags);
 
 		edma_read_slot(EDMA_CHAN_SLOT(echan->slot[0]), &p);
diff --git a/include/linux/platform_data/edma.h b/include/linux/platform_data/edma.h
index 179fb91..f50821c 100644
--- a/include/linux/platform_data/edma.h
+++ b/include/linux/platform_data/edma.h
@@ -67,10 +67,10 @@ struct edmacc_param {
 #define ITCCHEN		BIT(23)
 
 /*ch_status paramater of callback function possible values*/
-#define DMA_COMPLETE 1
-#define DMA_CC_ERROR 2
-#define DMA_TC1_ERROR 3
-#define DMA_TC2_ERROR 4
+#define EDMA_DMA_COMPLETE 1
+#define EDMA_DMA_CC_ERROR 2
+#define EDMA_DMA_TC1_ERROR 3
+#define EDMA_DMA_TC2_ERROR 4
 
 enum address_mode {
 	INCR = 0,
-- 
1.7.0.4

--
~Vinod

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-10-30 13:03                         ` Vinod Koul
@ 2013-11-04 12:51                           ` Sebastian Andrzej Siewior
  2013-11-11 19:13                           ` Olof Johansson
  1 sibling, 0 replies; 59+ messages in thread
From: Sebastian Andrzej Siewior @ 2013-11-04 12:51 UTC (permalink / raw)
  To: linux-arm-kernel

On 30.10.13, Vinod Koul wrote:
> I fixed up the error with below, can you pls verify. Pls note this is compile
> tested only!

I tested this and my mmc driver using edma via drivers/dma seems to
work.
Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

However you missed one piece:

  CC [M]  sound/soc/davinci/davinci-pcm.o
sound/soc/davinci/davinci-pcm.c: In function ?davinci_pcm_dma_irq?:
sound/soc/davinci/davinci-pcm.c:241: error: ?DMA_COMPLETE? undeclared (first use in this function)
sound/soc/davinci/davinci-pcm.c:241: error: (Each undeclared identifier is reported only once
sound/soc/davinci/davinci-pcm.c:241: error: for each function it appears in.)

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 sound/soc/davinci/davinci-pcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c
index 8460edc..e68ba31 100644
--- a/sound/soc/davinci/davinci-pcm.c
+++ b/sound/soc/davinci/davinci-pcm.c
@@ -238,7 +238,7 @@ static void davinci_pcm_dma_irq(unsigned link, u16 ch_status, void *data)
 	print_buf_info(prtd->ram_channel, "i ram_channel");
 	pr_debug("davinci_pcm: link=%d, status=0x%x\n", link, ch_status);
 
-	if (unlikely(ch_status != DMA_COMPLETE))
+	if (unlikely(ch_status != EDMA_DMA_COMPLETE))
 		return;
 
 	if (snd_pcm_running(substream)) {
-- 
1.8.4.rc3

Sebastian

^ permalink raw reply related	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-10-30 13:03                         ` Vinod Koul
  2013-11-04 12:51                           ` Sebastian Andrzej Siewior
@ 2013-11-11 19:13                           ` Olof Johansson
  2013-11-12  4:00                             ` Vinod Koul
  1 sibling, 1 reply; 59+ messages in thread
From: Olof Johansson @ 2013-11-11 19:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Oct 30, 2013 at 06:33:25PM +0530, Vinod Koul wrote:
> On Tue, Oct 29, 2013 at 09:47:55AM -0700, Olof Johansson wrote:
> > This patch broke some TI platforms (using edma) due to namespace
> > conflicts. The error is:
> > 
> > ../../include/linux/dmaengine.h:54:2: error: expected identifier
> > before numeric constant   (for DMA_COMPLETE)
> > 
> > .. it's because they define DMA_COMPLETE in include/platform_data/edma.h.
> > 
> > The edma driver seems to overall lack prefixes and thus pollutes
> > global namespaces, so it should be fixed up.
> Yup this needs some work.
> 
> I fixed up the error with below, can you pls verify. Pls note this is compile
> tested only!
> 
> -----><8---------------------------
> 
> From: Vinod Koul <vinod.koul@intel.com>
> Date: Wed, 30 Oct 2013 18:22:30 +0530
> Subject: [PATCH] dmanengine: fix edma driver to not define DMA_COMPLETE
> 
> edma header defines DMA_COMPLETE, this causes issues as commit adfedd9a32e4 move
> DMA_SUCCESS to DMA_COMPLETE. edma should properly namespace its defines and
> needs a future fix
> 
> Reported-by: Olof Johansson <olof@lixom.net>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>

Thanks, I've applied this to fixes together with the follow-up from
Sebastian. Cc:ing Mark since it touches drivers/soc.


-Olof

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-11-11 19:13                           ` Olof Johansson
@ 2013-11-12  4:00                             ` Vinod Koul
  2013-11-12  5:11                               ` Olof Johansson
  0 siblings, 1 reply; 59+ messages in thread
From: Vinod Koul @ 2013-11-12  4:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 11, 2013 at 11:13:39AM -0800, Olof Johansson wrote:
> On Wed, Oct 30, 2013 at 06:33:25PM +0530, Vinod Koul wrote:
> > On Tue, Oct 29, 2013 at 09:47:55AM -0700, Olof Johansson wrote:
> > > This patch broke some TI platforms (using edma) due to namespace
> > > conflicts. The error is:
> > > 
> > > ../../include/linux/dmaengine.h:54:2: error: expected identifier
> > > before numeric constant   (for DMA_COMPLETE)
> > > 
> > > .. it's because they define DMA_COMPLETE in include/platform_data/edma.h.
> > > 
> > > The edma driver seems to overall lack prefixes and thus pollutes
> > > global namespaces, so it should be fixed up.
> > Yup this needs some work.
> > 
> > I fixed up the error with below, can you pls verify. Pls note this is compile
> > tested only!
> > 
> > -----><8---------------------------
> > 
> > From: Vinod Koul <vinod.koul@intel.com>
> > Date: Wed, 30 Oct 2013 18:22:30 +0530
> > Subject: [PATCH] dmanengine: fix edma driver to not define DMA_COMPLETE
> > 
> > edma header defines DMA_COMPLETE, this causes issues as commit adfedd9a32e4 move
> > DMA_SUCCESS to DMA_COMPLETE. edma should properly namespace its defines and
> > needs a future fix
> > 
> > Reported-by: Olof Johansson <olof@lixom.net>
> > Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> 
> Thanks, I've applied this to fixes together with the follow-up from
> Sebastian. Cc:ing Mark since it touches drivers/soc.
I had applied this a while back and pushed only thing remaining was Sebastian's
patch.  Since this is dependent on the series I am sending to Linus in a day ro
two, would prefer things to go thru this tree only.

Let me know if you are okay and will apply Sebastian fix on my next

--
~Vinod

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-11-12  5:11                               ` Olof Johansson
@ 2013-11-12  4:47                                 ` Vinod Koul
  0 siblings, 0 replies; 59+ messages in thread
From: Vinod Koul @ 2013-11-12  4:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 11, 2013 at 09:11:18PM -0800, Olof Johansson wrote:
> On Mon, Nov 11, 2013 at 8:00 PM, Vinod Koul <vinod.koul@intel.com> wrote:
> > On Mon, Nov 11, 2013 at 11:13:39AM -0800, Olof Johansson wrote:
> >> On Wed, Oct 30, 2013 at 06:33:25PM +0530, Vinod Koul wrote:
> >> > On Tue, Oct 29, 2013 at 09:47:55AM -0700, Olof Johansson wrote:
> >> > > This patch broke some TI platforms (using edma) due to namespace
> >> > > conflicts. The error is:
> >> > >
> >> > > ../../include/linux/dmaengine.h:54:2: error: expected identifier
> >> > > before numeric constant   (for DMA_COMPLETE)
> >> > >
> >> > > .. it's because they define DMA_COMPLETE in include/platform_data/edma.h.
> >> > >
> >> > > The edma driver seems to overall lack prefixes and thus pollutes
> >> > > global namespaces, so it should be fixed up.
> >> > Yup this needs some work.
> >> >
> >> > I fixed up the error with below, can you pls verify. Pls note this is compile
> >> > tested only!
> >> >
> >> > -----><8---------------------------
> >> >
> >> > From: Vinod Koul <vinod.koul@intel.com>
> >> > Date: Wed, 30 Oct 2013 18:22:30 +0530
> >> > Subject: [PATCH] dmanengine: fix edma driver to not define DMA_COMPLETE
> >> >
> >> > edma header defines DMA_COMPLETE, this causes issues as commit adfedd9a32e4 move
> >> > DMA_SUCCESS to DMA_COMPLETE. edma should properly namespace its defines and
> >> > needs a future fix
> >> >
> >> > Reported-by: Olof Johansson <olof@lixom.net>
> >> > Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> >>
> >> Thanks, I've applied this to fixes together with the follow-up from
> >> Sebastian. Cc:ing Mark since it touches drivers/soc.
> > I had applied this a while back and pushed only thing remaining was Sebastian's
> > patch.  Since this is dependent on the series I am sending to Linus in a day ro
> > two, would prefer things to go thru this tree only.
> >
> > Let me know if you are okay and will apply Sebastian fix on my next
> 
> Ah, go ahead -- I thought it hadn't been picked up yet since there
> were still failures (i.e. due to Sebastian's fixes). Feel free to add
> my Acked-by where you still can. :-)
Sure, applied this one

> I have a couple of small fixes to take care of warnings with LPAE
> configs that I hope to get out tonight or tomorrow morning, it'd be
> nice to see them go in too (just printk format warning fixes).
Sure, I will hold off for few more days for more coverage. Also if you/Sebastian
can check more if anything still breaks and we fix it before sending would be
good too

--
~Vinod

^ permalink raw reply	[flat|nested] 59+ messages in thread

* [PATCH 01/28] dmaengine: use DMA_COMPLETE for dma completion status
  2013-11-12  4:00                             ` Vinod Koul
@ 2013-11-12  5:11                               ` Olof Johansson
  2013-11-12  4:47                                 ` Vinod Koul
  0 siblings, 1 reply; 59+ messages in thread
From: Olof Johansson @ 2013-11-12  5:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 11, 2013 at 8:00 PM, Vinod Koul <vinod.koul@intel.com> wrote:
> On Mon, Nov 11, 2013 at 11:13:39AM -0800, Olof Johansson wrote:
>> On Wed, Oct 30, 2013 at 06:33:25PM +0530, Vinod Koul wrote:
>> > On Tue, Oct 29, 2013 at 09:47:55AM -0700, Olof Johansson wrote:
>> > > This patch broke some TI platforms (using edma) due to namespace
>> > > conflicts. The error is:
>> > >
>> > > ../../include/linux/dmaengine.h:54:2: error: expected identifier
>> > > before numeric constant   (for DMA_COMPLETE)
>> > >
>> > > .. it's because they define DMA_COMPLETE in include/platform_data/edma.h.
>> > >
>> > > The edma driver seems to overall lack prefixes and thus pollutes
>> > > global namespaces, so it should be fixed up.
>> > Yup this needs some work.
>> >
>> > I fixed up the error with below, can you pls verify. Pls note this is compile
>> > tested only!
>> >
>> > -----><8---------------------------
>> >
>> > From: Vinod Koul <vinod.koul@intel.com>
>> > Date: Wed, 30 Oct 2013 18:22:30 +0530
>> > Subject: [PATCH] dmanengine: fix edma driver to not define DMA_COMPLETE
>> >
>> > edma header defines DMA_COMPLETE, this causes issues as commit adfedd9a32e4 move
>> > DMA_SUCCESS to DMA_COMPLETE. edma should properly namespace its defines and
>> > needs a future fix
>> >
>> > Reported-by: Olof Johansson <olof@lixom.net>
>> > Signed-off-by: Vinod Koul <vinod.koul@intel.com>
>>
>> Thanks, I've applied this to fixes together with the follow-up from
>> Sebastian. Cc:ing Mark since it touches drivers/soc.
> I had applied this a while back and pushed only thing remaining was Sebastian's
> patch.  Since this is dependent on the series I am sending to Linus in a day ro
> two, would prefer things to go thru this tree only.
>
> Let me know if you are okay and will apply Sebastian fix on my next

Ah, go ahead -- I thought it hadn't been picked up yet since there
were still failures (i.e. due to Sebastian's fixes). Feel free to add
my Acked-by where you still can. :-)

I have a couple of small fixes to take care of warnings with LPAE
configs that I hope to get out tonight or tomorrow morning, it'd be
nice to see them go in too (just printk format warning fixes).


-Olof

^ permalink raw reply	[flat|nested] 59+ messages in thread

end of thread, other threads:[~2013-11-12  5:11 UTC | newest]

Thread overview: 59+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-16 16:28 [PATCH 00/28]: dmaengine: use DMA_COMPLETE for dma completion status Vinod Koul
2013-10-16 16:28 ` [PATCH 01/28] " Vinod Koul
2013-10-16 18:29   ` Guennadi Liakhovetski
2013-10-16 18:45     ` Dan Williams
2013-10-17  2:07       ` Vinod Koul
2013-10-17  8:27         ` Guennadi Liakhovetski
2013-10-17  9:53           ` Vinod Koul
2013-10-17 14:27         ` Sebastian Andrzej Siewior
2013-10-17 13:48           ` Vinod Koul
2013-10-24 21:28             ` Guennadi Liakhovetski
2013-10-25  4:23               ` Vinod Koul
2013-10-25  6:32                 ` Guennadi Liakhovetski
2013-10-25  5:43                   ` Vinod Koul
2013-10-25  6:43                     ` Guennadi Liakhovetski
2013-10-29 16:47                       ` Olof Johansson
2013-10-30 13:03                         ` Vinod Koul
2013-11-04 12:51                           ` Sebastian Andrzej Siewior
2013-11-11 19:13                           ` Olof Johansson
2013-11-12  4:00                             ` Vinod Koul
2013-11-12  5:11                               ` Olof Johansson
2013-11-12  4:47                                 ` Vinod Koul
2013-10-17 14:39           ` Guennadi Liakhovetski
2013-10-16 16:28 ` [PATCH 02/28] dmaengine: amba-pl08x: " Vinod Koul
2013-10-16 16:28 ` [PATCH 03/28] dmaengine: at_hdma: " Vinod Koul
2013-10-17  8:08   ` Nicolas Ferre
2013-10-16 16:28 ` [PATCH 04/28] dmaengine: coh901318: " Vinod Koul
2013-10-16 16:28 ` [PATCH 05/28] dmaengine: cppi41: " Vinod Koul
2013-10-16 16:28 ` [PATCH 06/28] dmaengine: jz4740: " Vinod Koul
2013-10-16 16:28 ` [PATCH 07/28] dmaengine: dmatest: " Vinod Koul
2013-10-16 16:28 ` [PATCH 08/28] dmaengine: dw: " Vinod Koul
2013-10-17 13:43   ` Andy Shevchenko
2013-10-21  7:33   ` Viresh Kumar
2013-10-16 16:28 ` [PATCH 09/28] dmaengine: edma: " Vinod Koul
2013-10-17  0:31   ` Joel Fernandes
2013-10-16 16:28 ` [PATCH 10/28] dmaengine: imx-dma: " Vinod Koul
2013-10-16 16:28 ` [PATCH 11/28] dmaengine: imx-sdma: " Vinod Koul
2013-10-16 16:28 ` [PATCH 12/28] dmaengine: intel_mid_dma: " Vinod Koul
2013-10-16 16:28 ` [PATCH 13/28] dmaengine: ioat: " Vinod Koul
2013-10-16 16:28 ` [PATCH 14/28] dmaengine: iop: " Vinod Koul
2013-10-16 16:28 ` [PATCH 15/28] dmaengine: k3dma: " Vinod Koul
2013-10-17 14:18   ` zhangfei gao
2013-10-16 16:28 ` [PATCH 16/28] dmaengine: mmp_tdma: " Vinod Koul
2013-10-17 14:19   ` zhangfei gao
2013-10-16 16:28 ` [PATCH 17/28] dmaengine: mv_xor: " Vinod Koul
2013-10-16 16:28 ` [PATCH 18/28] dmaengine: mxs-dma: " Vinod Koul
2013-10-16 16:28 ` [PATCH 19/28] dmaengine: omap: " Vinod Koul
2013-10-16 16:28 ` [PATCH 20/28] dmaengine: ppc4xx: " Vinod Koul
2013-10-16 16:28 ` [PATCH 21/28] dmaengine: sa11x0: " Vinod Koul
2013-10-16 16:28 ` [PATCH 22/28] dmaengine: sh: " Vinod Koul
2013-10-16 16:28 ` [PATCH 23/28] dmaengine: ste: " Vinod Koul
2013-10-16 16:28 ` [PATCH 24/28] dmaengine: tegra: " Vinod Koul
2013-10-16 16:28 ` [PATCH 25/28] dmaengine: txx9: " Vinod Koul
2013-10-16 16:28 ` [PATCH 26/28] async_tx: " Vinod Koul
2013-10-16 16:28 ` [PATCH 27/28] serial: sh: " Vinod Koul
2013-10-16 20:17   ` Greg Kroah-Hartman
2013-10-16 16:28 ` [PATCH 28/28] net: " Vinod Koul
2013-10-17  2:16   ` [PATCH 29/29] dmaengine: remove unused DMA_SUCCESS Vinod Koul
2013-10-17  4:55   ` [PATCH 28/28] net: use DMA_COMPLETE for dma completion status David Miller
2013-10-17  9:00 ` [PATCH 00/28]: dmaengine: " Linus Walleij

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).