From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Date: Mon, 13 Jun 2005 21:07:51 +0000 Subject: Input sysbsystema and hotplug Message-Id: <200506131607.51736.dtor_core@ameritech.net> MIME-Version: 1 Content-Type: multipart/mixed; boundary="Boundary-00=_nWfrCD9nVbYwOMX" List-Id: To: linux-hotplug@vger.kernel.org --Boundary-00=_nWfrCD9nVbYwOMX Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, 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). If not then I could rename Greg's class to "input_dev" and my new class to "input" and that will be compatible with older installations. Also, in the long run I would probably want to see something like this: /sys/class/input---input0 | |-input1 | |-input2 | |-mouse---mouse0 | | | |-mouse1 | | | --mice | |-event---event0 | |-event1 | |-event2 where inputX are class devices, mouse and event are subclasses of input class and mouseX and eventX are again class devices. Objections, suggestions, etc? Thank you! -- Dmitry --Boundary-00=_nWfrCD9nVbYwOMX Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: 7bit

Hi,

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). If not then I could rename Greg's class

to "input_dev" and my new class to "input" and that will be compatible

with older installations.

Also, in the long run I would probably want to see something like this:

/sys/class/input---input0

|

|-input1

|

|-input2

|

|-mouse---mouse0

| |

| |-mouse1

| |

| --mice

|

|-event---event0

|

|-event1

|

|-event2

where inputX are class devices, mouse and event are subclasses of input

class and mouseX and eventX are again class devices.

Objections, suggestions, etc?

Thank you!

--

Dmitry

