Re: LiS ldl driver with 2.6 kernels
Hai Zaar <[email protected]>
| Newsgroups | gmane.linux.kernel.streams |
|---|---|
| Message-ID | <[email protected]> |
> > 1) Calling sap_create() under lock. The problem is that sap_create() > > might invoke dev_add_pack() that can sleep, since kernel 2.5.70. I > > choose to remove the call to dev_add_pack() from sap_create() and make > dev_add_pack does not sleep. I mixed up the reason for the change, because I've done several changes at once. I still think the patch is right. dev_add_pack() definitly does not sleep, but still, it cannot be called with IRQs disabled, the reason is the following : dev_add_pack() uses bh-safe spinlocks, spin_unlock_bh() in turn uses local_bh_enable() which complains loudly when IRQs are disabled (At least in miy 2.6.7 kernel). And in ldl drivers IRQs are disabled after SPLSTR is done, because LiS uses irq-safe spinlocks for it. So I still think that my fixes for dev_add_pack apply. > > 4) Doing spin_unlock_bh() while holding irq-disabling lock. I choose > > to change the locking to be irq-safe, that does not have that problem. > > Due to my limited understaing of Linux kernel locking rules, I'm not > > completely sure it is correct. I thing that disabling local irqs > > guarantees that no bh processing is done, but I might be wrong. > irq locking is too severe. I'm well aware of that. Still, the change to use IRQ safe locking is donw for the same reason as the previous change. spin_unlock_bh() complains when called with IRQs disabled. But the actual performance hit of converting to spinlock_irqsafe will be minimal, because SPLSTR had already disabled IRQs by the time we'd want to lock. -- Zaar