From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kay Sievers" Date: Wed, 07 Nov 2007 11:17:34 +0000 Subject: Re: Calling kobject_uevent directly Message-Id: <3ae72650711070317m5b0de1f6l942e11705df8e317@mail.gmail.com> List-Id: References: <58b503a50711062152x3e3cedafxde62c964174a3e53@mail.gmail.com> In-Reply-To: <58b503a50711062152x3e3cedafxde62c964174a3e53@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Nov 7, 2007 7:53 AM, Greg KH wrote: > On Tue, Nov 06, 2007 at 09:52:36PM -0800, Tom wrote: > > For devices with attributes that may change, is it "correct" to call > > kobject_uevent directly with KOBJ_CHANGE in order to notify userspace? > > Yes. And what attribute do you want to do this for? Right, it's fine to send "change", you can also add additional keys to the environment, to make it easier for the possible consumer so determine what this event is about. See: drivers/acpi/dock.c::dock_event() > > (This appears to be the behavior used in the drivers/mmc/host/omap.c driver) > > > > The KOBJ_ADD and KOBJ_REMOVE actions have comments saying "exclusive > > to core". Is this policy or is there a technical reason? > > Both. lots of userspace stuff happens when these events are sent, so > don't be sending them unless you really think you know what you are > doing. The actions "add" and "remove" are sent by the core when devices are created or get removed, it would be wrong to send "add" events for device which are already there, just to let userspace know that something has changed. It might break valid assumptions. > And even then, please run the kernel patch by me and Kay to > ensure that nothing bad will happen. > > Do you have a reason why you would want to do this? Thanks, Kay ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ 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