linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Greg KH <gregkh@suse.de>
Cc: linux-hotplug-devel@lists.sourceforge.net,
	Kay Sievers <kay.sievers@vrfy.org>,
	Vojtech Pavlik <vojtech@suse.cz>,
	LKML <linux-kernel@vger.kernel.org>,
	Hannes Reinecke <hare@suse.de>, Andrew Morton <akpm@osdl.org>
Subject: Re: Input sysbsystema and hotplug
Date: Tue, 14 Jun 2005 06:08:16 +0000	[thread overview]
Message-ID: <200506140108.16737.dtor_core@ameritech.net> (raw)
In-Reply-To: <20050613221500.GA15381@suse.de>

On Monday 13 June 2005 17:15, Greg KH wrote:
> On Mon, Jun 13, 2005 at 05:05:29PM -0500, Dmitry Torokhov wrote:
> > On Monday 13 June 2005 16:58, Dmitry Torokhov wrote:
> > > On Monday 13 June 2005 16:26, Kay Sievers wrote:
> > > > On Mon, Jun 13, 2005 at 04:07:51PM -0500, Dmitry Torokhov wrote:
> > > > > I am trying to convert input systsem to play nicely with sysfs and I am
> > > > > having trouble with hotplug agent. The old hotplug mechanism was using
> > > > > "input" as agent/subsystem name, unfortunately I can't simply use "input"
> > > > > class because when Greg added class_simple support to input handlers
> > > > > (evdev, mousedev, joydev, etc) he used that name. So currently stock
> > > > > kernel gets 2 types of hotplug events (from input core and from input
> > > > > handlers) with completely different arguments processed by the same
> > > > > input agent.
> > > > > 
> > > > > So I guess my question is: is there anyone who uses hotplug events
> > > > > for input interface devices (as in mouseX, eventX) as opposed to
> > > > > parent input devices (inputX).
> > > > 
> > > > Hmm, udev uses it. But, who needs device nodes. :)
> > > > 
> > > 
> > > Oh, OK. Damn, Andrew will hate us for breaking mouse support yet again :(
> > > because there are people (like me) relying on hotplug to load input handlers.
> > > First time I booted by new input hotplug kernel I lost my mouse.
> > > 
> > > I wonder should we hack something allowing overriding subsystem name
> > > so we could keep the same hotplug agent? Or should we bite teh bullet and
> > > change it?
> > >
> > 
> > Any chance we could quickly agree on a new name for hander devices (other
> > than "input") and roll out updated udev before the changes get into the
> > kernel? For some reason it feels like udev is mmuch quicker moving than
> > hotplug...
> 
> I can roll another hotplug release any time you want, there's nothing
> holding that back.
> 
> But please, don't break old users of hotplug or udev.  Especially
> hotplug (for udev one can argue that it's still so new that upgrading is
> realistic, but try to prevent that too...) as that package is so tightly
> tied to the distro, the next time it would be upgraded is for the next
> distro release.
> 
> So, any way to not break anything?
>

We could allow classes override what is being transmitted as SUBSYSTEMin hotplug call. If you accept something like the patch below we can keep
status quo.
  
-- 
Dmitry

Subject: allow classes specify subsystem name for hotplug

Driver core: allow classes specify subsystem name to use in
             hotplug call instead of always using their sysfs
             name.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 drivers/base/class.c   |    4 +++-
 include/linux/device.h |    1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

Index: work/drivers/base/class.c
=================================--- work.orig/drivers/base/class.c
+++ work/drivers/base/class.c
@@ -268,8 +268,10 @@ static int class_hotplug_filter(struct k
 static char *class_hotplug_name(struct kset *kset, struct kobject *kobj)
 {
 	struct class_device *class_dev = to_class_dev(kobj);
+	struct class *class = class_dev->class;
 
-	return class_dev->class->name;
+	return class->hotplug_name ?
+			class->hotplug_name(class_dev) : class->name;
 }
 
 static int class_hotplug(struct kset *kset, struct kobject *kobj, char **envp,
Index: work/include/linux/device.h
=================================--- work.orig/include/linux/device.h
+++ work/include/linux/device.h
@@ -153,6 +153,7 @@ struct class {
 	struct class_attribute		* class_attrs;
 	struct class_device_attribute	* class_dev_attrs;
 
+	char * (*hotplug_name)(struct class_device *dev);
 	int	(*hotplug)(struct class_device *dev, char **envp, 
 			   int num_envp, char *buffer, int buffer_size);
 


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r 
_______________________________________________
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

  reply	other threads:[~2005-06-14  6:08 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-13 21:07 Input sysbsystema and hotplug Dmitry Torokhov
2005-06-13 21:26 ` Kay Sievers
2005-06-13 21:38   ` Dmitry Torokhov
2005-06-13 22:17     ` Greg KH
2005-06-14  6:14       ` Dmitry Torokhov
2005-06-13 21:58   ` Dmitry Torokhov
2005-06-13 22:05     ` Dmitry Torokhov
2005-06-13 22:15       ` Greg KH
2005-06-14  6:08         ` Dmitry Torokhov [this message]
2005-06-13 22:21       ` Kay Sievers
2005-06-14  7:32       ` Hannes Reinecke
2005-06-14  7:42         ` Dmitry Torokhov
2005-06-14  7:47           ` Hannes Reinecke
2005-06-14  7:56             ` Dmitry Torokhov
2005-06-19 14:46             ` David Brownell
2005-06-13 22:16 ` Greg KH
2005-06-14  4:26   ` Dmitry Torokhov
2005-06-14  6:21   ` Jon Smirl
2005-06-14  6:38     ` Greg KH
2005-06-14 13:41       ` Jon Smirl
2005-06-14 15:02       ` Jon Smirl
2005-06-14 18:16         ` Dmitry Torokhov
2005-06-14  7:43 ` Hannes Reinecke
2005-06-14  7:52   ` Dmitry Torokhov
2005-06-14  8:00     ` Hannes Reinecke

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=200506140108.16737.dtor_core@ameritech.net \
    --to=dtor_core@ameritech.net \
    --cc=akpm@osdl.org \
    --cc=gregkh@suse.de \
    --cc=hare@suse.de \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-hotplug-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vojtech@suse.cz \
    /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).