Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/opencrypto



Taylor R Campbell wrote:

It seems to me that the crux of the problem is that devsw_detach
doesn't fail if the device is still in use, because we do keep no
books about which devsws are still in use, so there's nothing to stop
you from unloading a device's module before you've given a its close
routine a chance to clean up.

Would it suffice to add an open count to struct bdevsw and struct
cdevsw, to be maintained by {bdev,cdev}_{open,close}?

I think this would be sufficient.

A lesser problem is that the steps to finalize a device driver module
are complicated (attach/detach the devsw, the cfdriver, the cfattach,
the cfdata) and different drivers do them in a different order and may
or may not back out the same way (e.g., dtv(4) ignores devsw_detach
failure), so we ought to formalize what the right way to do this is
once we have a way that can work.

That would definitely be appreciated.

It would seem that config_{init,fini}_component() are intended to handle much/most of this, but these routines are not documented and not used universally. (see sys/kern/subr_autoconf.c)

-------------------------------------------------------------------------
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index