From: Stamatis Mitrofanis <ewstam@softhome.net>
To: linux-hotplug@vger.kernel.org
Subject: Re: Device count (to be done with)
Date: Mon, 15 Oct 2001 00:15:37 +0000 [thread overview]
Message-ID: <marc-linux-hotplug-100310863324729@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-100274805227939@msgid-missing>
Oliver Neukum wrote:
>>The reason for all this fuss is that the hotplug scripts be able to
>>properly _un_load modules as well as loading them. Just consider what
>>happens when you have two USB HID mice and you unplug one of them. The
>>driver gets unloaded while it shouldn't (the other mouse is still in).
>>
>>I just noted that a very simple way to do this is to add a new
>>"should-count" in the module loading/unloading mechanism and extend
>>modprobe a bit to support it. That ought to be a very simple change.
>>Also, it is not really necessary for the kernel modules themselves to
>>support playing with this count (but it would be a good thing though).
>>
>>I hope I'm not missing anything. Please give me more details.
>>
>There should be indeed a second counter.
>However you would not want it in the module load and unload path. To make
>sense it has to be incremented on device detection and decremented on device
>removal. All you need now is to make it queryable from user space to let
>modprobe check.
>For USB you increment on successful probe() and decrement on disconnect()
>
Apparently, we have two very similar proposals... :-)
If I got your idea right, you suggest that:
- should-count is stored for each kernel module, independent of
"subsystem" (usb, pci etc.).
- when should-count is decremented to 0, the module is "autoclean".
- should-count is queried by kernel.
- should-count is incremented/decremented by kernel.
- should-count is queried by modprobe.
I was suggesting the following:
- should-count is stored for each kernel module, independent of "subsystem".
- when should-count is decremented to 0, the module is "autoclean".
- should-count is queried by kernel.
- should-count is incremented/decremented by kernel.
- should-count is queried by modprobe.
- should-count is incremented/decremented by modprobe.
It's just whether user-space is allowed to increment/decrement the count
that differs. I believe that there has to be a user-space interface to
this count since the should-count is abstract (hence not specific to
PCI, USB or anything) and counts just "reasons for this module to remain
loaded (not to be autocleaned)" . Thus, user-space may have its own set
of reasons to have this module loaded in the kernel.
I think we've pretty much settled this issue. So now, the question is
(again), who's going to write it...
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
next prev parent reply other threads:[~2001-10-15 0:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-10 20:06 Device count (to be done with) Stamatis Mitrofanis
2001-10-11 15:01 ` Oliver Neukum
2001-10-12 22:53 ` Stamatis Mitrofanis
2001-10-13 8:45 ` Oliver Neukum
2001-10-15 0:15 ` Stamatis Mitrofanis [this message]
2001-10-15 9:39 ` Oliver.Neukum
2001-10-15 22:27 ` Stamatis Mitrofanis
2001-10-16 4:03 ` Keith Owens
2001-10-16 5:37 ` Greg KH
2001-10-16 5:59 ` Keith Owens
2001-10-16 7:02 ` David Brownell
2001-10-16 8:23 ` Oliver Neukum
2001-10-16 8:29 ` Oliver Neukum
2001-10-16 8:47 ` Keith Owens
2001-10-16 12:00 ` Oliver Neukum
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=marc-linux-hotplug-100310863324729@msgid-missing \
--to=ewstam@softhome.net \
--cc=linux-hotplug@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;
as well as URLs for NNTP newsgroup(s).