linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Vlasov <vsu@altlinux.ru>
To: linux-hotplug@vger.kernel.org
Subject: Re: Udev - Trapping "Add" - Subsystem "module"
Date: Thu, 09 Nov 2006 20:58:37 +0000	[thread overview]
Message-ID: <20061109235837.f0b9fedd.vsu@altlinux.ru> (raw)
In-Reply-To: <335DD0B75189FB428E5C32680089FB9F8040B0@mtk-sms-mail01.digi.com>


[-- Attachment #1.1: Type: text/plain, Size: 1171 bytes --]

On Thu, 9 Nov 2006 12:44:52 -0600 Kilau, Scott wrote:

> My rule (currently I put in "10-dgap.rules"):
> 
> ACTION=="add", KERNEL=="dgap", SUBSYSTEM=="module", \
>      RUN+="/usr/sbin/dgapdl", OPTIONS+="last_rule"

This does not seem to be a good idea.  The module add event is
generated early - even before the module init routine is invoked; so
the program you run may even find that the module was not loaded
because the module initialization failed.  And even if the module
loads successfully, there will be a race - when your program will try
to access your module, it might break because the module init is not
yet complete.  This race might be hard to notice on an uniprocessor
machine, because the udevd process which handles uevents will most
likely be scheduled only after the module init code completes (but you
should be able to reproduce it easily if you insert some sleeps in the
module init code).

The proper way to handle initialization is to have your module
register some devices and then catch addition of these devices in udev
rules.  At this time you can be sure that the corresponding device
file has been created by udevd.

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 373 bytes --]

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

[-- Attachment #3: Type: text/plain, Size: 226 bytes --]

_______________________________________________
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

  parent reply	other threads:[~2006-11-09 20:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-09 18:44 Udev - Trapping "Add" - Subsystem "module" Kilau, Scott
2006-11-09 19:09 ` Kris van Rens
2006-11-09 19:17 ` Kilau, Scott
2006-11-09 19:22 ` Kris van Rens
2006-11-09 20:58 ` Sergey Vlasov [this message]
2006-11-10  2:05 ` Kilau, Scott

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=20061109235837.f0b9fedd.vsu@altlinux.ru \
    --to=vsu@altlinux.ru \
    --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).