./drivers/net/8390.c
I checked the code ./drivers/net/8390.c - this is how it REALLY looks like...
/* Ugly but a reset can be slow, yet must be protected */
disable_irq_nosync(dev->irq);
spin_lock(&ei_local->page_lock);
/* Try to restart the card. Perhaps the user has fixed something. */
ei_reset_8390(dev);
NS8390_init(dev, 1);
spin_unlock(&ei_local->page_lock);
enable_irq(dev->irq);
This should be mostly OK for the preemptive kernel. Swapping the irq and spin
lock lines should be preferred. But I think that is the case in SMP too...
Suppose two processors does the disable_irq_nosync - unlikely but possible...
One gets the spinlock, the other waits
The first runs through the code, exits the spin lock, enables irq
The second starts running the code - without irq disabled!!!
This would work in both cases.
/* Ugly but a reset can be slow, yet must be protected */
spin_lock(&ei_local->page_lock);
disable_irq_nosync(dev->irq);
/* Try to restart the card. Perhaps the user has fixed something. */
ei_reset_8390(dev);
NS8390_init(dev, 1);
enable_irq(dev->irq);
spin_unlock(&ei_local->page_lock);
/RogerL
-- Roger Larsson Skellefteċ Sweden - 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/