Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Apr 1997 19:05:12 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        avalon@coombs.anu.edu.au, bde@zeta.org.au
Cc:        hackers@FreeBSD.org, msmith@atrad.adelaide.edu.au
Subject:   Re: Unloading LKMs (was Re: A Desparate Plea for Help...)
Message-ID:  <199704300905.TAA13932@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> >> > Er, AFAIK unloading LKM drivers is broken in all cases.  It certainly
>>                              ^^^^^^^
>> 
>> >Hmmm, IP Filter unloads and reloads easily enough.
>> 
>> It's not a driver.
>
>Actually, it is a character device module:
>MOD_DECL(if_ipl);
>
>static struct lkm_dev _module = {
>        LM_DEV,
>        LKM_VERSION,
>        IPL_VERSION,
>        CDEV_MAJOR,
>        LM_DT_CHAR,
>        (void *)&ipl_cdevsw
>};

Oops.  It's probably broken then.  I think there is no problem in 2.1.x.
I think the problem is caused by incomplete conversion to indirect devsw's.

>> Drivers are supposed to do nothing return nonzero in their unload function
>> if they are busy.
>
>I found that attempting to keep track of whether you are busy or not made
>things worse.  Whether it be via signal 9 or whatever, it is somehow possible
>for things to not get cleaned up properly and you end up thinking you are
>busy when you aren't.  Maybe this has changed or someone wants to look
>into it further ?

At least for pure device drivers, just keep track of opens and don't allow
unloading if anything is open.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704300905.TAA13932>