LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* No more "device" symlinks for classes
@ 2007-01-13 23:51 Pierre Ossman
  2007-01-14  0:02 ` Kay Sievers
  2007-01-14  6:10 ` Andrey Borzenkov
  0 siblings, 2 replies; 7+ messages in thread
From: Pierre Ossman @ 2007-01-13 23:51 UTC (permalink / raw)
  To: Greg KH, Kay Sievers, LKML

Hi guys,

I just wanted to know the rationale behind
99ef3ef8d5f2f5b5312627127ad63df27c0d0d05 (no more "device" symlink in
class devices). I thought that was a rather convenient way of finding
which physical device the class device was coupled to.

Rgds
-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  PulseAudio, core developer          http://pulseaudio.org
  rdesktop, core developer          http://www.rdesktop.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: No more "device" symlinks for classes
  2007-01-13 23:51 No more "device" symlinks for classes Pierre Ossman
@ 2007-01-14  0:02 ` Kay Sievers
  2007-01-14  0:29   ` Pierre Ossman
  2007-01-14  6:10 ` Andrey Borzenkov
  1 sibling, 1 reply; 7+ messages in thread
From: Kay Sievers @ 2007-01-14  0:02 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: Greg KH, LKML

On Sun, 2007-01-14 at 00:51 +0100, Pierre Ossman wrote:
> I just wanted to know the rationale behind
> 99ef3ef8d5f2f5b5312627127ad63df27c0d0d05 (no more "device" symlink in
> class devices). I thought that was a rather convenient way of finding
> which physical device the class device was coupled to.

The plan is to have a single unified tree at /sys/devices, where all
device-directories live below their parents, and /sys/class contains
only symlinks pointing into this single tree, just like /sys/bus.

People want to stack class-devices, but this leads to a /sys/devices
tree and several small trees spread around in /sys/class. These trees
need to be connected by "device"-links and the "class:"-links, which
just doesn't make much sense if you can have one single tree with the
same information.

In the unified tree, the "device"-link will always just point to the
parent device, that's why there is a config option to disable these
links and test current software not to depend on it.

There was a long discussion on lkml about all that, maybe a year ago,
while converting "input".

Thanks,
Kay


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: No more "device" symlinks for classes
  2007-01-14  0:02 ` Kay Sievers
@ 2007-01-14  0:29   ` Pierre Ossman
  2007-01-14  0:35     ` Kay Sievers
  0 siblings, 1 reply; 7+ messages in thread
From: Pierre Ossman @ 2007-01-14  0:29 UTC (permalink / raw)
  To: Kay Sievers; +Cc: Greg KH, LKML

Kay Sievers wrote:
>
> The plan is to have a single unified tree at /sys/devices, where all
> device-directories live below their parents, and /sys/class contains
> only symlinks pointing into this single tree, just like /sys/bus.
>
> People want to stack class-devices, but this leads to a /sys/devices
> tree and several small trees spread around in /sys/class. These trees
> need to be connected by "device"-links and the "class:"-links, which
> just doesn't make much sense if you can have one single tree with the
> same information.
>
> In the unified tree, the "device"-link will always just point to the
> parent device, that's why there is a config option to disable these
> links and test current software not to depend on it.
>
>   

I'm not sure I completely follow. Should an application look at the
symlink (e.g. /sys/class/fooclass/foodev -> /sys/devices/...) and follow
that one level up? If so, then this sounds a bit complicated. Especially
from shell scripts.

Rgds

-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  PulseAudio, core developer          http://pulseaudio.org
  rdesktop, core developer          http://www.rdesktop.org


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: No more "device" symlinks for classes
  2007-01-14  0:29   ` Pierre Ossman
@ 2007-01-14  0:35     ` Kay Sievers
  0 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2007-01-14  0:35 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: Greg KH, LKML

On Sun, 2007-01-14 at 01:29 +0100, Pierre Ossman wrote:
> Kay Sievers wrote:
> >
> > The plan is to have a single unified tree at /sys/devices, where all
> > device-directories live below their parents, and /sys/class contains
> > only symlinks pointing into this single tree, just like /sys/bus.
> >
> > People want to stack class-devices, but this leads to a /sys/devices
> > tree and several small trees spread around in /sys/class. These trees
> > need to be connected by "device"-links and the "class:"-links, which
> > just doesn't make much sense if you can have one single tree with the
> > same information.
> >
> > In the unified tree, the "device"-link will always just point to the
> > parent device, that's why there is a config option to disable these
> > links and test current software not to depend on it.
> >
> I'm not sure I completely follow. Should an application look at the
> symlink (e.g. /sys/class/fooclass/foodev -> /sys/devices/...) and follow
> that one level up? If so, then this sounds a bit complicated. Especially
> from shell scripts.

