linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] dmaengine/ste_dma40: Fix implementation of issue_pending
@ 2011-06-26 21:29 Per Forlin
  2011-06-26 21:29 ` [PATCH 1/2] dmaengine/ste_dma40: add a separate queue for pending requests Per Forlin
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Per Forlin @ 2011-06-26 21:29 UTC (permalink / raw)
  To: linux-kernel, Rabin Vincent; +Cc: Vinod Koul, Per Forlin

Resolve issue pending TOOD for ste_dma40

Per Forlin (2):
  dmaengine/ste_dma40: add a separate queue for pending requests
  dmaengine: remove ste_dma40 from issue_pending TODO

 drivers/dma/TODO        |    1 -
 drivers/dma/ste_dma40.c |   26 ++++++++++++++++++++++++--
 2 files changed, 24 insertions(+), 3 deletions(-)

-- 
1.7.4.1


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

* [PATCH 1/2] dmaengine/ste_dma40: add a separate queue for pending requests
  2011-06-26 21:29 [PATCH 0/2] dmaengine/ste_dma40: Fix implementation of issue_pending Per Forlin
@ 2011-06-26 21:29 ` Per Forlin
  2011-06-26 21:29 ` [PATCH 2/2] dmaengine: remove ste_dma40 from issue_pending TODO Per Forlin
  2011-07-13 22:32 ` [PATCH 0/2] dmaengine/ste_dma40: Fix implementation of issue_pending Koul, Vinod
  2 siblings, 0 replies; 6+ messages in thread
From: Per Forlin @ 2011-06-26 21:29 UTC (permalink / raw)
  To: linux-kernel, Rabin Vincent; +Cc: Vinod Koul, Per Forlin

tx_submit will add descriptors to the pending queue. Issue pending
will then move the pending descriptors to the transfer queue.

Signed-off-by: Per Forlin <per.forlin@linaro.org>
---
 drivers/dma/ste_dma40.c |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 8f222d4..91d5ed7 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -199,6 +199,7 @@ struct d40_chan {
 	struct dma_chan			 chan;
 	struct tasklet_struct		 tasklet;
 	struct list_head		 client;
+	struct list_head		 pending_queue;
 	struct list_head		 active;
 	struct list_head		 queue;
 	struct stedma40_chan_cfg	 dma_cfg;
@@ -644,7 +645,20 @@ static struct d40_desc *d40_first_active_get(struct d40_chan *d40c)
 
 static void d40_desc_queue(struct d40_chan *d40c, struct d40_desc *desc)
 {
-	list_add_tail(&desc->node, &d40c->queue);
+	list_add_tail(&desc->node, &d40c->pending_queue);
+}
+
+static struct d40_desc *d40_first_pending(struct d40_chan *d40c)
+{
+	struct d40_desc *d;
+
+	if (list_empty(&d40c->pending_queue))
+		return NULL;
+
+	d = list_first_entry(&d40c->pending_queue,
+			     struct d40_desc,
+			     node);
+	return d;
 }
 
 static struct d40_desc *d40_first_queued(struct d40_chan *d40c)
@@ -801,6 +815,11 @@ static void d40_term_all(struct d40_chan *d40c)
 		d40_desc_free(d40c, d40d);
 	}
 
+	/* Release pending descriptors */
+	while ((d40d = d40_first_pending(d40c))) {
+		d40_desc_remove(d40d);
+		d40_desc_free(d40c, d40d);
+	}
 
 	d40c->pending_tx = 0;
 	d40c->busy = false;
@@ -2151,7 +2170,9 @@ static void d40_issue_pending(struct dma_chan *chan)
 
 	spin_lock_irqsave(&d40c->lock, flags);
 
-	/* Busy means that pending jobs are already being processed */
+	list_splice_tail_init(&d40c->pending_queue, &d40c->queue);
+
+	/* Busy means that queued jobs are already being processed */
 	if (!d40c->busy)
 		(void) d40_queue_start(d40c);
 
