Re: [PATCH] leds: trigger: netdev: Check offload ability on interface up
From: Marek Vasut <marex@denx.de>
Date: 2024-10-03 13:16:17
Also in:
linux-leds
On 10/3/24 2:05 PM, Andrew Lunn wrote:
quoted
quoted
Nice use of udev. I had not thought about using it for this.quoted
Is there some other way to configure the netdev-triggered PHY LEDs ? I still feel the udev rule is somewhat brittle and fragile, and also not available early enough for default PHY LED configuration, i.e. the LEDs are not blinking when I use e.g. ip=/nfsroot= when booting from NFS root until the userspace started, which is not nice. The only alternative I can imagine is default configuration in DT, which was already rejected a few years ago.Device tree is the only early way i can think of, especially for NFS root. What has clearly been rejected is each vendor having their own DT binding. But i think we might have more success with one generic binding for all MAC/PHY LEDs.
Right now I have this (for one of the PHY LEDs):
led@0 {
reg = <0>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WAN;
linux,default-trigger = "netdev";
};
What about be useful is to set the link_10/100/1000 and rx/tx flags here
somehow. It cannot be 'function' because that is already used to define
the port purpose.
Maybe something like 'led-pattern' property used by 'pattern' trigger
would work ? Some sort of "led-netdev-flags = LINK10 | LINK100;" ?
The way i was thinking about it, was to describe the label on the front panel. That is hardware you are describing, so fits DT. We are clearly in the grey area for DT, so i can understand some push back on this from the DT Maintainers.
It would be a policy, yes.