We would have one single tree at /sys/devices, and always flat
classification without hierarchy at /sys/class and /sys/bus. If you
enter the device-tree by starting at /sys/class, you get the full path
to the device by reading the link, and get all the device's
dependencies(parents) in the devpath of the device,

I can't see any problem stripping the last element of a path with a
shell script. It's all implemented in current udev and HAL for quite
some time and it's pretty easy.

Kay


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: No more "device" symlinks for classes
  2007-01-13 23:51 No more "device" symlinks for classes Pierre Ossman
  2007-01-14  0:02 ` Kay Sievers
@ 2007-01-14  6:10 ` Andrey Borzenkov
  2007-01-14  7:39   ` Greg KH
  1 sibling, 1 reply; 7+ messages in thread
From: Andrey Borzenkov @ 2007-01-14  6:10 UTC (permalink / raw)
  To: Pierre Ossman, linux-kernel

Pierre Ossman wrote:

> Hi guys,
> 
> I just wanted to know the rationale behind
> 99ef3ef8d5f2f5b5312627127ad63df27c0d0d05 (no more "device" symlink in
> class devices). I thought that was a rather convenient way of finding
> which physical device the class device was coupled to.
> 

Actually I wonder why those links still present even when I told system not
to create them?

{pts/1}% grep DEPRE /boot/config
# CONFIG_SYSFS_DEPRECATED is not set
# CONFIG_PM_SYSFS_DEPRECATED is not set
{pts/1}% find /sys/class -name device
/sys/class/pcmcia_socket/pcmcia_socket2/device
/sys/class/pcmcia_socket/pcmcia_socket1/device
/sys/class/pcmcia_socket/pcmcia_socket0/device
/sys/class/usb_device/usbdev1.1/device
/sys/class/usb_host/usb_host1/device
/sys/class/scsi_disk/0:0:0:0/device
/sys/class/scsi_device/1:0:0:0/device
/sys/class/scsi_device/0:0:0:0/device
/sys/class/scsi_host/host1/device
/sys/class/scsi_host/host0/device
/sys/class/net/eth0/device
/sys/class/net/eth1/device
/sys/class/input/input1/ts0/device
/sys/class/input/input1/mouse0/device
/sys/class/input/input1/event1/device
/sys/class/input/input1/device
/sys/class/input/input0/event0/device
/sys/class/input/input0/device
{pts/1}% uname -a
Linux cooker 2.6.20-rc5-1avb #10 Sat Jan 13 14:05:34 MSK 2007 i686 Pentium
III (Coppermine) GNU/Linux

-andrey


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: No more "device" symlinks for classes
  2007-01-14  6:10 ` Andrey Borzenkov
@ 2007-01-14  7:39   ` Greg KH
  2007-01-14  8:46     ` Kay Sievers
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2007-01-14  7:39 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: Pierre Ossman, linux-kernel

On Sun, Jan 14, 2007 at 09:10:59AM +0300, Andrey Borzenkov wrote:
> Pierre Ossman wrote:
> 
> > Hi guys,
> > 
> > I just wanted to know the rationale behind
> > 99ef3ef8d5f2f5b5312627127ad63df27c0d0d05 (no more "device" symlink in
> > class devices). I thought that was a rather convenient way of finding
> > which physical device the class device was coupled to.
> > 
> 
> Actually I wonder why those links still present even when I told system not
> to create them?
> 
> {pts/1}% grep DEPRE /boot/config
> # CONFIG_SYSFS_DEPRECATED is not set
> # CONFIG_PM_SYSFS_DEPRECATED is not set
> {pts/1}% find /sys/class -name device
> /sys/class/pcmcia_socket/pcmcia_socket2/device
> /sys/class/pcmcia_socket/pcmcia_socket1/device
> /sys/class/pcmcia_socket/pcmcia_socket0/device
> /sys/class/usb_device/usbdev1.1/device
> /sys/class/usb_host/usb_host1/device
> /sys/class/scsi_disk/0:0:0:0/device
> /sys/class/scsi_device/1:0:0:0/device
> /sys/class/scsi_device/0:0:0:0/device
> /sys/class/scsi_host/host1/device
> /sys/class/scsi_host/host0/device
> /sys/class/net/eth0/device
> /sys/class/net/eth1/device
> /sys/class/input/input1/ts0/device
> /sys/class/input/input1/mouse0/device
> /sys/class/input/input1/event1/device
> /sys/class/input/input1/device
> /sys/class/input/input0/event0/device
> /sys/class/input/input0/device
> {pts/1}% uname -a
> Linux cooker 2.6.20-rc5-1avb #10 Sat Jan 13 14:05:34 MSK 2007 i686 Pentium
> III (Coppermine) GNU/Linux

