Subject: Re: Detaching devices
To: Bill Studenmund <wrstuden@nas.nasa.gov>
From: Lennart Augustsson <lennart@augustsson.net>
List: tech-kern
Date: 06/28/1999 13:35:04
Bill Studenmund wrote:
> > > Lennart Augustsson <lennart@augustsson.net> wrote:
> >
> > That was never my plan. Besides, I have no control over when the softc is
> > deallocated. It happens in config_detach() after the driver's detach routine
> > has finished (successfully). So at this time there had better be no references
> > it.
>
> that's what reference counting is for. :-) What you/we need to do is add
> foo_addref and foo_delref routines. When all the references have been
> deleted, the memory goes away.
Yes, I know reference counting can solve the problem. But the current
attach/detach mechanism doesn't use it.
It would probably be a lot of work to add reference counting to all the
relevant device drivers. :-(
-- Lennart