linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Unloading drivers, start-up, shut-down and some clean-ups (a problem)
@ 2001-10-02  2:00 stamit
  2001-10-03  1:41 ` Keith Owens
  0 siblings, 1 reply; 2+ messages in thread
From: stamit @ 2001-10-02  2:00 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 1489 bytes --]

(please don't hate me for this... :-)

There are two obvious problems with the previous patch...

1. From the beginning  I tried to verbosely comment the scripts (so they 
can be self-explanatory and easy to read) and, apparently, I forgot to 
update the comments in the "uhci.agent" after reorganizing the scripts 
(to experiment with), so... the comments in /etc/hotplug/pci/uhci.agent 
are wrong, misleading and confusing (ouch)!

2. Only after posting that previous patch I realised that the way in 
which the "start" and "stop" events are passed down from policy agents 
to driver agents was, well, not so good. "start" was passed if a kernel 
module was already loaded and "stop" was passed if a module was already 
unloaded. Well, it turns out that the right thing is to handle 
start/stop in the same (almost) way that add/remove events are handled. 
The only difference is that, for start/stop, $MODULE is also exported 
and is the name of the currently loaded kernel module ("-" if none, "#" 
if undetermined).

Now, the final thing that remains for unloading to be complete is 
reference counting. I tried to do it with bash (by storing counts in 
*.ref files in the driver directories) and guess what I stumbled to... a 
race condition! Multiple hotplug events can be processed by the scripts 
at the same time. So I took it back. Isn't there a way to use modutils 
programs to play with the module's real refrence counts? It would make 
things a whole lot easier (and safer).

[-- Attachment #2: hotplug-2001_04_24-patch.diff.gz --]
[-- Type: application/x-gzip, Size: 33259 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-10-03  1:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-02  2:00 Unloading drivers, start-up, shut-down and some clean-ups (a problem) stamit
2001-10-03  1:41 ` Keith Owens

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).