From: Stephen Hemminger <shemminger@osdl.org>
To: linux-kernel@vger.kernel.org
Subject: Re: Module Ref Counting & ibmphp
Date: Tue, 14 Mar 2006 16:21:04 -0800 [thread overview]
Message-ID: <20060314162104.5370b20d@localhost.localdomain> (raw)
In-Reply-To: 20060315000212.GB6533@kroah.com
On Tue, 14 Mar 2006 16:02:12 -0800
Greg KH <greg@kroah.com> wrote:
> On Wed, Mar 15, 2006 at 09:47:00AM +1100, Srihari Vijayaraghavan wrote:
> > Before (in 2.6.16-rc*):
> > $ egrep 'ibmphp' /proc/modules
> > ibmphp 67809 4294967295 - Live 0xf8910000
> > ^^^^^^^^^^
> >
> > After [1]:
> > ibmphp 64224 0 - Live 0xf8965000
> > ^
> >
> > Of course, now I'm able to successfully unload ibmphp
> > (& subsequently load it too :)) without any
> > observeable problems.
> >
> > It'd seem, thro struct hotplug_slot_ops, module ref
> > count for ibmphp is taken care of. No?
>
> No. I don't think this driver likes to be unloaded due to the
> instability of the hardware if that happens. So let's just let it not
> be unloaded, and hope that the hardware can die in peace and never get
> put into any new machines...
>
> thanks,
>
> greg k-h
The proper way to prevent unloading is just not to have a module exit routine,
rather than causing ref count to be off. The the module subsystem will
mark it as unsafe to unload. Unless it wants to allow unsafe forced unload.
But IMHO either it needs to be safe to unload or not allow it.
--- linux-2.6/drivers/pci/hotplug/ibmphp_core.c.orig 2006-03-14 16:18:14.000000000 -0800
+++ linux-2.6/drivers/pci/hotplug/ibmphp_core.c 2006-03-14 16:19:12.000000000 -0800
@@ -1398,10 +1398,6 @@ static int __init ibmphp_init(void)
goto error;
}
- /* lock ourselves into memory with a module
- * count of -1 so that no one can unload us. */
- module_put(THIS_MODULE);
-
exit:
return rc;
@@ -1409,14 +1405,4 @@ error:
ibmphp_unload();
goto exit;
}
-
-static void __exit ibmphp_exit(void)
-{
- ibmphp_hpc_stop_poll_thread();
- debug("after polling\n");
- ibmphp_unload();
- debug("done\n");
-}
-
module_init(ibmphp_init);
-module_exit(ibmphp_exit);
next prev parent reply other threads:[~2006-03-15 0:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-14 22:47 Module Ref Counting & ibmphp Srihari Vijayaraghavan
2006-03-15 0:02 ` Greg KH
2006-03-15 0:21 ` Stephen Hemminger [this message]
2006-03-15 17:16 ` Daniel Barkalow
2006-03-17 20:20 ` [2.6 patch] disallow unloading of ibmphp Adrian Bunk
2006-03-17 20:30 ` Adrian Bunk
2006-03-15 3:25 ` Module Ref Counting & ibmphp Srihari Vijayaraghavan
2006-03-15 3:36 ` Randy.Dunlap
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060314162104.5370b20d@localhost.localdomain \
--to=shemminger@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox