lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 14 Mar 2019 13:00:47 +0100
From:   Pavel Machek <pavel@....cz>
To:     Rasmus Villemoes <linux@...musvillemoes.dk>
Cc:     Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>,
        Jacek Anaszewski <jacek.anaszewski@...il.com>,
        LKML <linux-kernel@...r.kernel.org>, linux-leds@...r.kernel.org,
        devicetree@...r.kernel.org, linux-can@...r.kernel.org,
        netdev@...r.kernel.org
Subject: Re: [PATCH 4/4] leds: netdev trigger: allow setting initial values
 in device tree

On Thu 2019-03-14 12:26:38, Rasmus Villemoes wrote:
> On 14/03/2019 11.29, Pavel Machek wrote:
> > On Wed 2019-03-13 21:26:15, Rasmus Villemoes wrote:
> >> It can be quite convenient to initialize a netdev-triggered LED with a
> >> device name and setting the rx,tx,link properties from device tree,
> >> instead of having to do that in an init script in userspace.
> >>
> >> +                The optional child node netdev can be used to
> >> +                configure initial values for the link, rx, tx and
> >> +                device_name properties. For example, setting
> >> +                linux,default-trigger = "netdev" and adding the child
> >> +                node
> >> +
> >> +                netdev {
> >> +                    rx;
> >> +                    tx;
> >> +                    link;
> >> +                    device-name = "can0";
> >> +                };
> >> +
> >> +                can be used to replace 'linux,default-trigger =
> >> +                "can0-rxtx"' that relies on the deprecated
> >> +                CONFIG_CAN_LEDS.
> > 
> > I'm sorry, but no, not like this. I see it works for you, only having
> > single can device, but it would quickly break with two of them and two
> > ethernets are rather common.
> > 
> > So this will need to be device = <&phandle_of_ethernet_device> or
> > something like that. There may be example with usb port triggers.
> 
> Huh? I have two CAN devices, and there are two LEDs on the front panel
> labeled CAN-A and CAN-B; my device tree nodes for that are
...
> and this works just fine. The only change from the old DT is the
> addition of the netdev nodes and changing linux,default-trigger from
> "can0-rxtx", "can1-rxtx" to both "netdev".

Yeah and now insert the modules for the can devices in different
order... May not happen in your case but will be fairly common for
ethernets.

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