Messages in this thread Patch in this message | | | Date | Fri, 12 May 2006 10:32:00 -0400 (EDT) | From | Steven Rostedt <> | Subject | Re: 3c59x vortex_timer rt hack (was: rt20 patch question) |
| |
On Fri, 12 May 2006, Andrew Morton wrote:
> > > > Andrew, > > > > Do you know off hand what the side-effects to the vortex card might be > > if we use disable_irq_nosync instead of disable_irq? > > > > ooh, ow, sorry, that's lost in the mists of time. I don't know why we're > doing disable_irq() in there. > > Whatever it does, I think you could take vp->lock instead - that'll stop > the interrupt handler from doing anything if it does get entered while this > CPU is running vortex_timer(). >
Thanks Andrew, I was thinking about using that lock too.
Mark, could you try this instead of the hack, and see if it works.
Thanks,
-- Steve
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Index: linux-2.6.16-rt20/drivers/net/3c59x.c =================================================================== --- linux-2.6.16-rt20.orig/drivers/net/3c59x.c 2006-05-12 10:27:36.000000000 -0400 +++ linux-2.6.16-rt20/drivers/net/3c59x.c 2006-05-12 10:28:22.000000000 -0400 @@ -1897,7 +1897,7 @@ vortex_timer(unsigned long data)
if (vp->medialock) goto leave_media_alone; - disable_irq(dev->irq); + spin_lock_bh(&vp->lock); old_window = ioread16(ioaddr + EL3_CMD) >> 13; EL3WINDOW(4); media_status = ioread16(ioaddr + Wn4_Media); @@ -1919,7 +1919,6 @@ vortex_timer(unsigned long data) break; case XCVR_MII: case XCVR_NWAY: { - spin_lock_bh(&vp->lock); mii_status = mdio_read(dev, vp->phys[0], MII_BMSR); if (!(mii_status & BMSR_LSTATUS)) { /* Re-read to get actual link status */ @@ -1957,7 +1956,6 @@ vortex_timer(unsigned long data) } else { netif_carrier_off(dev); } - spin_unlock_bh(&vp->lock); } break; default: /* Other media types handled by Tx timeouts. */ @@ -2000,7 +1998,7 @@ vortex_timer(unsigned long data) /* AKPM: FIXME: Should reset Rx & Tx here. P60 of 3c90xc.pdf */ } EL3WINDOW(old_window); - enable_irq(dev->irq); + spin_unlock_bh(&vp->lock);
leave_media_alone: if (vortex_debug > 2) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |