cvs commit: src/sys/dev/fxp if_fxp.c if_fxpvar.h

Justin T. Gibbs gibbs at scsiguy.com
Thu May 1 08:42:29 PDT 2003


> Yes, bus_teardown_intr() does block and people were complaining that it does.

It seems to be the only way to do this cleanly unless you start playing
with alternate interrupt stubs that happen to reside outside the module
you are loading, etc.

> The only problem that needs to be worked around (which you probably already
> do) is to make sure that if the handler is currently blocked on the lock
> when you do the teardown, it will not hose anything (like turn interrupts
> back on) when it executes.  For fxp(4), Warner used a 'gone' flag to make it
> so that fxp_intr() returned immediately in that case.

The fxp interrupt handler (at least in stable) doesn't re-enable interrupts.
So, the above strategy should work for fxp too.

>> This means that all detaches must occur from a context that can
>> sleep, but that shouldn't be too hard to make happen.
> 
> People can't hold the driver lock across bus_teardown_intr() with this
> model, which does require a possibly smarter interrupt routine or
> maybe a better detach that only disables interrupts then does a teardown,
> then finishes shutting down the rest of the hardware along with an
> interrupt handler that doesn't re-enable interrupts in the shutdown case.

All doable things for all but really broken hardware.  fxp is not broken.

--
Justin


More information about the cvs-src mailing list