Commit 99c5059e authored by Steven Rostedt's avatar Steven Rostedt Committed by Thomas Gleixner

drivers/net: vortex fix locking issues

Argh, cut and paste wasn't enough...

Use this patch instead.  It needs an irq disable.  But, believe it or not,
on SMP this is actually better.  If the irq is shared (as it is in Mark's
case), we don't stop the irq of other devices from being handled on
another CPU (unfortunately for Mark, he pinned all interrupts to one CPU).
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>

 drivers/net/3c59x.c |   16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 4aef9893
...@@ -791,9 +791,9 @@ static void poll_vortex(struct net_device *dev) ...@@ -791,9 +791,9 @@ static void poll_vortex(struct net_device *dev)
{ {
struct vortex_private *vp = netdev_priv(dev); struct vortex_private *vp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
local_irq_save(flags); local_irq_save_nort(flags);
(vp->full_bus_master_rx ? boomerang_interrupt:vortex_interrupt)(dev->irq,dev); (vp->full_bus_master_rx ? boomerang_interrupt:vortex_interrupt)(dev->irq,dev);
local_irq_restore(flags); local_irq_restore_nort(flags);
} }
#endif #endif
...@@ -1762,6 +1762,7 @@ vortex_timer(unsigned long data) ...@@ -1762,6 +1762,7 @@ vortex_timer(unsigned long data)
int next_tick = 60*HZ; int next_tick = 60*HZ;
int ok = 0; int ok = 0;
int media_status, old_window; int media_status, old_window;
unsigned long flags;
if (vortex_debug > 2) { if (vortex_debug > 2) {
pr_debug("%s: Media selection timer tick happened, %s.\n", pr_debug("%s: Media selection timer tick happened, %s.\n",
...@@ -1769,7 +1770,7 @@ vortex_timer(unsigned long data) ...@@ -1769,7 +1770,7 @@ vortex_timer(unsigned long data)
pr_debug("dev->watchdog_timeo=%d\n", dev->watchdog_timeo); pr_debug("dev->watchdog_timeo=%d\n", dev->watchdog_timeo);
} }
disable_irq_lockdep(dev->irq); spin_lock_irqsave(&vp->lock, flags);
old_window = ioread16(ioaddr + EL3_CMD) >> 13; old_window = ioread16(ioaddr + EL3_CMD) >> 13;
EL3WINDOW(4); EL3WINDOW(4);
media_status = ioread16(ioaddr + Wn4_Media); media_status = ioread16(ioaddr + Wn4_Media);
...@@ -1792,10 +1793,7 @@ vortex_timer(unsigned long data) ...@@ -1792,10 +1793,7 @@ vortex_timer(unsigned long data)
case XCVR_MII: case XCVR_NWAY: case XCVR_MII: case XCVR_NWAY:
{ {
ok = 1; ok = 1;
/* Interrupts are already disabled */
spin_lock(&vp->lock);
vortex_check_media(dev, 0); vortex_check_media(dev, 0);
spin_unlock(&vp->lock);
} }
break; break;
default: /* Other media types handled by Tx timeouts. */ default: /* Other media types handled by Tx timeouts. */
...@@ -1849,7 +1847,7 @@ leave_media_alone: ...@@ -1849,7 +1847,7 @@ leave_media_alone:
dev->name, media_tbl[dev->if_port].name); dev->name, media_tbl[dev->if_port].name);
EL3WINDOW(old_window); EL3WINDOW(old_window);
enable_irq_lockdep(dev->irq); spin_unlock_irqrestore(&vp->lock, flags);
mod_timer(&vp->timer, RUN_AT(next_tick)); mod_timer(&vp->timer, RUN_AT(next_tick));
if (vp->deferred) if (vp->deferred)
iowrite16(FakeIntr, ioaddr + EL3_CMD); iowrite16(FakeIntr, ioaddr + EL3_CMD);
...@@ -1883,12 +1881,12 @@ static void vortex_tx_timeout(struct net_device *dev) ...@@ -1883,12 +1881,12 @@ static void vortex_tx_timeout(struct net_device *dev)
* Block interrupts because vortex_interrupt does a bare spin_lock() * Block interrupts because vortex_interrupt does a bare spin_lock()
*/ */
unsigned long flags; unsigned long flags;
local_irq_save(flags); local_irq_save_nort(flags);
if (vp->full_bus_master_tx) if (vp->full_bus_master_tx)
boomerang_interrupt(dev->irq, dev); boomerang_interrupt(dev->irq, dev);
else else
vortex_interrupt(dev->irq, dev); vortex_interrupt(dev->irq, dev);
local_irq_restore(flags); local_irq_restore_nort(flags);
} }
} }
......
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