--Boundary-00=_nWfrCD9nVbYwOMX-- ------------------------------------------------------- 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=20 _______________________________________________ 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Mon, 13 Jun 2005 21:26:54 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <20050613212654.GB11182@vrfy.org> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> In-Reply-To: <200506131607.51736.dtor_core@ameritech.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dmitry Torokhov Cc: linux-hotplug-devel@lists.sourceforge.net, Greg KH , Vojtech Pavlik , LKML , Hannes Reinecke 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. :) > If not then I could rename Greg's class > to "input_dev" and my new class to "input" and that will be compatible > with older installations. I still think we should rename the parent-input device class and keep the more interesting class named "input", cause this will not break current setups besides one hotplug-handler and follows the usual style in sysfs. > Also, in the long run I would probably want to see something like this: > > /sys/class/input---input0 > | > |-input1 > | > |-input2 > | > |-mouse---mouse0 > | | > | |-mouse1 > | | > | --mice > | > |-event---event0 > | > |-event1 > | > |-event2 > > where inputX are class devices, mouse and event are subclasses of input > class and mouseX and eventX are again class devices. We don't support childs of class devices until now. Would be nice maybe, but someone needs to add that to the driver-core first and we would need to make a bunch of userspace stuff aware of it ... Kay ------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Date: Mon, 13 Jun 2005 21:38:08 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <200506131638.09140.dtor_core@ameritech.net> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <20050613212654.GB11182@vrfy.org> In-Reply-To: <20050613212654.GB11182@vrfy.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug-devel@lists.sourceforge.net Cc: Kay Sievers , Greg KH , Vojtech Pavlik , LKML , Hannes Reinecke On Monday 13 June 2005 16:26, Kay Sievers wrote: > On Mon, Jun 13, 2005 at 04:07:51PM -0500, Dmitry Torokhov wrote: > > > > where inputX are class devices, mouse and event are subclasses of input > > class and mouseX and eventX are again class devices. > > We don't support childs of class devices until now. Would be nice maybe, but > someone needs to add that to the driver-core first and we would need to make > a bunch of userspace stuff aware of it ... > Something like patch below will suffice I think (not tested). -- Dmitry drivers/base/class.c | 5 ++++- include/linux/device.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) Signed-off-by: Dmitry Torokhov --- Index: work/drivers/base/class.c =================================--- work.orig/drivers/base/class.c +++ work/drivers/base/class.c @@ -145,7 +145,10 @@ int class_register(struct class * cls) if (error) return error; - subsys_set_kset(cls, class_subsys); + if (cls->parent) + subsys_set_kset(cls, cls->parent->subsys); + else + subsys_set_kset(cls, class_subsys); error = subsystem_register(&cls->subsys); if (!error) { Index: work/include/linux/device.h =================================--- work.orig/include/linux/device.h +++ work/include/linux/device.h @@ -145,6 +145,7 @@ struct class { char * name; struct subsystem subsys; + struct class * parent; struct list_head children; struct list_head interfaces; struct semaphore sem; /* locks both the children and interfaces lists */ ------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Date: Mon, 13 Jun 2005 21:58:36 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <200506131658.37583.dtor_core@ameritech.net> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <20050613212654.GB11182@vrfy.org> In-Reply-To: <20050613212654.GB11182@vrfy.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Kay Sievers Cc: linux-hotplug-devel@lists.sourceforge.net, Greg KH , Vojtech Pavlik , LKML , Hannes Reinecke , Andrew Morton 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? Adding Andrew to CC... > > If not then I could rename Greg's class > > to "input_dev" and my new class to "input" and that will be compatible > > with older installations. > > I still think we should rename the parent-input device class and keep > the more interesting class named "input", cause this will not break current > setups besides one hotplug-handler and follows the usual style in sysfs. -- Dmitry ------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Date: Mon, 13 Jun 2005 22:05:29 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <200506131705.30159.dtor_core@ameritech.net> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <20050613212654.GB11182@vrfy.org> <200506131658.37583.dtor_core@ameritech.net> In-Reply-To: <200506131658.37583.dtor_core@ameritech.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug-devel@lists.sourceforge.net Cc: Kay Sievers , Greg KH , Vojtech Pavlik , LKML , Hannes Reinecke , Andrew Morton 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... -- Dmitry ------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Mon, 13 Jun 2005 22:15:00 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <20050613221500.GA15381@suse.de> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <20050613212654.GB11182@vrfy.org> <200506131658.37583.dtor_core@ameritech.net> <200506131705.30159.dtor_core@ameritech.net> In-Reply-To: <200506131705.30159.dtor_core@ameritech.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dmitry Torokhov Cc: linux-hotplug-devel@lists.sourceforge.net, Kay Sievers , Vojtech Pavlik , LKML , Hannes Reinecke , Andrew Morton 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? thanks, greg k-h ------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Mon, 13 Jun 2005 22:16:57 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <20050613221657.GB15381@suse.de> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> In-Reply-To: <200506131607.51736.dtor_core@ameritech.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dmitry Torokhov Cc: linux-hotplug-devel@lists.sourceforge.net, Vojtech Pavlik , Kay Sievers , LKML On Mon, Jun 13, 2005 at 04:07:51PM -0500, Dmitry Torokhov wrote: > Hi, > > 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. Why not? What's wrong with using the existing input class? I was hopeing it would get flushed out into something "real" someday. All you have to do is keep the "dev" stuff in there somewhere and udev will be happy. > /sys/class/input---input0 > | > |-input1 > | > |-input2 > | > |-mouse---mouse0 > | | > | |-mouse1 > | | > | --mice > | > |-event---event0 > | > |-event1 > | > |-event2 > > where inputX are class devices, mouse and event are subclasses of input > class and mouseX and eventX are again class devices. Yes, lots of people want class devices to have children. Unfortunatly they don't provide patches with their requests :) thanks, greg k-h ------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Mon, 13 Jun 2005 22:17:36 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <20050613221736.GC15381@suse.de> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <20050613212654.GB11182@vrfy.org> <200506131638.09140.dtor_core@ameritech.net> In-Reply-To: <200506131638.09140.dtor_core@ameritech.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dmitry Torokhov Cc: linux-hotplug-devel@lists.sourceforge.net, Kay Sievers , Vojtech Pavlik , LKML , Hannes Reinecke On Mon, Jun 13, 2005 at 04:38:08PM -0500, 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: > > > > > > where inputX are class devices, mouse and event are subclasses of input > > > class and mouseX and eventX are again class devices. > > > > We don't support childs of class devices until now. Would be nice maybe, but > > someone needs to add that to the driver-core first and we would need to make > > a bunch of userspace stuff aware of it ... > > > > Something like patch below will suffice I think (not tested). No, you need to increment the parent when you register the child. Look at the device code for what's needed for this. thanks, greg k-h ------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Mon, 13 Jun 2005 22:21:29 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <20050613222129.GA11671@vrfy.org> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <20050613212654.GB11182@vrfy.org> <200506131658.37583.dtor_core@ameritech.net> <200506131705.30159.dtor_core@ameritech.net> In-Reply-To: <200506131705.30159.dtor_core@ameritech.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dmitry Torokhov Cc: linux-hotplug-devel@lists.sourceforge.net, Greg KH , Vojtech Pavlik , LKML , Hannes Reinecke , Andrew Morton 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... Hmm, not sure. It is not udev itself, it's the rule set which is different on every distro and not really in our control. The hotplug agent is just one symlink if you want a quick & dirty fix. Kay ------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Date: Tue, 14 Jun 2005 04:26:06 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <200506132326.06630.dtor_core@ameritech.net> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <20050613221657.GB15381@suse.de> In-Reply-To: <20050613221657.GB15381@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: Greg KH Cc: linux-hotplug-devel@lists.sourceforge.net, Vojtech Pavlik , Kay Sievers , LKML On Monday 13 June 2005 17:16, Greg KH wrote: > On Mon, Jun 13, 2005 at 04:07:51PM -0500, Dmitry Torokhov wrote: > > Hi, > >=20 > > 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 "inpu= t" > > class because when Greg added class_simple support to input handlers > > (evdev, mousedev, joydev, etc) he used that name. >=20 > Why not? =A0What's wrong with using the existing input class? =A0I was > hopeing it would get flushed out into something "real" someday. =A0All you > have to do is keep the "dev" stuff in there somewhere and udev will be > happy. >=20 They are different. Your input class represents userpsace interfaces, my input class represent middleman class devices. If you remember, input core looks like this: evdev (/dev/input/eventX devices) / hardware / device -------- input_dev - mousedev (/dev/input/mouseX, (serio port, \ /dev/input/mice USB port) \ joydev (/dev/input/jsX devices) Your input class is fine (except for its name as it uses the same name that input core was/is using for notification about new instances of input_devs), but it represents different point in object hierarchy, as it represents /dev/input/{mouse|event|js}X objects. Your class devices are useful to properly create device nodes and probably set up userspace applications to use new input devices. My input_dev class devices are useful so hotplug would load proper input handlers (joysdev, mousedev) to create your class devices. I hope it explains things a bit... =20 --=20 Dmitry ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotp= ut a projector? How fast can you ride your desk chair down the office luge tra= ck? If you want to score the big prize, get to know the little guy. =20 Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 _______________________________________________ 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Date: Tue, 14 Jun 2005 06:08:16 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <200506140108.16737.dtor_core@ameritech.net> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <200506131705.30159.dtor_core@ameritech.net> <20050613221500.GA15381@suse.de> In-Reply-To: <20050613221500.GA15381@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Greg KH Cc: linux-hotplug-devel@lists.sourceforge.net, Kay Sievers , Vojtech Pavlik , LKML , Hannes Reinecke , Andrew Morton 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 --- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Date: Tue, 14 Jun 2005 06:14:38 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <200506140114.39398.dtor_core@ameritech.net> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <200506131638.09140.dtor_core@ameritech.net> <20050613221736.GC15381@suse.de> In-Reply-To: <20050613221736.GC15381@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Greg KH Cc: linux-hotplug-devel@lists.sourceforge.net, Kay Sievers , Vojtech Pavlik , LKML , Hannes Reinecke On Monday 13 June 2005 17:17, Greg KH wrote: > On Mon, Jun 13, 2005 at 04:38:08PM -0500, 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: > > > > > > > > where inputX are class devices, mouse and event are subclasses of input > > > > class and mouseX and eventX are again class devices. > > > > > > We don't support childs of class devices until now. Would be nice maybe, but > > > someone needs to add that to the driver-core first and we would need to make > > > a bunch of userspace stuff aware of it ... > > > > > > > Something like patch below will suffice I think (not tested). > > No, you need to increment the parent when you register the child. Look > at the device code for what's needed for this. > Don't quite follow what you are saying. If you are saying that it needs to call class_get(parent) I don't think it's necessary as kobject code will grab the reference (to class's subsystem kset). All in all it seems to be working: [dtor@core ~]$ ls /sys/class/input_dev/ input0 input3 input4 input_dev_subclass [dtor@core ~]$ -- Dmitry ------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jon Smirl Date: Tue, 14 Jun 2005 06:21:53 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <9e473391050613232170f57ea3@mail.gmail.com> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <20050613221657.GB15381@suse.de> In-Reply-To: <20050613221657.GB15381@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Greg KH Cc: Dmitry Torokhov , linux-hotplug-devel@lists.sourceforge.net, Vojtech Pavlik , Kay Sievers , LKML On 6/13/05, Greg KH wrote: > > where inputX are class devices, mouse and event are subclasses of input > > class and mouseX and eventX are again class devices. > > Yes, lots of people want class devices to have children. Unfortunatly > they don't provide patches with their requests :) I did, but you didn't like it. > > thanks, > > greg k-h -- Jon Smirl jonsmirl@gmail.com ------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Tue, 14 Jun 2005 06:38:51 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <20050614063851.GA19620@suse.de> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <20050613221657.GB15381@suse.de> <9e473391050613232170f57ea3@mail.gmail.com> In-Reply-To: <9e473391050613232170f57ea3@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Jon Smirl Cc: Dmitry Torokhov , linux-hotplug-devel@lists.sourceforge.net, Vojtech Pavlik , Kay Sievers , LKML On Tue, Jun 14, 2005 at 02:21:53AM -0400, Jon Smirl wrote: > On 6/13/05, Greg KH wrote: > > > where inputX are class devices, mouse and event are subclasses of input > > > class and mouseX and eventX are again class devices. > > > > Yes, lots of people want class devices to have children. Unfortunatly > > they don't provide patches with their requests :) > > I did, but you didn't like it. Heh, yes, sorry, you did. Hm, I don't even remember why I didn't like it anymore, last I remember, I think you got the parent reference counting correct, right? Care to dig out the patch and send it again? thanks, greg k-h ------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hannes Reinecke Date: Tue, 14 Jun 2005 07:32:48 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <42AE8820.2010102@suse.de> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <20050613212654.GB11182@vrfy.org> <200506131658.37583.dtor_core@ameritech.net> <200506131705.30159.dtor_core@ameritech.net> In-Reply-To: <200506131705.30159.dtor_core@ameritech.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: Dmitry Torokhov Cc: linux-hotplug-devel@lists.sourceforge.net, Kay Sievers , Greg KH , Vojtech Pavlik , LKML , Andrew Morton 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 "inpu= t" >>>>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 handl= ers. >>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? >> >=20 > 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... >=20 My original patch used 'input_device' for it. Would be nice if it could stay. This way we have the following event sequence: input_device event (contains all attributes like 'abs', 'ev' etc.) -> triggers loading of any input modules -> creates the proper input devices input event (contains the 'dev' attribute for udev) As the main point of the original 'input' event is in fact the device node creation (we only have max 4 input modules, which isn't that hard to figure out), I'd vote for keeping the name 'input' for the device event and use a new event type 'input_device' for the class device. And yes, we should break compability and come up with a clean implementation. And as the original input event is an abomination I don't see the point in keeping compability with a broken interface. Cheers, Hannes --=20 Dr. Hannes Reinecke hare@suse.de SuSE Linux AG S390 & zSeries Maxfeldstra=DFe 5 +49 911 74053 688 90409 N=FCrnberg http://www.suse.de ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotp= ut a projector? How fast can you ride your desk chair down the office luge tra= ck? If you want to score the big prize, get to know the little guy. =20 Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 _______________________________________________ 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Date: Tue, 14 Jun 2005 07:42:07 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <200506140242.08982.dtor_core@ameritech.net> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <200506131705.30159.dtor_core@ameritech.net> <42AE8820.2010102@suse.de> In-Reply-To: <42AE8820.2010102@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Hannes Reinecke Cc: linux-hotplug-devel@lists.sourceforge.net, Kay Sievers , Greg KH , Vojtech Pavlik , LKML , Andrew Morton On Tuesday 14 June 2005 02:32, Hannes Reinecke wrote: > And yes, we should break compability and come up with a clean > implementation. But those pesky users scream every time we break their mice ;) > And as the original input event is an abomination I > don't see the point in keeping compability with a broken interface. > Why is it abomination (aside from using old mechanism to call hotplug)? It looks like it transmits all data necessary to load appropriate input handler... -- Dmitry ------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hannes Reinecke Date: Tue, 14 Jun 2005 07:43:26 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <42AE8A9E.5040406@suse.de> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> In-Reply-To: <200506131607.51736.dtor_core@ameritech.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: Dmitry Torokhov Cc: linux-hotplug-devel@lists.sourceforge.net, Greg KH , Vojtech Pavlik , Kay Sievers , LKML Dmitry Torokhov wrote: > Hi, >=20 > 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. >=20 > 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). If not then I could rename Greg's class > to "input_dev" and my new class to "input" and that will be compatible > with older installations.=20 >=20 > Also, in the long run I would probably want to see something like this: >=20 > /sys/class/input---input0 > | > |-input1 > | > |-input2 > | > |-mouse---mouse0 > | | > | |-mouse1 > | | > | --mice > | > |-event---event0 > | > |-event1 > | > |-event2 >=20 > where inputX are class devices, mouse and event are subclasses of input > class and mouseX and eventX are again class devices. >=20 > Objections, suggestions, etc?=20 > =20 Hmm. I don't like it very much as it mixes two different types of devices (class devices and subclasses) into one directory. I think it's cleaner to have two distinct class device types (one for input_dev and one for input). subclasses for the input class devices are a neat idea; but I fear the hotplug event name will change for each subclass device ('input' will become eg 'mouse'), so we again have to change all hotplug handlers. And I don't see an easy solution for that ... Cheers, Hannes --=20 Dr. Hannes Reinecke hare@suse.de SuSE Linux AG S390 & zSeries Maxfeldstra=DFe 5 +49 911 74053 688 90409 N=FCrnberg http://www.suse.de ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotp= ut a projector? How fast can you ride your desk chair down the office luge tra= ck? If you want to score the big prize, get to know the little guy. =20 Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 _______________________________________________ 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hannes Reinecke Date: Tue, 14 Jun 2005 07:47:48 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <42AE8BA4.5020702@suse.de> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <200506131705.30159.dtor_core@ameritech.net> <42AE8820.2010102@suse.de> <200506140242.08982.dtor_core@ameritech.net> In-Reply-To: <200506140242.08982.dtor_core@ameritech.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: Dmitry Torokhov Cc: linux-hotplug-devel@lists.sourceforge.net, Kay Sievers , Greg KH , Vojtech Pavlik , LKML , Andrew Morton Dmitry Torokhov wrote: > On Tuesday 14 June 2005 02:32, Hannes Reinecke wrote: >>And yes, we should break compability and come up with a clean >>implementation. >=20 > But those pesky users scream every time we break their mice ;) >=20 >>And as the original input event is an abomination I=20 >>don't see the point in keeping compability with a broken interface. >> >=20 > Why is it abomination (aside from using old mechanism to call > hotplug)? It looks like it transmits all data necessary to load > appropriate input handler... >=20 Because there are _two_ events with the name 'input'. Both run under the same name but carry different information. One is required to load the module and the other is required to create the device node. That's what I call an abomination. Cheers, Hannes --=20 Dr. Hannes Reinecke hare@suse.de SuSE Linux AG S390 & zSeries Maxfeldstra=DFe 5 +49 911 74053 688 90409 N=FCrnberg http://www.suse.de ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotp= ut a projector? How fast can you ride your desk chair down the office luge tra= ck? If you want to score the big prize, get to know the little guy. =20 Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 _______________________________________________ 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Date: Tue, 14 Jun 2005 07:52:41 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <200506140252.42306.dtor_core@ameritech.net> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <42AE8A9E.5040406@suse.de> In-Reply-To: <42AE8A9E.5040406@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Hannes Reinecke Cc: linux-hotplug-devel@lists.sourceforge.net, Greg KH , Vojtech Pavlik , Kay Sievers , LKML On Tuesday 14 June 2005 02:43, Hannes Reinecke wrote: > Dmitry Torokhov wrote: > > > Hmm. I don't like it very much as it mixes two different types of > devices (class devices and subclasses) into one directory. > If one could come up with a good name to group inputX under I think it will be OK. We'd have XXX, mouse, joystick, event, ... as subclasses and all class_devices will be on level below. OTOH input_devs are parents for mice, joysticks etc so they might be on the higher level. > I think it's cleaner to have two distinct class device types > (one for input_dev and one for input). > I actually detest this practice: [dtor@core ~]$ ls /sys/class/ firmware ieee1394 ieee1394_protocol mem pci_bus sound usb_host graphics ieee1394_host input misc pcmcia_socket tty vc i2c-adapter ieee1394_node input_dev net printer usb [dtor@core ~]$ dtor@anvil ~]$ ls /sys/class/ cpuid i2c-adapter ieee1394_host input msr printer sound usb_host firmware i2c-dev ieee1394_node mem net scsi_device tty vc graphics ieee1394 ieee1394_protocol misc pci_bus scsi_host usb video4linux [dtor@anvil ~]$ Firewire has 4 classes on the uppper level, I2C, USB, SCSI and Input got 2 each. It would be much nicer IMHO if we merge them into trees of classes with poarent class actually defining subsystem. > subclasses for the input class devices are a neat idea; but I fear the > hotplug event name will change for each subclass device ('input' will > become eg 'mouse'), so we again have to change all hotplug handlers. > And I don't see an easy solution for that ... > We could have parent class define agent/subsystem name for all its children. -- Dmitry ------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Date: Tue, 14 Jun 2005 07:56:09 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <200506140256.10313.dtor_core@ameritech.net> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <200506140242.08982.dtor_core@ameritech.net> <42AE8BA4.5020702@suse.de> In-Reply-To: <42AE8BA4.5020702@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Hannes Reinecke Cc: linux-hotplug-devel@lists.sourceforge.net, Kay Sievers , Greg KH , Vojtech Pavlik , LKML , Andrew Morton On Tuesday 14 June 2005 02:47, Hannes Reinecke wrote: > Dmitry Torokhov wrote: > > On Tuesday 14 June 2005 02:32, Hannes Reinecke wrote: > >>And yes, we should break compability and come up with a clean > >>implementation. > > > > But those pesky users scream every time we break their mice ;) > > > >>And as the original input event is an abomination I > >>don't see the point in keeping compability with a broken interface. > >> > > > > Why is it abomination (aside from using old mechanism to call > > hotplug)? It looks like it transmits all data necessary to load > > appropriate input handler... > > > Because there are _two_ events with the name 'input'. > Both run under the same name but carry different information. > One is required to load the module and the other is required to create > the device node. > > That's what I call an abomination. > Ah, I see. Yep, it "input" wasn't reused when input_handlers were converted to class_simple we probably would not have this discussion now. -- Dmitry ------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hannes Reinecke Date: Tue, 14 Jun 2005 08:00:15 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <42AE8E8F.5070404@suse.de> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <42AE8A9E.5040406@suse.de> <200506140252.42306.dtor_core@ameritech.net> In-Reply-To: <200506140252.42306.dtor_core@ameritech.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: Dmitry Torokhov Cc: linux-hotplug-devel@lists.sourceforge.net, Greg KH , Vojtech Pavlik , Kay Sievers , LKML Dmitry Torokhov wrote: > On Tuesday 14 June 2005 02:43, Hannes Reinecke wrote: >>Dmitry Torokhov wrote: >>> =20 >>Hmm. I don't like it very much as it mixes two different types of >>devices (class devices and subclasses) into one directory. >> >=20 > If one could come up with a good name to group inputX under I think > it will be OK. We'd have XXX, mouse, joystick, event, ... as subclasses > and all class_devices will be on level below. OTOH input_devs are parents > for mice, joysticks etc so they might be on the higher level. >=20 >>I think it's cleaner to have two distinct class device types >>(one for input_dev and one for input). >> >=20 > I actually detest this practice: >=20 > [dtor@core ~]$ ls /sys/class/ > firmware ieee1394 ieee1394_protocol mem pci_bus sound= usb_host > graphics ieee1394_host input misc pcmcia_socket tty = vc > i2c-adapter ieee1394_node input_dev net printer usb > [dtor@core ~]$ >=20 > dtor@anvil ~]$ ls /sys/class/ > cpuid i2c-adapter ieee1394_host input msr printer so= und usb_host > firmware i2c-dev ieee1394_node mem net scsi_device tt= y vc > graphics ieee1394 ieee1394_protocol misc pci_bus scsi_host us= b video4linux > [dtor@anvil ~]$ >=20 > Firewire has 4 classes on the uppper level, I2C, USB, SCSI and Input got > 2 each. It would be much nicer IMHO if we merge them into trees of classes > with poarent class actually defining subsystem. =20 >=20 Correct. And this in indeed a shortcoming of the driver model, as it basically only knows about classes and devices. Maybe it's about time to introduce a subsystem? >>subclasses for the input class devices are a neat idea; but I fear the >>hotplug event name will change for each subclass device ('input' will >>become eg 'mouse'), so we again have to change all hotplug handlers. >>And I don't see an easy solution for that ... >> >=20 > We could have parent class define agent/subsystem name for all its childr= en. >=20 Hmm. We probably could. Cheers, Hannes --=20 Dr. Hannes Reinecke hare@suse.de SuSE Linux AG S390 & zSeries Maxfeldstra=DFe 5 +49 911 74053 688 90409 N=FCrnberg http://www.suse.de ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotp= ut a projector? How fast can you ride your desk chair down the office luge tra= ck? If you want to score the big prize, get to know the little guy. =20 Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 _______________________________________________ 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jon Smirl Date: Tue, 14 Jun 2005 13:41:34 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <9e473391050614064111451333@mail.gmail.com> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <20050613221657.GB15381@suse.de> <9e473391050613232170f57ea3@mail.gmail.com> <20050614063851.GA19620@suse.de> In-Reply-To: <20050614063851.GA19620@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Greg KH Cc: Dmitry Torokhov , linux-hotplug-devel@lists.sourceforge.net, Vojtech Pavlik , Kay Sievers , LKML On 6/14/05, Greg KH wrote: > > > Yes, lots of people want class devices to have children. Unfortunatly > > > they don't provide patches with their requests :) > > > > I did, but you didn't like it. > > Heh, yes, sorry, you did. > > Hm, I don't even remember why I didn't like it anymore, last I remember, > I think you got the parent reference counting correct, right? Care to > dig out the patch and send it again? Check out the thread "event sequencing" in the hotplug group. -- Jon Smirl jonsmirl@gmail.com ------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jon Smirl Date: Tue, 14 Jun 2005 15:02:43 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <9e473391050614080230ae359d@mail.gmail.com> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <20050613221657.GB15381@suse.de> <9e473391050613232170f57ea3@mail.gmail.com> <20050614063851.GA19620@suse.de> In-Reply-To: <20050614063851.GA19620@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Greg KH Cc: Dmitry Torokhov , linux-hotplug-devel@lists.sourceforge.net, Vojtech Pavlik , Kay Sievers , LKML On 6/14/05, Greg KH wrote: > Heh, yes, sorry, you did. > > Hm, I don't even remember why I didn't like it anymore, last I remember, > I think you got the parent reference counting correct, right? Care to > dig out the patch and send it again? I brought this forward from a kernel a couple of months old so it may need some checking. diff --git a/drivers/base/class.c b/drivers/base/class.c --- a/drivers/base/class.c +++ b/drivers/base/class.c @@ -406,8 +406,9 @@ int class_device_add(struct class_device /* first, register with generic layer. */ kobject_set_name(&class_dev->kobj, "%s", class_dev->class_id); - if (parent) + if (parent && !class_dev->kobj.parent) class_dev->kobj.parent = &parent->subsys.kset.kobj; + class_dev->kobj.parent = kobject_get(class_dev->kobj.parent); if ((error = kobject_add(&class_dev->kobj))) goto register_done; @@ -438,6 +439,12 @@ int class_device_add(struct class_device return error; } +int class_device_add_child(struct class_device *class_dev, struct class_device *parent) +{ + class_dev->kobj.parent = &class_dev->kobj; + return class_device_add(class_dev); +} + int class_device_register(struct class_device *class_dev) { class_device_initialize(class_dev); @@ -463,6 +470,7 @@ void class_device_del(struct class_devic class_device_remove_attrs(class_dev); kobject_hotplug(&class_dev->kobj, KOBJ_REMOVE); + kobject_put(class_dev->kobj.parent); kobject_del(&class_dev->kobj); if (parent) @@ -581,6 +589,7 @@ EXPORT_SYMBOL_GPL(class_device_register) EXPORT_SYMBOL_GPL(class_device_unregister); EXPORT_SYMBOL_GPL(class_device_initialize); EXPORT_SYMBOL_GPL(class_device_add); +EXPORT_SYMBOL_GPL(class_device_add_child); EXPORT_SYMBOL_GPL(class_device_del); EXPORT_SYMBOL_GPL(class_device_get); EXPORT_SYMBOL_GPL(class_device_put); diff --git a/include/linux/device.h b/include/linux/device.h --- a/include/linux/device.h +++ b/include/linux/device.h @@ -208,6 +208,7 @@ extern int class_device_register(struct extern void class_device_unregister(struct class_device *); extern void class_device_initialize(struct class_device *); extern int class_device_add(struct class_device *); +extern int class_device_add_child(struct class_device *, struct class_device *); extern void class_device_del(struct class_device *); extern int class_device_rename(struct class_device *, char *); -- Jon Smirl jonsmirl@gmail.com ------------------------------------------------------- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Date: Tue, 14 Jun 2005 18:16:40 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <200506141316.42266.dtor_core@ameritech.net> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <20050614063851.GA19620@suse.de> <9e473391050614080230ae359d@mail.gmail.com> In-Reply-To: <9e473391050614080230ae359d@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Jon Smirl Cc: Greg KH , linux-hotplug-devel@lists.sourceforge.net, Vojtech Pavlik , Kay Sievers , LKML On Tuesday 14 June 2005 10:02, Jon Smirl wrote: > On 6/14/05, Greg KH wrote: > > Heh, yes, sorry, you did. > > > > Hm, I don't even remember why I didn't like it anymore, last I remember, > > I think you got the parent reference counting correct, right? Care to > > dig out the patch and send it again? > > I brought this forward from a kernel a couple of months old so it may > need some checking. > Ah, this one allows adding subdevices to class devices whereas mine is for adding subclasses to classes. Both are needed in the long run IMHO. -- Dmitry ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click _______________________________________________ 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Brownell Date: Sun, 19 Jun 2005 14:46:49 +0000 Subject: Re: Input sysbsystema and hotplug Message-Id: <200506190746.49865.david-b@pacbell.net> List-Id: References: <200506131607.51736.dtor_core@ameritech.net> <200506140242.08982.dtor_core@ameritech.net> <42AE8BA4.5020702@suse.de> In-Reply-To: <42AE8BA4.5020702@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug-devel@lists.sourceforge.net Cc: Hannes Reinecke , Dmitry Torokhov , Kay Sievers , Greg KH , Vojtech Pavlik , LKML , Andrew Morton On Tuesday 14 June 2005 12:47 am, Hannes Reinecke wrote: > > Because there are _two_ events with the name 'input'. > Both run under the same name but carry different information. > One is required to load the module and the other is required to create > the device node. > > That's what I call an abomination. Or at least messy, though it's been true forever that all the event classes have included multiple events. USB hotplug has aided both "interface" and "device" driver match policies since before 2.4.0, for example. I guess "input" has seemed simpler, partially because it started later and slimmer. Maybe starting with the next kernel or so, distros should be starting to avoid these issues by converting to slim versions of the /sbin/hotplug script, handling the two steps separately. First the driver loading ... for USB, PCI/Cardbus, and PCMCIA this usually suffices: if [ "$ACTION" = "add" -a -n "$MODALIAS" -a ! -L $DEVPATH/driver ] then modprobe -q $MODALIAS fi Then (otherwise?) the device node creation if [ -n "$DEVPATH" ] then /sbin/udevsend $1 fi And don't have any /etc/hotplug or /etc/hotplug.d scripts. (There'd still need to be an /etc/init.d/coldplug to make up for hotplug events that preceded viable userspace.) One problem with that is that not all subsystems yet support the new $MODALIAS (and /sys/devices/.../modalias) stuff, and of course "input" is one subsystem that doesn't. That support shifts the "what module to load" logic from hotplug scripts (slow and no-longer-appropriate) over to module-init-tools (3.2 and newer for the PCMCIA support). - Dave ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click _______________________________________________ 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261327AbVFMVds (ORCPT ); Mon, 13 Jun 2005 17:33:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261400AbVFMVdC (ORCPT ); Mon, 13 Jun 2005 17:33:02 -0400 Received: from soundwarez.org ([217.160.171.123]:41692 "EHLO soundwarez.org") by vger.kernel.org with ESMTP id S261327AbVFMV07 (ORCPT ); Mon, 13 Jun 2005 17:26:59 -0400 Date: Mon, 13 Jun 2005 23:26:54 +0200 From: Kay Sievers To: Dmitry Torokhov Cc: linux-hotplug-devel@lists.sourceforge.net, Greg KH , Vojtech Pavlik , LKML , Hannes Reinecke Subject: Re: Input sysbsystema and hotplug Message-ID: <20050613212654.GB11182@vrfy.org> References: <200506131607.51736.dtor_core@ameritech.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200506131607.51736.dtor_core@ameritech.net> User-Agent: Mutt/1.5.9i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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. :) > If not then I could rename Greg's class > to "input_dev" and my new class to "input" and that will be compatible > with older installations. I still think we should rename the parent-input device class and keep the more interesting class named "input", cause this will not break current setups besides one hotplug-handler and follows the usual style in sysfs. > Also, in the long run I would probably want to see something like this: > > /sys/class/input---input0 > | > |-input1 > | > |-input2 > | > |-mouse---mouse0 > | | > | |-mouse1 > | | > | --mice > | > |-event---event0 > | > |-event1 > | > |-event2 > > where inputX are class devices, mouse and event are subclasses of input > class and mouseX and eventX are again class devices. We don't support childs of class devices until now. Would be nice maybe, but someone needs to add that to the driver-core first and we would need to make a bunch of userspace stuff aware of it ... Kay From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261400AbVFMVl4 (ORCPT ); Mon, 13 Jun 2005 17:41:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261435AbVFMVjX (ORCPT ); Mon, 13 Jun 2005 17:39:23 -0400 Received: from smtp838.mail.sc5.yahoo.com ([66.163.171.25]:58016 "HELO smtp838.mail.sc5.yahoo.com") by vger.kernel.org with SMTP id S261432AbVFMVib (ORCPT ); Mon, 13 Jun 2005 17:38:31 -0400 From: Dmitry Torokhov To: linux-hotplug-devel@lists.sourceforge.net Subject: Re: Input sysbsystema and hotplug Date: Mon, 13 Jun 2005 16:38:08 -0500 User-Agent: KMail/1.8.1 Cc: Kay Sievers , Greg KH , Vojtech Pavlik , LKML , Hannes Reinecke References: <200506131607.51736.dtor_core@ameritech.net> <20050613212654.GB11182@vrfy.org> In-Reply-To: <20050613212654.GB11182@vrfy.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200506131638.09140.dtor_core@ameritech.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Monday 13 June 2005 16:26, Kay Sievers wrote: > On Mon, Jun 13, 2005 at 04:07:51PM -0500, Dmitry Torokhov wrote: > > > > where inputX are class devices, mouse and event are subclasses of input > > class and mouseX and eventX are again class devices. > > We don't support childs of class devices until now. Would be nice maybe, but > someone needs to add that to the driver-core first and we would need to make > a bunch of userspace stuff aware of it ... > Something like patch below will suffice I think (not tested). -- Dmitry drivers/base/class.c | 5 ++++- include/linux/device.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) Signed-off-by: Dmitry Torokhov --- Index: work/drivers/base/class.c =================================================================== --- work.orig/drivers/base/class.c +++ work/drivers/base/class.c @@ -145,7 +145,10 @@ int class_register(struct class * cls) if (error) return error; - subsys_set_kset(cls, class_subsys); + if (cls->parent) + subsys_set_kset(cls, cls->parent->subsys); + else + subsys_set_kset(cls, class_subsys); error = subsystem_register(&cls->subsys); if (!error) { Index: work/include/linux/device.h =================================================================== --- work.orig/include/linux/device.h +++ work/include/linux/device.h @@ -145,6 +145,7 @@ struct class { char * name; struct subsystem subsys; + struct class * parent; struct list_head children; struct list_head interfaces; struct semaphore sem; /* locks both the children and interfaces lists */ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261518AbVFMWQs (ORCPT ); Mon, 13 Jun 2005 18:16:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261516AbVFMWQk (ORCPT ); Mon, 13 Jun 2005 18:16:40 -0400 Received: from lyle.provo.novell.com ([137.65.81.174]:7193 "EHLO lyle.provo.novell.com") by vger.kernel.org with ESMTP id S261519AbVFMWPM (ORCPT ); Mon, 13 Jun 2005 18:15:12 -0400 Date: Mon, 13 Jun 2005 15:15:00 -0700 From: Greg KH To: Dmitry Torokhov Cc: linux-hotplug-devel@lists.sourceforge.net, Kay Sievers , Vojtech Pavlik , LKML , Hannes Reinecke , Andrew Morton Subject: Re: Input sysbsystema and hotplug Message-ID: <20050613221500.GA15381@suse.de> References: <200506131607.51736.dtor_core@ameritech.net> <20050613212654.GB11182@vrfy.org> <200506131658.37583.dtor_core@ameritech.net> <200506131705.30159.dtor_core@ameritech.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200506131705.30159.dtor_core@ameritech.net> User-Agent: Mutt/1.5.8i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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? thanks, greg k-h From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261539AbVFMWUw (ORCPT ); Mon, 13 Jun 2005 18:20:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261536AbVFMWTU (ORCPT ); Mon, 13 Jun 2005 18:19:20 -0400 Received: from lyle.provo.novell.com ([137.65.81.174]:15129 "EHLO lyle.provo.novell.com") by vger.kernel.org with ESMTP id S261511AbVFMWRO (ORCPT ); Mon, 13 Jun 2005 18:17:14 -0400 Date: Mon, 13 Jun 2005 15:16:57 -0700 From: Greg KH To: Dmitry Torokhov Cc: linux-hotplug-devel@lists.sourceforge.net, Vojtech Pavlik , Kay Sievers , LKML Subject: Re: Input sysbsystema and hotplug Message-ID: <20050613221657.GB15381@suse.de> References: <200506131607.51736.dtor_core@ameritech.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200506131607.51736.dtor_core@ameritech.net> User-Agent: Mutt/1.5.8i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 13, 2005 at 04:07:51PM -0500, Dmitry Torokhov wrote: > Hi, > > 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. Why not? What's wrong with using the existing input class? I was hopeing it would get flushed out into something "real" someday. All you have to do is keep the "dev" stuff in there somewhere and udev will be happy. > /sys/class/input---input0 > | > |-input1 > | > |-input2 > | > |-mouse---mouse0 > | | > | |-mouse1 > | | > | --mice > | > |-event---event0 > | > |-event1 > | > |-event2 > > where inputX are class devices, mouse and event are subclasses of input > class and mouseX and eventX are again class devices. Yes, lots of people want class devices to have children. Unfortunatly they don't provide patches with their requests :) thanks, greg k-h From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261540AbVFMW0A (ORCPT ); Mon, 13 Jun 2005 18:26:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261511AbVFMWYE (ORCPT ); Mon, 13 Jun 2005 18:24:04 -0400 Received: from soundwarez.org ([217.160.171.123]:23520 "EHLO soundwarez.org") by vger.kernel.org with ESMTP id S261515AbVFMWVe (ORCPT ); Mon, 13 Jun 2005 18:21:34 -0400 Date: Tue, 14 Jun 2005 00:21:29 +0200 From: Kay Sievers To: Dmitry Torokhov Cc: linux-hotplug-devel@lists.sourceforge.net, Greg KH , Vojtech Pavlik , LKML , Hannes Reinecke , Andrew Morton Subject: Re: Input sysbsystema and hotplug Message-ID: <20050613222129.GA11671@vrfy.org> References: <200506131607.51736.dtor_core@ameritech.net> <20050613212654.GB11182@vrfy.org> <200506131658.37583.dtor_core@ameritech.net> <200506131705.30159.dtor_core@ameritech.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200506131705.30159.dtor_core@ameritech.net> User-Agent: Mutt/1.5.9i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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... Hmm, not sure. It is not udev itself, it's the rule set which is different on every distro and not really in our control. The hotplug agent is just one symlink if you want a quick & dirty fix. Kay From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261552AbVFMWW5 (ORCPT ); Mon, 13 Jun 2005 18:22:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261533AbVFMWTA (ORCPT ); Mon, 13 Jun 2005 18:19:00 -0400 Received: from lyle.provo.novell.com ([137.65.81.174]:19225 "EHLO lyle.provo.novell.com") by vger.kernel.org with ESMTP id S261530AbVFMWRo (ORCPT ); Mon, 13 Jun 2005 18:17:44 -0400 Date: Mon, 13 Jun 2005 15:17:36 -0700 From: Greg KH To: Dmitry Torokhov Cc: linux-hotplug-devel@lists.sourceforge.net, Kay Sievers , Vojtech Pavlik , LKML , Hannes Reinecke Subject: Re: Input sysbsystema and hotplug Message-ID: <20050613221736.GC15381@suse.de> References: <200506131607.51736.dtor_core@ameritech.net> <20050613212654.GB11182@vrfy.org> <200506131638.09140.dtor_core@ameritech.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200506131638.09140.dtor_core@ameritech.net> User-Agent: Mutt/1.5.8i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 13, 2005 at 04:38:08PM -0500, 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: > > > > > > where inputX are class devices, mouse and event are subclasses of input > > > class and mouseX and eventX are again class devices. > > > > We don't support childs of class devices until now. Would be nice maybe, but > > someone needs to add that to the driver-core first and we would need to make > > a bunch of userspace stuff aware of it ... > > > > Something like patch below will suffice I think (not tested). No, you need to increment the parent when you register the child. Look at the device code for what's needed for this. thanks, greg k-h From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261483AbVFMWDR (ORCPT ); Mon, 13 Jun 2005 18:03:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261487AbVFMWAs (ORCPT ); Mon, 13 Jun 2005 18:00:48 -0400 Received: from smtp802.mail.sc5.yahoo.com ([66.163.168.181]:12667 "HELO smtp802.mail.sc5.yahoo.com") by vger.kernel.org with SMTP id S261490AbVFMV6o (ORCPT ); Mon, 13 Jun 2005 17:58:44 -0400 From: Dmitry Torokhov To: Kay Sievers Subject: Re: Input sysbsystema and hotplug Date: Mon, 13 Jun 2005 16:58:36 -0500 User-Agent: KMail/1.8.1 Cc: linux-hotplug-devel@lists.sourceforge.net, Greg KH , Vojtech Pavlik , LKML , Hannes Reinecke , Andrew Morton References: <200506131607.51736.dtor_core@ameritech.net> <20050613212654.GB11182@vrfy.org> In-Reply-To: <20050613212654.GB11182@vrfy.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200506131658.37583.dtor_core@ameritech.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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? Adding Andrew to CC... > > If not then I could rename Greg's class > > to "input_dev" and my new class to "input" and that will be compatible > > with older installations. > > I still think we should rename the parent-input device class and keep > the more interesting class named "input", cause this will not break current > setups besides one hotplug-handler and follows the usual style in sysfs. -- Dmitry From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261495AbVFMXp5 (ORCPT ); Mon, 13 Jun 2005 19:45:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261472AbVFMXpU (ORCPT ); Mon, 13 Jun 2005 19:45:20 -0400 Received: from smtp814.mail.sc5.yahoo.com ([66.163.170.84]:1375 "HELO smtp814.mail.sc5.yahoo.com") by vger.kernel.org with SMTP id S261493AbVFMWFp (ORCPT ); Mon, 13 Jun 2005 18:05:45 -0400 From: Dmitry Torokhov To: linux-hotplug-devel@lists.sourceforge.net Subject: Re: Input sysbsystema and hotplug Date: Mon, 13 Jun 2005 17:05:29 -0500 User-Agent: KMail/1.8.1 Cc: Kay Sievers , Greg KH , Vojtech Pavlik , LKML , Hannes Reinecke , Andrew Morton References: <200506131607.51736.dtor_core@ameritech.net> <20050613212654.GB11182@vrfy.org> <200506131658.37583.dtor_core@ameritech.net> In-Reply-To: <200506131658.37583.dtor_core@ameritech.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200506131705.30159.dtor_core@ameritech.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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... -- Dmitry From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261427AbVFNE0V (ORCPT ); Tue, 14 Jun 2005 00:26:21 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261430AbVFNE0V (ORCPT ); Tue, 14 Jun 2005 00:26:21 -0400 Received: from smtp815.mail.sc5.yahoo.com ([66.163.170.1]:8377 "HELO smtp815.mail.sc5.yahoo.com") by vger.kernel.org with SMTP id S261427AbVFNE0Q convert rfc822-to-8bit (ORCPT ); Tue, 14 Jun 2005 00:26:16 -0400 From: Dmitry Torokhov To: Greg KH Subject: Re: Input sysbsystema and hotplug Date: Mon, 13 Jun 2005 23:26:06 -0500 User-Agent: KMail/1.8.1 Cc: linux-hotplug-devel@lists.sourceforge.net, Vojtech Pavlik , Kay Sievers , LKML References: <200506131607.51736.dtor_core@ameritech.net> <20050613221657.GB15381@suse.de> In-Reply-To: <20050613221657.GB15381@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT Content-Disposition: inline Message-Id: <200506132326.06630.dtor_core@ameritech.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Monday 13 June 2005 17:16, Greg KH wrote: > On Mon, Jun 13, 2005 at 04:07:51PM -0500, Dmitry Torokhov wrote: > > Hi, > > > > 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. > > Why not?  What's wrong with using the existing input class?  I was > hopeing it would get flushed out into something "real" someday.  All you > have to do is keep the "dev" stuff in there somewhere and udev will be > happy. > They are different. Your input class represents userpsace interfaces, my input class represent middleman class devices. If you remember, input core looks like this: evdev (/dev/input/eventX devices) / hardware / device -------- input_dev - mousedev (/dev/input/mouseX, (serio port, \ /dev/input/mice USB port) \ joydev (/dev/input/jsX devices) Your input class is fine (except for its name as it uses the same name that input core was/is using for notification about new instances of input_devs), but it represents different point in object hierarchy, as it represents /dev/input/{mouse|event|js}X objects. Your class devices are useful to properly create device nodes and probably set up userspace applications to use new input devices. My input_dev class devices are useful so hotplug would load proper input handlers (joysdev, mousedev) to create your class devices. I hope it explains things a bit... -- Dmitry From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261233AbVFNGIb (ORCPT ); Tue, 14 Jun 2005 02:08:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261240AbVFNGIb (ORCPT ); Tue, 14 Jun 2005 02:08:31 -0400 Received: from smtp830.mail.sc5.yahoo.com ([66.163.171.17]:63897 "HELO smtp830.mail.sc5.yahoo.com") by vger.kernel.org with SMTP id S261233AbVFNGIU (ORCPT ); Tue, 14 Jun 2005 02:08:20 -0400 From: Dmitry Torokhov To: Greg KH Subject: Re: Input sysbsystema and hotplug Date: Tue, 14 Jun 2005 01:08:16 -0500 User-Agent: KMail/1.8.1 Cc: linux-hotplug-devel@lists.sourceforge.net, Kay Sievers , Vojtech Pavlik , LKML , Hannes Reinecke , Andrew Morton References: <200506131607.51736.dtor_core@ameritech.net> <200506131705.30159.dtor_core@ameritech.net> <20050613221500.GA15381@suse.de> In-Reply-To: <20050613221500.GA15381@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200506140108.16737.dtor_core@ameritech.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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 SUBSYSTEM= in 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 --- 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); From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261240AbVFNGOs (ORCPT ); Tue, 14 Jun 2005 02:14:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261243AbVFNGOr (ORCPT ); Tue, 14 Jun 2005 02:14:47 -0400 Received: from smtp803.mail.sc5.yahoo.com ([66.163.168.182]:28576 "HELO smtp803.mail.sc5.yahoo.com") by vger.kernel.org with SMTP id S261240AbVFNGOp (ORCPT ); Tue, 14 Jun 2005 02:14:45 -0400 From: Dmitry Torokhov To: Greg KH Subject: Re: Input sysbsystema and hotplug Date: Tue, 14 Jun 2005 01:14:38 -0500 User-Agent: KMail/1.8.1 Cc: linux-hotplug-devel@lists.sourceforge.net, Kay Sievers , Vojtech Pavlik , LKML , Hannes Reinecke References: <200506131607.51736.dtor_core@ameritech.net> <200506131638.09140.dtor_core@ameritech.net> <20050613221736.GC15381@suse.de> In-Reply-To: <20050613221736.GC15381@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200506140114.39398.dtor_core@ameritech.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Monday 13 June 2005 17:17, Greg KH wrote: > On Mon, Jun 13, 2005 at 04:38:08PM -0500, 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: > > > > > > > > where inputX are class devices, mouse and event are subclasses of input > > > > class and mouseX and eventX are again class devices. > > > > > > We don't support childs of class devices until now. Would be nice maybe, but > > > someone needs to add that to the driver-core first and we would need to make > > > a bunch of userspace stuff aware of it ... > > > > > > > Something like patch below will suffice I think (not tested). > > No, you need to increment the parent when you register the child. Look > at the device code for what's needed for this. > Don't quite follow what you are saying. If you are saying that it needs to call class_get(parent) I don't think it's necessary as kobject code will grab the reference (to class's subsystem kset). All in all it seems to be working: [dtor@core ~]$ ls /sys/class/input_dev/ input0 input3 input4 input_dev_subclass [dtor@core ~]$ -- Dmitry From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261161AbVFNGV6 (ORCPT ); Tue, 14 Jun 2005 02:21:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261243AbVFNGV6 (ORCPT ); Tue, 14 Jun 2005 02:21:58 -0400 Received: from wproxy.gmail.com ([64.233.184.201]:43429 "EHLO wproxy.gmail.com") by vger.kernel.org with ESMTP id S261161AbVFNGV4 convert rfc822-to-8bit (ORCPT ); Tue, 14 Jun 2005 02:21:56 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=BNtggKPnKYorLOB45i92rAz0Z/w98qi56eCQmmJqR++l/XHXABXQnITMOuM3hd2A+29gpF/NRzPuwam+fnOtFBGb2y9I2s64JvXE/Xc26XDOXVqvvtd86dmajwTgq+5rVRPyKP7M412BZ2N9RehU4vCgMR+ENgcM2WLj59oP1Ns= Message-ID: <9e473391050613232170f57ea3@mail.gmail.com> Date: Tue, 14 Jun 2005 02:21:53 -0400 From: Jon Smirl Reply-To: Jon Smirl To: Greg KH Subject: Re: Input sysbsystema and hotplug Cc: Dmitry Torokhov , linux-hotplug-devel@lists.sourceforge.net, Vojtech Pavlik , Kay Sievers , LKML In-Reply-To: <20050613221657.GB15381@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Content-Disposition: inline References: <200506131607.51736.dtor_core@ameritech.net> <20050613221657.GB15381@suse.de> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On 6/13/05, Greg KH wrote: > > where inputX are class devices, mouse and event are subclasses of input > > class and mouseX and eventX are again class devices. > > Yes, lots of people want class devices to have children. Unfortunatly > they don't provide patches with their requests :) I did, but you didn't like it. > > thanks, > > greg k-h -- Jon Smirl jonsmirl@gmail.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261247AbVFNGjE (ORCPT ); Tue, 14 Jun 2005 02:39:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261252AbVFNGjE (ORCPT ); Tue, 14 Jun 2005 02:39:04 -0400 Received: from lyle.provo.novell.com ([137.65.81.174]:31018 "EHLO lyle.provo.novell.com") by vger.kernel.org with ESMTP id S261247AbVFNGjB (ORCPT ); Tue, 14 Jun 2005 02:39:01 -0400 Date: Mon, 13 Jun 2005 23:38:51 -0700 From: Greg KH To: Jon Smirl Cc: Dmitry Torokhov , linux-hotplug-devel@lists.sourceforge.net, Vojtech Pavlik , Kay Sievers , LKML Subject: Re: Input sysbsystema and hotplug Message-ID: <20050614063851.GA19620@suse.de> References: <200506131607.51736.dtor_core@ameritech.net> <20050613221657.GB15381@suse.de> <9e473391050613232170f57ea3@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9e473391050613232170f57ea3@mail.gmail.com> User-Agent: Mutt/1.5.8i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 14, 2005 at 02:21:53AM -0400, Jon Smirl wrote: > On 6/13/05, Greg KH wrote: > > > where inputX are class devices, mouse and event are subclasses of input > > > class and mouseX and eventX are again class devices. > > > > Yes, lots of people want class devices to have children. Unfortunatly > > they don't provide patches with their requests :) > > I did, but you didn't like it. Heh, yes, sorry, you did. Hm, I don't even remember why I didn't like it anymore, last I remember, I think you got the parent reference counting correct, right? Care to dig out the patch and send it again? thanks, greg k-h From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261305AbVFNHdB (ORCPT ); Tue, 14 Jun 2005 03:33:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261306AbVFNHdB (ORCPT ); Tue, 14 Jun 2005 03:33:01 -0400 Received: from ns1.suse.de ([195.135.220.2]:7625 "EHLO mx1.suse.de") by vger.kernel.org with ESMTP id S261305AbVFNHcw (ORCPT ); Tue, 14 Jun 2005 03:32:52 -0400 Message-ID: <42AE8820.2010102@suse.de> Date: Tue, 14 Jun 2005 09:32:48 +0200 From: Hannes Reinecke Organization: SuSE Linux AG User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050317 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dmitry Torokhov Cc: linux-hotplug-devel@lists.sourceforge.net, Kay Sievers , Greg KH , Vojtech Pavlik , LKML , Andrew Morton Subject: Re: Input sysbsystema and hotplug References: <200506131607.51736.dtor_core@ameritech.net> <20050613212654.GB11182@vrfy.org> <200506131658.37583.dtor_core@ameritech.net> <200506131705.30159.dtor_core@ameritech.net> In-Reply-To: <200506131705.30159.dtor_core@ameritech.net> X-Enigmail-Version: 0.90.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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... > My original patch used 'input_device' for it. Would be nice if it could stay. This way we have the following event sequence: input_device event (contains all attributes like 'abs', 'ev' etc.) -> triggers loading of any input modules -> creates the proper input devices input event (contains the 'dev' attribute for udev) As the main point of the original 'input' event is in fact the device node creation (we only have max 4 input modules, which isn't that hard to figure out), I'd vote for keeping the name 'input' for the device event and use a new event type 'input_device' for the class device. And yes, we should break compability and come up with a clean implementation. And as the original input event is an abomination I don't see the point in keeping compability with a broken interface. Cheers, Hannes -- Dr. Hannes Reinecke hare@suse.de SuSE Linux AG S390 & zSeries Maxfeldstraße 5 +49 911 74053 688 90409 Nürnberg http://www.suse.de From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261307AbVFNHmP (ORCPT ); Tue, 14 Jun 2005 03:42:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261310AbVFNHmP (ORCPT ); Tue, 14 Jun 2005 03:42:15 -0400 Received: from smtp823.mail.sc5.yahoo.com ([66.163.171.9]:34213 "HELO smtp823.mail.sc5.yahoo.com") by vger.kernel.org with SMTP id S261307AbVFNHmM (ORCPT ); Tue, 14 Jun 2005 03:42:12 -0400 From: Dmitry Torokhov To: Hannes Reinecke Subject: Re: Input sysbsystema and hotplug Date: Tue, 14 Jun 2005 02:42:07 -0500 User-Agent: KMail/1.8.1 Cc: linux-hotplug-devel@lists.sourceforge.net, Kay Sievers , Greg KH , Vojtech Pavlik , LKML , Andrew Morton References: <200506131607.51736.dtor_core@ameritech.net> <200506131705.30159.dtor_core@ameritech.net> <42AE8820.2010102@suse.de> In-Reply-To: <42AE8820.2010102@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200506140242.08982.dtor_core@ameritech.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 14 June 2005 02:32, Hannes Reinecke wrote: > And yes, we should break compability and come up with a clean > implementation. But those pesky users scream every time we break their mice ;) > And as the original input event is an abomination I > don't see the point in keeping compability with a broken interface. > Why is it abomination (aside from using old mechanism to call hotplug)? It looks like it transmits all data necessary to load appropriate input handler... -- Dmitry From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261314AbVFNHoG (ORCPT ); Tue, 14 Jun 2005 03:44:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261315AbVFNHoG (ORCPT ); Tue, 14 Jun 2005 03:44:06 -0400 Received: from mail.suse.de ([195.135.220.2]:53961 "EHLO mx1.suse.de") by vger.kernel.org with ESMTP id S261311AbVFNHnb (ORCPT ); Tue, 14 Jun 2005 03:43:31 -0400 Message-ID: <42AE8A9E.5040406@suse.de> Date: Tue, 14 Jun 2005 09:43:26 +0200 From: Hannes Reinecke Organization: SuSE Linux AG User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050317 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dmitry Torokhov Cc: linux-hotplug-devel@lists.sourceforge.net, Greg KH , Vojtech Pavlik , Kay Sievers , LKML Subject: Re: Input sysbsystema and hotplug References: <200506131607.51736.dtor_core@ameritech.net> In-Reply-To: <200506131607.51736.dtor_core@ameritech.net> X-Enigmail-Version: 0.90.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Dmitry Torokhov wrote: > Hi, > > 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). If not then I could rename Greg's class > to "input_dev" and my new class to "input" and that will be compatible > with older installations. > > Also, in the long run I would probably want to see something like this: > > /sys/class/input---input0 > | > |-input1 > | > |-input2 > | > |-mouse---mouse0 > | | > | |-mouse1 > | | > | --mice > | > |-event---event0 > | > |-event1 > | > |-event2 > > where inputX are class devices, mouse and event are subclasses of input > class and mouseX and eventX are again class devices. > > Objections, suggestions, etc? > Hmm. I don't like it very much as it mixes two different types of devices (class devices and subclasses) into one directory. I think it's cleaner to have two distinct class device types (one for input_dev and one for input). subclasses for the input class devices are a neat idea; but I fear the hotplug event name will change for each subclass device ('input' will become eg 'mouse'), so we again have to change all hotplug handlers. And I don't see an easy solution for that ... Cheers, Hannes -- Dr. Hannes Reinecke hare@suse.de SuSE Linux AG S390 & zSeries Maxfeldstraße 5 +49 911 74053 688 90409 Nürnberg http://www.suse.de From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261306AbVFNHsN (ORCPT ); Tue, 14 Jun 2005 03:48:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261311AbVFNHsM (ORCPT ); Tue, 14 Jun 2005 03:48:12 -0400 Received: from cantor2.suse.de ([195.135.220.15]:40409 "EHLO mx2.suse.de") by vger.kernel.org with ESMTP id S261306AbVFNHrw (ORCPT ); Tue, 14 Jun 2005 03:47:52 -0400 Message-ID: <42AE8BA4.5020702@suse.de> Date: Tue, 14 Jun 2005 09:47:48 +0200 From: Hannes Reinecke Organization: SuSE Linux AG User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050317 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dmitry Torokhov Cc: linux-hotplug-devel@lists.sourceforge.net, Kay Sievers , Greg KH , Vojtech Pavlik , LKML , Andrew Morton Subject: Re: Input sysbsystema and hotplug References: <200506131607.51736.dtor_core@ameritech.net> <200506131705.30159.dtor_core@ameritech.net> <42AE8820.2010102@suse.de> <200506140242.08982.dtor_core@ameritech.net> In-Reply-To: <200506140242.08982.dtor_core@ameritech.net> X-Enigmail-Version: 0.90.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Dmitry Torokhov wrote: > On Tuesday 14 June 2005 02:32, Hannes Reinecke wrote: >>And yes, we should break compability and come up with a clean >>implementation. > > But those pesky users scream every time we break their mice ;) > >>And as the original input event is an abomination I >>don't see the point in keeping compability with a broken interface. >> > > Why is it abomination (aside from using old mechanism to call > hotplug)? It looks like it transmits all data necessary to load > appropriate input handler... > Because there are _two_ events with the name 'input'. Both run under the same name but carry different information. One is required to load the module and the other is required to create the device node. That's what I call an abomination. Cheers, Hannes -- Dr. Hannes Reinecke hare@suse.de SuSE Linux AG S390 & zSeries Maxfeldstraße 5 +49 911 74053 688 90409 Nürnberg http://www.suse.de From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261311AbVFNHwx (ORCPT ); Tue, 14 Jun 2005 03:52:53 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261312AbVFNHwx (ORCPT ); Tue, 14 Jun 2005 03:52:53 -0400 Received: from smtp800.mail.sc5.yahoo.com ([66.163.168.179]:50098 "HELO smtp800.mail.sc5.yahoo.com") by vger.kernel.org with SMTP id S261311AbVFNHws (ORCPT ); Tue, 14 Jun 2005 03:52:48 -0400 From: Dmitry Torokhov To: Hannes Reinecke Subject: Re: Input sysbsystema and hotplug Date: Tue, 14 Jun 2005 02:52:41 -0500 User-Agent: KMail/1.8.1 Cc: linux-hotplug-devel@lists.sourceforge.net, Greg KH , Vojtech Pavlik , Kay Sievers , LKML References: <200506131607.51736.dtor_core@ameritech.net> <42AE8A9E.5040406@suse.de> In-Reply-To: <42AE8A9E.5040406@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200506140252.42306.dtor_core@ameritech.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 14 June 2005 02:43, Hannes Reinecke wrote: > Dmitry Torokhov wrote: > > > Hmm. I don't like it very much as it mixes two different types of > devices (class devices and subclasses) into one directory. > If one could come up with a good name to group inputX under I think it will be OK. We'd have XXX, mouse, joystick, event, ... as subclasses and all class_devices will be on level below. OTOH input_devs are parents for mice, joysticks etc so they might be on the higher level. > I think it's cleaner to have two distinct class device types > (one for input_dev and one for input). > I actually detest this practice: [dtor@core ~]$ ls /sys/class/ firmware ieee1394 ieee1394_protocol mem pci_bus sound usb_host graphics ieee1394_host input misc pcmcia_socket tty vc i2c-adapter ieee1394_node input_dev net printer usb [dtor@core ~]$ dtor@anvil ~]$ ls /sys/class/ cpuid i2c-adapter ieee1394_host input msr printer sound usb_host firmware i2c-dev ieee1394_node mem net scsi_device tty vc graphics ieee1394 ieee1394_protocol misc pci_bus scsi_host usb video4linux [dtor@anvil ~]$ Firewire has 4 classes on the uppper level, I2C, USB, SCSI and Input got 2 each. It would be much nicer IMHO if we merge them into trees of classes with poarent class actually defining subsystem. > subclasses for the input class devices are a neat idea; but I fear the > hotplug event name will change for each subclass device ('input' will > become eg 'mouse'), so we again have to change all hotplug handlers. > And I don't see an easy solution for that ... > We could have parent class define agent/subsystem name for all its children. -- Dmitry From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261313AbVFNH40 (ORCPT ); Tue, 14 Jun 2005 03:56:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261318AbVFNH4Z (ORCPT ); Tue, 14 Jun 2005 03:56:25 -0400 Received: from smtp805.mail.sc5.yahoo.com ([66.163.168.184]:24202 "HELO smtp805.mail.sc5.yahoo.com") by vger.kernel.org with SMTP id S261313AbVFNH4Q (ORCPT ); Tue, 14 Jun 2005 03:56:16 -0400 From: Dmitry Torokhov To: Hannes Reinecke Subject: Re: Input sysbsystema and hotplug Date: Tue, 14 Jun 2005 02:56:09 -0500 User-Agent: KMail/1.8.1 Cc: linux-hotplug-devel@lists.sourceforge.net, Kay Sievers , Greg KH , Vojtech Pavlik , LKML , Andrew Morton References: <200506131607.51736.dtor_core@ameritech.net> <200506140242.08982.dtor_core@ameritech.net> <42AE8BA4.5020702@suse.de> In-Reply-To: <42AE8BA4.5020702@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200506140256.10313.dtor_core@ameritech.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 14 June 2005 02:47, Hannes Reinecke wrote: > Dmitry Torokhov wrote: > > On Tuesday 14 June 2005 02:32, Hannes Reinecke wrote: > >>And yes, we should break compability and come up with a clean > >>implementation. > > > > But those pesky users scream every time we break their mice ;) > > > >>And as the original input event is an abomination I > >>don't see the point in keeping compability with a broken interface. > >> > > > > Why is it abomination (aside from using old mechanism to call > > hotplug)? It looks like it transmits all data necessary to load > > appropriate input handler... > > > Because there are _two_ events with the name 'input'. > Both run under the same name but carry different information. > One is required to load the module and the other is required to create > the device node. > > That's what I call an abomination. > Ah, I see. Yep, it "input" wasn't reused when input_handlers were converted to class_simple we probably would not have this discussion now. -- Dmitry From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261315AbVFNIAd (ORCPT ); Tue, 14 Jun 2005 04:00:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261321AbVFNIAd (ORCPT ); Tue, 14 Jun 2005 04:00:33 -0400 Received: from ns2.suse.de ([195.135.220.15]:46810 "EHLO mx2.suse.de") by vger.kernel.org with ESMTP id S261315AbVFNIAQ (ORCPT ); Tue, 14 Jun 2005 04:00:16 -0400 Message-ID: <42AE8E8F.5070404@suse.de> Date: Tue, 14 Jun 2005 10:00:15 +0200 From: Hannes Reinecke Organization: SuSE Linux AG User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050317 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dmitry Torokhov Cc: linux-hotplug-devel@lists.sourceforge.net, Greg KH , Vojtech Pavlik , Kay Sievers , LKML Subject: Re: Input sysbsystema and hotplug References: <200506131607.51736.dtor_core@ameritech.net> <42AE8A9E.5040406@suse.de> <200506140252.42306.dtor_core@ameritech.net> In-Reply-To: <200506140252.42306.dtor_core@ameritech.net> X-Enigmail-Version: 0.90.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Dmitry Torokhov wrote: > On Tuesday 14 June 2005 02:43, Hannes Reinecke wrote: >>Dmitry Torokhov wrote: >>> >>Hmm. I don't like it very much as it mixes two different types of >>devices (class devices and subclasses) into one directory. >> > > If one could come up with a good name to group inputX under I think > it will be OK. We'd have XXX, mouse, joystick, event, ... as subclasses > and all class_devices will be on level below. OTOH input_devs are parents > for mice, joysticks etc so they might be on the higher level. > >>I think it's cleaner to have two distinct class device types >>(one for input_dev and one for input). >> > > I actually detest this practice: > > [dtor@core ~]$ ls /sys/class/ > firmware ieee1394 ieee1394_protocol mem pci_bus sound usb_host > graphics ieee1394_host input misc pcmcia_socket tty vc > i2c-adapter ieee1394_node input_dev net printer usb > [dtor@core ~]$ > > dtor@anvil ~]$ ls /sys/class/ > cpuid i2c-adapter ieee1394_host input msr printer sound usb_host > firmware i2c-dev ieee1394_node mem net scsi_device tty vc > graphics ieee1394 ieee1394_protocol misc pci_bus scsi_host usb video4linux > [dtor@anvil ~]$ > > Firewire has 4 classes on the uppper level, I2C, USB, SCSI and Input got > 2 each. It would be much nicer IMHO if we merge them into trees of classes > with poarent class actually defining subsystem. > Correct. And this in indeed a shortcoming of the driver model, as it basically only knows about classes and devices. Maybe it's about time to introduce a subsystem? >>subclasses for the input class devices are a neat idea; but I fear the >>hotplug event name will change for each subclass device ('input' will >>become eg 'mouse'), so we again have to change all hotplug handlers. >>And I don't see an easy solution for that ... >> > > We could have parent class define agent/subsystem name for all its children. > Hmm. We probably could. Cheers, Hannes -- Dr. Hannes Reinecke hare@suse.de SuSE Linux AG S390 & zSeries Maxfeldstraße 5 +49 911 74053 688 90409 Nürnberg http://www.suse.de From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261202AbVFNNlh (ORCPT ); Tue, 14 Jun 2005 09:41:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261203AbVFNNlg (ORCPT ); Tue, 14 Jun 2005 09:41:36 -0400 Received: from wproxy.gmail.com ([64.233.184.194]:47300 "EHLO wproxy.gmail.com") by vger.kernel.org with ESMTP id S261202AbVFNNlf convert rfc822-to-8bit (ORCPT ); Tue, 14 Jun 2005 09:41:35 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=N2udiavgJAeqTVb2G9sQ0/Fu4CXT9TgZZW29056j3og3sC0f0nBuZgfk6pK4dbz7WkkLTF5Mib8le7ifjdplXAhQ8C7QuFZbm2q+gcjiJ3dW/yAARQsg2c1dndJenHm/RUkdli04XvXxx4HdiAJY8XDhJTn3jcFzr+lVEvchiOg= Message-ID: <9e473391050614064111451333@mail.gmail.com> Date: Tue, 14 Jun 2005 09:41:34 -0400 From: Jon Smirl Reply-To: Jon Smirl To: Greg KH Subject: Re: Input sysbsystema and hotplug Cc: Dmitry Torokhov , linux-hotplug-devel@lists.sourceforge.net, Vojtech Pavlik , Kay Sievers , LKML In-Reply-To: <20050614063851.GA19620@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Content-Disposition: inline References: <200506131607.51736.dtor_core@ameritech.net> <20050613221657.GB15381@suse.de> <9e473391050613232170f57ea3@mail.gmail.com> <20050614063851.GA19620@suse.de> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On 6/14/05, Greg KH wrote: > > > Yes, lots of people want class devices to have children. Unfortunatly > > > they don't provide patches with their requests :) > > > > I did, but you didn't like it. > > Heh, yes, sorry, you did. > > Hm, I don't even remember why I didn't like it anymore, last I remember, > I think you got the parent reference counting correct, right? Care to > dig out the patch and send it again? Check out the thread "event sequencing" in the hotplug group. -- Jon Smirl jonsmirl@gmail.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261159AbVFNPNB (ORCPT ); Tue, 14 Jun 2005 11:13:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261171AbVFNPMD (ORCPT ); Tue, 14 Jun 2005 11:12:03 -0400 Received: from wproxy.gmail.com ([64.233.184.205]:22593 "EHLO wproxy.gmail.com") by vger.kernel.org with ESMTP id S261153AbVFNPCo convert rfc822-to-8bit (ORCPT ); Tue, 14 Jun 2005 11:02:44 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=AhAE752X1ZSnhgADx72QTpLyTEwgrAxUkVUwB3vwl9VDO4yJAFo816YlDMUW6F85dBS1CB9NZYJ2nB8SkafnQgjSFA0xEsyywH+OXCn8JAdLYvJHE0oIvtnua3dKztfd2nrUhd9NTBtVi39s/497prnlSphNs2dBDwwMAeRWJ9c= Message-ID: <9e473391050614080230ae359d@mail.gmail.com> Date: Tue, 14 Jun 2005 11:02:43 -0400 From: Jon Smirl Reply-To: Jon Smirl To: Greg KH Subject: Re: Input sysbsystema and hotplug Cc: Dmitry Torokhov , linux-hotplug-devel@lists.sourceforge.net, Vojtech Pavlik , Kay Sievers , LKML In-Reply-To: <20050614063851.GA19620@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Content-Disposition: inline References: <200506131607.51736.dtor_core@ameritech.net> <20050613221657.GB15381@suse.de> <9e473391050613232170f57ea3@mail.gmail.com> <20050614063851.GA19620@suse.de> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On 6/14/05, Greg KH wrote: > Heh, yes, sorry, you did. > > Hm, I don't even remember why I didn't like it anymore, last I remember, > I think you got the parent reference counting correct, right? Care to > dig out the patch and send it again? I brought this forward from a kernel a couple of months old so it may need some checking. diff --git a/drivers/base/class.c b/drivers/base/class.c --- a/drivers/base/class.c +++ b/drivers/base/class.c @@ -406,8 +406,9 @@ int class_device_add(struct class_device /* first, register with generic layer. */ kobject_set_name(&class_dev->kobj, "%s", class_dev->class_id); - if (parent) + if (parent && !class_dev->kobj.parent) class_dev->kobj.parent = &parent->subsys.kset.kobj; + class_dev->kobj.parent = kobject_get(class_dev->kobj.parent); if ((error = kobject_add(&class_dev->kobj))) goto register_done; @@ -438,6 +439,12 @@ int class_device_add(struct class_device return error; } +int class_device_add_child(struct class_device *class_dev, struct class_device *parent) +{ + class_dev->kobj.parent = &class_dev->kobj; + return class_device_add(class_dev); +} + int class_device_register(struct class_device *class_dev) { class_device_initialize(class_dev); @@ -463,6 +470,7 @@ void class_device_del(struct class_devic class_device_remove_attrs(class_dev); kobject_hotplug(&class_dev->kobj, KOBJ_REMOVE); + kobject_put(class_dev->kobj.parent); kobject_del(&class_dev->kobj); if (parent) @@ -581,6 +589,7 @@ EXPORT_SYMBOL_GPL(class_device_register) EXPORT_SYMBOL_GPL(class_device_unregister); EXPORT_SYMBOL_GPL(class_device_initialize); EXPORT_SYMBOL_GPL(class_device_add); +EXPORT_SYMBOL_GPL(class_device_add_child); EXPORT_SYMBOL_GPL(class_device_del); EXPORT_SYMBOL_GPL(class_device_get); EXPORT_SYMBOL_GPL(class_device_put); diff --git a/include/linux/device.h b/include/linux/device.h --- a/include/linux/device.h +++ b/include/linux/device.h @@ -208,6 +208,7 @@ extern int class_device_register(struct extern void class_device_unregister(struct class_device *); extern void class_device_initialize(struct class_device *); extern int class_device_add(struct class_device *); +extern int class_device_add_child(struct class_device *, struct class_device *); extern void class_device_del(struct class_device *); extern int class_device_rename(struct class_device *, char *); -- Jon Smirl jonsmirl@gmail.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261280AbVFNSQw (ORCPT ); Tue, 14 Jun 2005 14:16:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261281AbVFNSQw (ORCPT ); Tue, 14 Jun 2005 14:16:52 -0400 Received: from smtp804.mail.sc5.yahoo.com ([66.163.168.183]:4690 "HELO smtp804.mail.sc5.yahoo.com") by vger.kernel.org with SMTP id S261280AbVFNSQt (ORCPT ); Tue, 14 Jun 2005 14:16:49 -0400 From: Dmitry Torokhov To: Jon Smirl Subject: Re: Input sysbsystema and hotplug Date: Tue, 14 Jun 2005 13:16:40 -0500 User-Agent: KMail/1.8.1 Cc: Greg KH , linux-hotplug-devel@lists.sourceforge.net, Vojtech Pavlik , Kay Sievers , LKML References: <200506131607.51736.dtor_core@ameritech.net> <20050614063851.GA19620@suse.de> <9e473391050614080230ae359d@mail.gmail.com> In-Reply-To: <9e473391050614080230ae359d@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200506141316.42266.dtor_core@ameritech.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 14 June 2005 10:02, Jon Smirl wrote: > On 6/14/05, Greg KH wrote: > > Heh, yes, sorry, you did. > > > > Hm, I don't even remember why I didn't like it anymore, last I remember, > > I think you got the parent reference counting correct, right? Care to > > dig out the patch and send it again? > > I brought this forward from a kernel a couple of months old so it may > need some checking. > Ah, this one allows adding subdevices to class devices whereas mine is for adding subclasses to classes. Both are needed in the long run IMHO. -- Dmitry From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262233AbVFSOrU (ORCPT ); Sun, 19 Jun 2005 10:47:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262238AbVFSOrU (ORCPT ); Sun, 19 Jun 2005 10:47:20 -0400 Received: from ylpvm15-ext.prodigy.net ([207.115.57.46]:20613 "EHLO ylpvm15.prodigy.net") by vger.kernel.org with ESMTP id S262233AbVFSOrO (ORCPT ); Sun, 19 Jun 2005 10:47:14 -0400 X-ORBL: [69.107.32.110] From: David Brownell To: linux-hotplug-devel@lists.sourceforge.net Subject: Re: Input sysbsystema and hotplug Date: Sun, 19 Jun 2005 07:46:49 -0700 User-Agent: KMail/1.7.1 Cc: Hannes Reinecke , Dmitry Torokhov , Kay Sievers , Greg KH , Vojtech Pavlik , LKML , Andrew Morton References: <200506131607.51736.dtor_core@ameritech.net> <200506140242.08982.dtor_core@ameritech.net> <42AE8BA4.5020702@suse.de> In-Reply-To: <42AE8BA4.5020702@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200506190746.49865.david-b@pacbell.net> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 14 June 2005 12:47 am, Hannes Reinecke wrote: > > Because there are _two_ events with the name 'input'. > Both run under the same name but carry different information. > One is required to load the module and the other is required to create > the device node. > > That's what I call an abomination. Or at least messy, though it's been true forever that all the event classes have included multiple events. USB hotplug has aided both "interface" and "device" driver match policies since before 2.4.0, for example. I guess "input" has seemed simpler, partially because it started later and slimmer. Maybe starting with the next kernel or so, distros should be starting to avoid these issues by converting to slim versions of the /sbin/hotplug script, handling the two steps separately. First the driver loading ... for USB, PCI/Cardbus, and PCMCIA this usually suffices: if [ "$ACTION" = "add" -a -n "$MODALIAS" -a ! -L $DEVPATH/driver ] then modprobe -q $MODALIAS fi Then (otherwise?) the device node creation if [ -n "$DEVPATH" ] then /sbin/udevsend $1 fi And don't have any /etc/hotplug or /etc/hotplug.d scripts. (There'd still need to be an /etc/init.d/coldplug to make up for hotplug events that preceded viable userspace.) One problem with that is that not all subsystems yet support the new $MODALIAS (and /sys/devices/.../modalias) stuff, and of course "input" is one subsystem that doesn't. That support shifts the "what module to load" logic from hotplug scripts (slow and no-longer-appropriate) over to module-init-tools (3.2 and newer for the PCMCIA support). - Dave