kldunload DIAGNOSTIC idea...
Doug Rabson
dfr at nlsystems.com
Wed Jul 21 03:37:54 PDT 2004
On Wed, 2004-07-21 at 10:21, Poul-Henning Kamp wrote:
> In message <200407211010.08159.dfr at nlsystems.com>, Doug Rabson writes:
>
> >The original intention was that drivers use the
> >device_busy()/device_unbusy() counter to handle these things. In some
> >cases, just calling device_busy() from fooopen() and device_unbusy()
> >from fooclose() is sufficient.
>
> That is not enough. All methods in cdevsw, and things not in cdevsw
> (clone handlers, call backs, etc etc) needs to refcount.
>
> I have a lot of this working in a tree here, and will commit it once
> I have gone over it a few more times.
Methods in cdevsw which can't be called unless the device is opened can
rely on a single counter managed by open/close in most cases. Other
callbacks may or may not need extra handling depending on whether or not
the callback can persist past close.
Will you use the existing device_busy() counter or will each driver use
its own counter?
More information about the freebsd-arch
mailing list