Stefan Richter | 29 Sep 00:53

udev: bug in /lib/udev/path_id -- wrong assumptions about ieee1394 devices?

Hi,

the path_id script was apparently written with the assumption that the 
hierarchy of IEEE1394 device representation begins with fw-host devices 
and ends with children (node entry devices) or grandchildren (unit 
directory devices) of them.

If there are more levels of descendant devices than that, i.e. if there 
are children of unit directory devices, then path_id may get stuck with 
100% CPU utilization.

This is not a problem with current mainline drivers.  But there is a new 
driver to be added soon which adds input devices which would naturally 
be children of unit directory devices.  (It's the firedtv driver for 
FireDTV DVB devices which feature a remote control.  See 
http://ieee1394.wiki.kernel.org/index.php/Out-of-tree_Kernel_Drivers and 
http://user.in-berlin.de/~s5r6/linux1394/firedtv/.)

I will work around this path_id bug by making the input devices children 
of the fw-host devices.  The drawback is that some useful information 
from the unit directory device and node entry device (like model, 
vendor, and unique ID) will be unavailable that way.

Strangely, path_id does not hang due to the dvb child and dvb/* 
grandchildren of the node entry device.

(I tested with Gentoo's udev-124-r1.)

I hope that I won't need that workaround when I port firedtv from the 
ieee1394 stack to the firewire stack.  The firewire stack does not have
(Continue reading)

Stefan Richter | 29 Sep 01:13

Re: udev: bug in /lib/udev/path_id -- wrong assumptions about ieee1394 devices?

I wrote:
> the path_id script was apparently written with the assumption that the 
> hierarchy of IEEE1394 device representation begins with fw-host devices 
> and ends with children (node entry devices) or grandchildren (unit 
> directory devices) of them.
> 
> If there are more levels of descendant devices than that, i.e. if there 
> are children of unit directory devices, then path_id may get stuck with 
> 100% CPU utilization.
...
> I will work around this path_id bug by making the input devices children 
> of the fw-host devices.

PS:
I don't know if the hierarchy depth is really the cause of the bug.
I only know that the workaround prevents the bug.

Example of a desired but unsafe path, without workaround:
/sys/devices/pci0000:00/0000:00:1e.0/0000:03:03.0/fw-host0/0012870036002bd7/0012870036002bd7-0/input/input14

Example of a safe path, i.e. with workaround:
/sys/devices/pci0000:00/0000:00:1e.0/0000:03:03.0/fw-host0/input/input21

At the currently posted patchlevel (no "real" parent device provided to 
the input subsystem), the path looks like this, which is safe too:
/devices/virtual/input/input12

At the same time, the following devices aren't a problem for path_id:
/sys/devices/pci0000:00/0000:00:1e.0/0000:03:03.0/fw-host0/0012870036002bd7/0012870036002bd7-0/dvb/
/sys/devices/pci0000:00/0000:00:1e.0/0000:03:03.0/fw-host0/0012870036002bd7/0012870036002bd7-0/dvb/dvb0.demux0/
(Continue reading)

Kay Sievers | 1 Oct 19:38
Gravatar

Re: udev: bug in /lib/udev/path_id -- wrong assumptions about ieee1394 devices?

On Mon, Sep 29, 2008 at 12:54 AM, Stefan Richter
<stefanr <at> s5r6.in-berlin.de> wrote:
> the path_id script was apparently written with the assumption that the
> hierarchy of IEEE1394 device representation begins with fw-host devices and
> ends with children (node entry devices) or grandchildren (unit directory
> devices) of them.
>
> If there are more levels of descendant devices than that, i.e. if there are
> children of unit directory devices, then path_id may get stuck with 100% CPU
> utilization.
>
> This is not a problem with current mainline drivers.  But there is a new
> driver to be added soon which adds input devices which would naturally be
> children of unit directory devices.  (It's the firedtv driver for FireDTV
> DVB devices which feature a remote control.  See
> http://ieee1394.wiki.kernel.org/index.php/Out-of-tree_Kernel_Drivers and
> http://user.in-berlin.de/~s5r6/linux1394/firedtv/.)
>
> I will work around this path_id bug by making the input devices children of
> the fw-host devices.  The drawback is that some useful information from the
> unit directory device and node entry device (like model, vendor, and unique
> ID) will be unavailable that way.

Hmm, would be nice to avoid that, and have a proper sysfs hierarchy,
otherwise we will end up with silly workarounds like we do today for
that other huge storage subsystem with the strange sysfs layout of
disconnected and duplicated nodes. :).
I guess, we better don't make make such decisions because of a broken
path_id. That script is a complete nightmare anyway. We should fix it
instead of working around it in the kernel.
(Continue reading)


Gmane