public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Greg KH <gregkh@suse.de>
Cc: linux-kernel@vger.kernel.org, Kay Sievers <kay.sievers@vrfy.org>,
	Vojtech Pavlik <vojtech@suse.cz>, Hannes Reinecke <hare@suse.de>,
	Patrick Mochel <mochel@digitalimplant.org>,
	airlied@linux.ie
Subject: Re: [PATCH] nesting class_device in sysfs to solve world peace
Date: Fri, 30 Sep 2005 00:32:49 -0500	[thread overview]
Message-ID: <200509300032.50408.dtor_core@ameritech.net> (raw)
In-Reply-To: <20050928233114.GA27227@suse.de>

On Wednesday 28 September 2005 18:31, Greg KH wrote:
> Alright, here's a patch that will add the ability to nest struct
> class_device structures in sysfs.  This should give everyone the ability
> to model what they need to in the class directory (input, video, etc.).
> 
> Dmitry, care to update your input patchset to take advantage of this?
> It should work out for what you want to do, and if not, please let me
> know.
> 
> udev will have to be changed to properly support this, but I think that
> Kay already has that taken care of, and is just waiting for some kernel
> code to take advantage of this.
> 
> Comments?
> 

Hi Greg,

I still do not believe it is the solution we want:

1. It does not allow installing separate hotplug handlers for devices
   and their sub-devices. This will cause hotplug handlers to resort to
   having some flags or otherwise detect the king of class device hotplug
   hanlder is being called for and change behavior accordingly - YUCK!

2. It does not allow user/program to scan for devices of given subclass.
   I understand that you want to tech udev about all existing handlers
   and having hotplug events allows to filter out unneeded names but for
   other programs I do not think we want to do that. Again, consider task
   of wanting to know all input interfaces, ot all available partiotions
   in a system. Do not say that the program has to know that there are hdX
   and sdX and ubX and adopt every time new type of device comes along
   since you would need to determine whether the name you see is an
   ordinary attribute or attribute group or the subdevice you are interested
   in. You can't really rely on presence of 'dev' attribute since subdevice
   does not have to have it. A better way would be to do
   "ls /sys/class/block/partitions/" or "ls /sys/class/input/interfaces"
   and get all this information.

3. It does not work well when you have an object that in your model is a
   logical subdevice but does not have a parent (or has multiple parents).
   Consider 'mice' multiplexor. Where would you put it? Together with
   inputX? But it is not an input_dev, it should not be there.

4. subdevice should have only one parent, your implementation allows to
   link subdevice to a class device and a real device at the same time,
   which IMHO is wrong. Only top-level class devices should be linked with
   physical /sys/devices/ device. 

I firmly believe that creating sub-classes (which solves hotplug issues)
and linking sub-class devices to their parent via 'device' link, much like
we link top-level class device to their physical parent devices (which
solves 2, 3 and 4) is much cleanier way. It provides everything that your
implementation does plus allows different views useful for other tasks
besides udev.

-- 
Dmitry

  reply	other threads:[~2005-09-30  5:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-28 23:31 [PATCH] nesting class_device in sysfs to solve world peace Greg KH
2005-09-30  5:32 ` Dmitry Torokhov [this message]
2005-10-06  0:09   ` Greg KH
2005-10-06  0:26     ` Greg KH
2005-10-06  0:29     ` Greg KH
2005-10-06  6:29     ` Dmitry Torokhov
2005-10-06 12:00       ` Michael Tokarev
2005-10-06 17:40         ` Dmitry Torokhov
2005-10-06 21:22       ` Greg KH
2005-10-06 21:59         ` Dmitry Torokhov
2005-10-11  4:00   ` Adam Belay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200509300032.50408.dtor_core@ameritech.net \
    --to=dtor_core@ameritech.net \
    --cc=airlied@linux.ie \
    --cc=gregkh@suse.de \
    --cc=hare@suse.de \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@digitalimplant.org \
    --cc=vojtech@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox