From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
To: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Thomas Gleixner <tglx@linutronix.de>,
Rakesh Ranjan <rakesh.ranjan@vnl.in>,
Bruno Bittner <Bruno.Bittner@sick.com>,
Holger Dengler <dengler@linutronix.de>,
Jan Altenberg <jan@linutronix.de>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: [PATCH 1/4] net: ethernet: davinci cpdma: Enable interrupt while waiting for teardown complete
Date: Fri, 18 Jan 2013 11:06:09 +0100 [thread overview]
Message-ID: <1358503572-5057-1-git-send-email-sebastian@breakpoint.cc> (raw)
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
next reply other threads:[~2013-01-18 10:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-18 10:06 Sebastian Andrzej Siewior [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1358503572-5057-1-git-send-email-sebastian@breakpoint.cc \
--to=sebastian@breakpoint.cc \
--cc=Bruno.Bittner@sick.com \
--cc=bigeasy@linutronix.de \
--cc=davem@davemloft.net \
--cc=dengler@linutronix.de \
--cc=jan@linutronix.de \
--cc=netdev@vger.kernel.org \
--cc=rakesh.ranjan@vnl.in \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).