lkml.org 
[lkml]   [2000]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [Q] net_device methods and disable_irq interaction (SMP&UP)
Date
From
> Can spin_lock_irqsave and the disable_irq & spin_lock combinations be
> safely mixed, particularly with regards to the networking layer? This does
> not seem to be done anywhere in the kernel so I suspect that I'm trying
> to do something wrong/bogus ...

We do it on the 8390 and 3c509.

#ifdef __SMP__
disable_irq_nosync(dev->irq);
spin_lock(&lp->lock);
#endif
slow stuff

#ifdef __SMP__
spin_unlock(&lp->lock);
enable_irq(dev->irq);
#endif

You need to allow for an IRQ coming in after the disable_irq happens. If its
already pending at the wrong moment on SMP at least it happens very very
occasionally.

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.045 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site