Commit 47f66c76 authored by Anna-Maria Gleixner's avatar Anna-Maria Gleixner Committed by David S. Miller

net: 3com: 3c59x: Pull locking out of ISR

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: default avatarAnna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 577b995b
...@@ -2273,7 +2273,6 @@ _vortex_interrupt(int irq, struct net_device *dev) ...@@ -2273,7 +2273,6 @@ _vortex_interrupt(int irq, struct net_device *dev)
unsigned int bytes_compl = 0, pkts_compl = 0; unsigned int bytes_compl = 0, pkts_compl = 0;
ioaddr = vp->ioaddr; ioaddr = vp->ioaddr;
spin_lock(&vp->lock);
status = ioread16(ioaddr + EL3_STATUS); status = ioread16(ioaddr + EL3_STATUS);
...@@ -2371,7 +2370,6 @@ _vortex_interrupt(int irq, struct net_device *dev) ...@@ -2371,7 +2370,6 @@ _vortex_interrupt(int irq, struct net_device *dev)
pr_debug("%s: exiting interrupt, status %4.4x.\n", pr_debug("%s: exiting interrupt, status %4.4x.\n",
dev->name, status); dev->name, status);
handler_exit: handler_exit:
spin_unlock(&vp->lock);
return IRQ_RETVAL(handled); return IRQ_RETVAL(handled);
} }
...@@ -2392,12 +2390,6 @@ _boomerang_interrupt(int irq, struct net_device *dev) ...@@ -2392,12 +2390,6 @@ _boomerang_interrupt(int irq, struct net_device *dev)
ioaddr = vp->ioaddr; 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; vp->handling_irq = 1;
status = ioread16(ioaddr + EL3_STATUS); status = ioread16(ioaddr + EL3_STATUS);
...@@ -2516,7 +2508,6 @@ _boomerang_interrupt(int irq, struct net_device *dev) ...@@ -2516,7 +2508,6 @@ _boomerang_interrupt(int irq, struct net_device *dev)
dev->name, status); dev->name, status);
handler_exit: handler_exit:
vp->handling_irq = 0; vp->handling_irq = 0;
spin_unlock(&vp->lock);
return IRQ_RETVAL(handled); return IRQ_RETVAL(handled);
} }
...@@ -2525,11 +2516,18 @@ vortex_boomerang_interrupt(int irq, void *dev_id) ...@@ -2525,11 +2516,18 @@ vortex_boomerang_interrupt(int irq, void *dev_id)
{ {
struct net_device *dev = dev_id; struct net_device *dev = dev_id;
struct vortex_private *vp = netdev_priv(dev); struct vortex_private *vp = netdev_priv(dev);
irqreturn_t ret;
spin_lock(&vp->lock);
if (vp->full_bus_master_rx) if (vp->full_bus_master_rx)
return _boomerang_interrupt(dev->irq, dev); ret = _boomerang_interrupt(dev->irq, dev);
else 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) static int vortex_rx(struct net_device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment