From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
tglx@linutronix.de,
Anna-Maria Gleixner <anna-maria@linutronix.de>,
Steffen Klassert <klassert@mathematik.tu-chemnitz.de>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: [PATCH 3/4] net: 3com: 3c59x: Pull locking out of ISR
Date: Fri, 4 May 2018 17:17:48 +0200 [thread overview]
Message-ID: <20180504151749.6966-4-bigeasy@linutronix.de> (raw)
In-Reply-To: <20180504151749.6966-1-bigeasy@linutronix.de>
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
Locking is done in the same way in _vortex_interrupt() and
_boomerang_interrupt(). To prevent duplication, move the locking into the
calling vortex_boomerang_interrupt() function.
No functional change.
Cc: Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
drivers/net/ethernet/3com/3c59x.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c
index 0cfdb07f3e59..fdafe25da153 100644
--- a/drivers/net/ethernet/3com/3c59x.c
+++ b/drivers/net/ethernet/3com/3c59x.c
@@ -2273,7 +2273,6 @@ _vortex_interrupt(int irq, struct net_device *dev)
unsigned int bytes_compl = 0, pkts_compl = 0;
ioaddr = vp->ioaddr;
- spin_lock(&vp->lock);
status = ioread16(ioaddr + EL3_STATUS);
@@ -2371,7 +2370,6 @@ _vortex_interrupt(int irq, struct net_device *dev)
pr_debug("%s: exiting interrupt, status %4.4x.\n",
dev->name, status);
handler_exit:
- spin_unlock(&vp->lock);
return IRQ_RETVAL(handled);
}
@@ -2392,12 +2390,6 @@ _boomerang_interrupt(int irq, struct net_device *dev)
ioaddr = vp->ioaddr;
-
- /*
- * It seems dopey to put the spinlock this early, but we could race against vortex_tx_timeout
- * and boomerang_start_xmit
- */
- spin_lock(&vp->lock);
vp->handling_irq = 1;
status = ioread16(ioaddr + EL3_STATUS);
@@ -2516,7 +2508,6 @@ _boomerang_interrupt(int irq, struct net_device *dev)
dev->name, status);
handler_exit:
vp->handling_irq = 0;
- spin_unlock(&vp->lock);
return IRQ_RETVAL(handled);
}
@@ -2525,11 +2516,18 @@ vortex_boomerang_interrupt(int irq, void *dev_id)
{
struct net_device *dev = dev_id;
struct vortex_private *vp = netdev_priv(dev);
+ irqreturn_t ret;
+
+ spin_lock(&vp->lock);
if (vp->full_bus_master_rx)
- return _boomerang_interrupt(dev->irq, dev);
+ ret = _boomerang_interrupt(dev->irq, dev);
else
- return _vortex_interrupt(dev->irq, dev);
+ ret = _vortex_interrupt(dev->irq, dev);
+
+ spin_unlock(&vp->lock);
+
+ return ret;
}
static int vortex_rx(struct net_device *dev)
--
2.17.0
next prev parent reply other threads:[~2018-05-04 15:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-04 15:17 3c59x patches and the removal of an unused function Sebastian Andrzej Siewior
2018-05-04 15:17 ` [PATCH 1/4] net: u64_stats_sync: Remove functions without user Sebastian Andrzej Siewior
2018-05-04 15:17 ` [PATCH 2/4] net: 3com: 3c59x: Move boomerang/vortex conditional into function Sebastian Andrzej Siewior
2018-05-04 15:22 ` Sebastian Andrzej Siewior
2018-05-07 10:25 ` Steffen Klassert
2018-05-04 15:17 ` Sebastian Andrzej Siewior [this message]
2018-05-04 15:17 ` [PATCH 4/4] net: 3com: 3c59x: irq save variant of ISR Sebastian Andrzej Siewior
2018-05-08 3:26 ` 3c59x patches and the removal of an unused function David Miller
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=20180504151749.6966-4-bigeasy@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=anna-maria@linutronix.de \
--cc=davem@davemloft.net \
--cc=klassert@mathematik.tu-chemnitz.de \
--cc=netdev@vger.kernel.org \
--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