In message: <[EMAIL PROTECTED]> Andrew Gallatin <[EMAIL PROTECTED]> writes: : : M. Warner Losh writes: : > In message: <[EMAIL PROTECTED]> : > Andrew Gallatin <[EMAIL PROTECTED]> writes: : > : The IFNET_RLOCK() called in if_slowtimo() is a global lock for the : > : list of ifnet structs to ensure that no devices are removed or added : > : while something may be using it. There is one ifnet list in the system. : > : > So this means that only the locking in attach is bogus, and similar : > locking in detach is also bogus because they produce lock order : > reversals as the global lock is held to insert/remove if interfaces. : : Yes. Though I haven't looked at if_dc myself, there may be other : locking problems. I've only been commenting on the ones that you : brought up. : : But back to an earlier point. Somebody (you?) validly pointed out : that the driver should not be callable and should not generate : interrupts until its finished attaching. The lock in its attach was : probably a somewhat misguided attempt at that.
Yes. That was me. There are some drivers that have separated front/back ends that makes this harder, but most of them don't. : The first point can be accomplished by doing the ether_ifattach() : last, but the second may be harder. I do that by poking a bit on my : card which prevents it from generating interrupts while the device is : being setup. Not sure if a similar bit exists on tulip cards. All PCI cards have to be able to turn off their interrupt sources, otherwise interrupt storms result. At least that's my understanding. Warner To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message