@@ -2340,6 +2361,7 @@ static void __init d40_chan_init(struct d40_base *base, struct dma_device *dma,
 
 		INIT_LIST_HEAD(&d40c->active);
 		INIT_LIST_HEAD(&d40c->queue);
+		INIT_LIST_HEAD(&d40c->pending_queue);
 		INIT_LIST_HEAD(&d40c->client);
 
 		tasklet_init(&d40c->tasklet, dma_tasklet,
-- 
1.7.4.1


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

* [PATCH 2/2] dmaengine: remove ste_dma40 from issue_pending TODO
  2011-06-26 21:29 [PATCH 0/2] dmaengine/ste_dma40: Fix implementation of issue_pending Per Forlin
  2011-06-26 21:29 ` [PATCH 1/2] dmaengine/ste_dma40: add a separate queue for pending requests Per Forlin
@ 2011-06-26 21:29 ` Per Forlin
  2011-07-07  2:00   ` Vinod Koul
  2011-07-13 22:32 ` [PATCH 0/2] dmaengine/ste_dma40: Fix implementation of issue_pending Koul, Vinod
  2 siblings, 1 reply; 6+ messages in thread
From: Per Forlin @ 2011-06-26 21:29 UTC (permalink / raw)
  To: linux-kernel, Rabin Vincent; +Cc: Vinod Koul, Per Forlin

ste_dma40 now implements issue_pending according to documentation.
Submit adds descriptos to a pending queue with are flushed down to the DMAC
at issue_pending.

Signed-off-by: Per Forlin <per.forlin@linaro.org>
---
 drivers/dma/TODO |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/TODO b/drivers/dma/TODO
index a4af858..734ed02 100644
--- a/drivers/dma/TODO
+++ b/drivers/dma/TODO
@@ -9,6 +9,5 @@ TODO for slave dma
 	- mxs-dma.c
 	- dw_dmac
 	- intel_mid_dma
-	- ste_dma40
 4. Check other subsystems for dma drivers and merge/move to dmaengine
 5. Remove dma_slave_config's dma direction.
-- 
1.7.4.1


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

* Re: [PATCH 2/2] dmaengine: remove ste_dma40 from issue_pending TODO
  2011-06-26 21:29 ` [PATCH 2/2] dmaengine: remove ste_dma40 from issue_pending TODO Per Forlin
@ 2011-07-07  2:00   ` Vinod Koul
  2011-07-07 14:27     ` Linus Walleij
  0 siblings, 1 reply; 6+ messages in thread
From: Vinod Koul @ 2011-07-07  2:00 UTC (permalink / raw)
  To: Per Forlin; +Cc: linux-kernel, Rabin Vincent

On Sun, 2011-06-26 at 23:29 +0200, Per Forlin wrote:
> ste_dma40 now implements issue_pending according to documentation.
> Submit adds descriptos to a pending queue with are flushed down to the DMAC
> at issue_pending.
> 
> Signed-off-by: Per Forlin <per.forlin@linaro.org>
How about the client driver which are currently using this driver, wont
they break as they would be calling submit and not issue_pending...?

> ---
>  drivers/dma/TODO |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/dma/TODO b/drivers/dma/TODO
> index a4af858..734ed02 100644
> --- a/drivers/dma/TODO
> +++ b/drivers/dma/TODO
> @@ -9,6 +9,5 @@ TODO for slave dma
>  	- mxs-dma.c
>  	- dw_dmac
>  	- intel_mid_dma
> -	- ste_dma40
>  4. Check other subsystems for dma drivers and merge/move to dmaengine
>  5. Remove dma_slave_config's dma direction.

-- 
~Vinod Koul
Intel Corp.


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

* Re: [PATCH 2/2] dmaengine: remove ste_dma40 from issue_pending TODO
  2011-07-07  2:00   ` Vinod Koul
@ 2011-07-07 14:27     ` Linus Walleij
  0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2011-07-07 14:27 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Per Forlin, linux-kernel, Rabin Vincent

2011/7/7 Vinod Koul <vkoul@infradead.org>:
> On Sun, 2011-06-26 at 23:29 +0200, Per Forlin wrote:
>> ste_dma40 now implements issue_pending according to documentation.
>> Submit adds descriptos to a pending queue with are flushed down to the DMAC
>> at issue_pending.
>>
>> Signed-off-by: Per Forlin <per.forlin@linaro.org>
> How about the client driver which are currently using this driver, wont
> they break as they would be calling submit and not issue_pending...?

They all call both, so it works fine. First submit() then issue_pending()
in sucession.

In-tree drivers:
drivers/tty/serial/amba-pl011.c
drivers/mmc/host/mmci.c
drivers/spi/spi-pl022.c

So:
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Thanks,
Linus Walleij

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

* Re: [PATCH 0/2] dmaengine/ste_dma40: Fix implementation of issue_pending
  2011-06-26 21:29 [PATCH 0/2] dmaengine/ste_dma40: Fix implementation of issue_pending Per Forlin
  2011-06-26 21:29 ` [PATCH 1/2] dmaengine/ste_dma40: add a separate queue for pending requests Per Forlin
  2011-06-26 21:29 ` [PATCH 2/2] dmaengine: remove ste_dma40 from issue_pending TODO Per Forlin
@ 2011-07-13 22:32 ` Koul, Vinod
  2 siblings, 0 replies; 6+ messages in thread
From: Koul, Vinod @ 2011-07-13 22:32 UTC (permalink / raw)
  To: Per Forlin; +Cc: linux-kernel, Rabin Vincent

On Sun, 2011-06-26 at 23:29 +0200, Per Forlin wrote:
> Resolve issue pending TOOD for ste_dma40
> 
> Per Forlin (2):
>   dmaengine/ste_dma40: add a separate queue for pending requests
>   dmaengine: remove ste_dma40 from issue_pending TODO
> 
>  drivers/dma/TODO        |    1 -
>  drivers/dma/ste_dma40.c |   26 ++++++++++++++++++++++++--
>  2 files changed, 24 insertions(+), 3 deletions(-)
> 

Applied, Thanks
-- 
~Vinod


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

end of thread, other threads:[~2011-07-13 23:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-26 21:29 [PATCH 0/2] dmaengine/ste_dma40: Fix implementation of issue_pending Per Forlin
2011-06-26 21:29 ` [PATCH 1/2] dmaengine/ste_dma40: add a separate queue for pending requests Per Forlin
2011-06-26 21:29 ` [PATCH 2/2] dmaengine: remove ste_dma40 from issue_pending TODO Per Forlin
2011-07-07  2:00   ` Vinod Koul
2011-07-07 14:27     ` Linus Walleij
2011-07-13 22:32 ` [PATCH 0/2] dmaengine/ste_dma40: Fix implementation of issue_pending Koul, Vinod

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