netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] net: ethernet: davinci cpdma: Enable interrupt while waiting for teardown complete
@ 2013-01-18 10:06 Sebastian Andrzej Siewior
  2013-01-18 10:06 ` [PATCH 2/4] net: ethernet: davinci_cpdma: fix descriptor handling Sebastian Andrzej Siewior
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2013-01-18 10:06 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Thomas Gleixner, Rakesh Ranjan, Bruno Bittner,
	Holger Dengler, Jan Altenberg, Sebastian Andrzej Siewior

From: Thomas Gleixner <tglx@linutronix.de>

A teardown might take some time. If the other CPU is going to queue
something it will spin and wait. Dropping the lock will allow to
continue processing. It will notice that the channel is in state
teardown and will not do anything.

Cc: Rakesh Ranjan <rakesh.ranjan@vnl.in>
Cc: Bruno Bittner <Bruno.Bittner@sick.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[dengler: patch description]
Signed-off-by: Holger Dengler <dengler@linutronix.de>
[jan: forward ported]
Signed-off-by: Jan Altenberg <jan@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 drivers/net/ethernet/ti/davinci_cpdma.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c
index 4995673..dd5f2db 100644
--- a/drivers/net/ethernet/ti/davinci_cpdma.c
+++ b/drivers/net/ethernet/ti/davinci_cpdma.c
@@ -836,6 +836,8 @@ int cpdma_chan_stop(struct cpdma_chan *chan)
 	/* trigger teardown */
 	dma_reg_write(ctlr, chan->td, chan_linear(chan));
 
+	spin_unlock_irqrestore(&chan->lock, flags);
+
 	/* wait for teardown complete */
 	timeout = jiffies + HZ/10;	/* 100 msec */
 	while (time_before(jiffies, timeout)) {
@@ -845,6 +847,8 @@ int cpdma_chan_stop(struct cpdma_chan *chan)
 		cpu_relax();
 	}
 	WARN_ON(!time_before(jiffies, timeout));
+
+	spin_lock_irqsave(&chan->lock, flags);
 	chan_write(chan, cp, CPDMA_TEARDOWN_VALUE);
 
 	/* handle completed packets */
-- 
1.7.6.5

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

end of thread, other threads:[~2013-01-18 17:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-18 10:06 [PATCH 1/4] net: ethernet: davinci cpdma: Enable interrupt while waiting for teardown complete Sebastian Andrzej Siewior
2013-01-18 10:06 ` [PATCH 2/4] net: ethernet: davinci_cpdma: fix descriptor handling Sebastian Andrzej Siewior
2013-01-18 10:06 ` [PATCH 3/4] net: ethernet: ti cpsw: Split up DMA descriptor pool Sebastian Andrzej Siewior
2013-01-18 17:14   ` Mugunthan V N
2013-01-18 10:06 ` [PATCH 4/4] net: ethernet: ti cpsw: separate interrupt handler for TX, RX, and MISC Sebastian Andrzej Siewior

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