On Wed, Jun 25, 2003 at 04:29:40PM +0200, Angelo Dell'Aera wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > > Auditing kernel 2.5.73 sources I found in drivers/net/3c527.c > this section of code repeated few times. > > [..] > save_flags(flags); > cli(); > > while(lp->exec_pending) > sleep_on(&lp->event); > > /* > * Issue mine > */ > > lp->exec_pending=1; > > restore_flags(flags); > [..] > > Is there a particular reason for not using a spin_lock_irqsave/restore > (thus avoiding cli() )?. Moreover, in situations like this I think it's > better to use wait_event() on the condition. If needed I can send a > patch on it. Well, it's possible the original author intended disable_irq(n); spin_lock_irqsave(); blah spin_unlock_irqrestore(); enable_irq(n); or it's possible spin_lock_irqsave/restore is sufficient. I agree that avoiding cli() would be nice. Jeff - : send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html