Because I haven't finished converting all of the different usages of
struct class_device to struct device just yet.  When that happens, those
links go away, as the /sys/class/foo_class/foo is a symlink itself into
the /sys/devices/ tree.

If you look in the -mm tree there is a patch for the network devices,
and I have patches in my tree (but not -mm) for pcmcia, usb_host,
usb_device, and input.  These patches still need a bit of work before
sending them on to their relative maintainers for acceptance.

Hope this helps explain things,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: No more "device" symlinks for classes
  2007-01-14  7:39   ` Greg KH
@ 2007-01-14  8:46     ` Kay Sievers
  0 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2007-01-14  8:46 UTC (permalink / raw)
  To: Greg KH; +Cc: Andrey Borzenkov, Pierre Ossman, linux-kernel

On 1/14/07, Greg KH <greg@kroah.com> wrote:
> On Sun, Jan 14, 2007 at 09:10:59AM +0300, Andrey Borzenkov wrote:
> > Pierre Ossman wrote:
> >
> > > Hi guys,
> > >
> > > I just wanted to know the rationale behind
> > > 99ef3ef8d5f2f5b5312627127ad63df27c0d0d05 (no more "device" symlink in
> > > class devices). I thought that was a rather convenient way of finding
> > > which physical device the class device was coupled to.
> > >
> >
> > Actually I wonder why those links still present even when I told system not
> > to create them?
> >
> > {pts/1}% grep DEPRE /boot/config
> > # CONFIG_SYSFS_DEPRECATED is not set
> > # CONFIG_PM_SYSFS_DEPRECATED is not set
> > {pts/1}% find /sys/class -name device
> > /sys/class/pcmcia_socket/pcmcia_socket2/device
> > /sys/class/pcmcia_socket/pcmcia_socket1/device
> > /sys/class/pcmcia_socket/pcmcia_socket0/device
> > /sys/class/usb_device/usbdev1.1/device
> > /sys/class/usb_host/usb_host1/device
> > /sys/class/scsi_disk/0:0:0:0/device
> > /sys/class/scsi_device/1:0:0:0/device
> > /sys/class/scsi_device/0:0:0:0/device
> > /sys/class/scsi_host/host1/device
> > /sys/class/scsi_host/host0/device
> > /sys/class/net/eth0/device
> > /sys/class/net/eth1/device
> > /sys/class/input/input1/ts0/device
> > /sys/class/input/input1/mouse0/device
> > /sys/class/input/input1/event1/device
> > /sys/class/input/input1/device
> > /sys/class/input/input0/event0/device
> > /sys/class/input/input0/device
> > {pts/1}% uname -a
> > Linux cooker 2.6.20-rc5-1avb #10 Sat Jan 13 14:05:34 MSK 2007 i686 Pentium
> > III (Coppermine) GNU/Linux
>
> Because I haven't finished converting all of the different usages of
> struct class_device to struct device just yet.  When that happens, those
> links go away, as the /sys/class/foo_class/foo is a symlink itself into
> the /sys/devices/ tree.

Right, you only told not to create the links for already converted
subsystems to create the class-devices in /sys/devices. You can never
supress the links for subsystems which still create device-directories
in /sys/class, because you would lose the parent information then and
udev and HAL couldn't work anymore.

Kay
Kay

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-01-14  8:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-13 23:51 No more "device" symlinks for classes Pierre Ossman
2007-01-14  0:02 ` Kay Sievers
2007-01-14  0:29   ` Pierre Ossman
2007-01-14  0:35     ` Kay Sievers
2007-01-14  6:10 ` Andrey Borzenkov
2007-01-14  7:39   ` Greg KH
2007-01-14  8:46     ` Kay Sievers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).