linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marek Behún" <kabel@kernel.org>
To: Ansuel Smith <ansuelsmth@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>, Pavel Machek <pavel@ucw.cz>,
	John Crispin <john@phrozen.org>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-leds@vger.kernel.org
Subject: Re: [RFC PATCH 4/6] leds: trigger: add offload-phy-activity trigger
Date: Sun, 7 Nov 2021 23:10:09 +0100	[thread overview]
Message-ID: <20211107231009.7674734b@thinkpad> (raw)
In-Reply-To: <20211107175718.9151-5-ansuelsmth@gmail.com>

On Sun,  7 Nov 2021 18:57:16 +0100
Ansuel Smith <ansuelsmth@gmail.com> wrote:

> Add Offload Trigger for PHY Activity. This special trigger is used to
> configure and expose the different HW trigger that are provided by the
> PHY. Each offload trigger can be configured by sysfs and on trigger
> activation the offload mode is enabled.
> 
> This currently implement these hw triggers:
>   - blink_tx: Blink LED on tx packet receive
>   - blink_rx: Blink LED on rx packet receive
>   - blink_collision: Blink LED on collision detection
>   - link_10m: Keep LED on with 10m link speed
>   - link_100m: Keep LED on with 100m link speed
>   - link_1000m: Keep LED on with 1000m link speed
>   - half_duplex: Keep LED on with half duplex link
>   - full_duplex: Keep LED on with full duplex link
>   - linkup_over: Keep LED on with link speed and blink on rx/tx traffic
>   - power_on_reset: Keep LED on with switch reset
>   - blink_2hz: Set blink speed at 2hz for every blink event
>   - blink_4hz: Set blink speed at 4hz for every blink event
>   - blink_8hz: Set blink speed at 8hz for every blink event
>   - blink_auto: Set blink speed at 2hz for 10m link speed,
>       4hz for 100m and 8hz for 1000m
> 
> The trigger will read the supported offload trigger in the led cdev and
> will expose the offload triggers in sysfs and then activate the offload
> mode for the led in offload mode has it configured by default. A flag is
> passed to configure_offload with the related rule from this trigger to
> active or disable.
> It's in the led driver interest the detection and knowing how to
> elaborate the passed flags.
> 
> The different hw triggers are exposed in the led sysfs dir under the
> offload-phy-activity subdir.

NAK. The current plan is to use netdev trigger, and if it can
transparently offload the settings to HW, it will.

Yes, netdev trigger currently does not support all these settings.
But it supports indicating link and blinking on activity.

So the plan is to start with offloading the blinking on activity, i.e.
I the user does
  $ cd /sys/class/leds/<LED>
  $ echo netdev >trigger
  $ echo 1 >rx
  $ echo eth0 >device_name

this would, instead of doing blinking in software, do it in HW instead.

After this is implemented, we can start working on extending netdev
trigger to support more complicated features.

Marek

  reply	other threads:[~2021-11-07 22:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-07 17:57 [RFC PATCH 0/6] Adds support for PHY LEDs with offload triggers Ansuel Smith
2021-11-07 17:57 ` [RFC PATCH 1/6] leds: trigger: add API for HW offloading of triggers Ansuel Smith
2021-11-07 22:52   ` Randy Dunlap
2021-11-07 22:59     ` Ansuel Smith
2021-11-07 17:57 ` [RFC PATCH 2/6] leds: permit to declare supported offload triggers Ansuel Smith
2021-11-07 22:06   ` Marek Behún
2021-11-07 22:32     ` Ansuel Smith
2021-11-08 13:48       ` Andrew Lunn
2021-11-07 17:57 ` [RFC PATCH 3/6] leds: add function to configure offload leds Ansuel Smith
2021-11-07 22:45   ` Randy Dunlap
2021-11-07 17:57 ` [RFC PATCH 4/6] leds: trigger: add offload-phy-activity trigger Ansuel Smith
2021-11-07 22:10   ` Marek Behún [this message]
2021-11-07 22:43     ` Ansuel Smith
2021-11-08 10:00       ` Marek Behún
2021-11-07 22:42   ` Randy Dunlap
2021-11-07 22:46     ` Ansuel Smith
2021-11-07 17:57 ` [RFC PATCH 5/6] net: dsa: qca8k: add LEDs support Ansuel Smith
2021-11-07 22:39   ` Randy Dunlap
2021-11-07 17:57 ` [RFC PATCH 6/6] dt-bindings: net: dsa: qca8k: add LEDs definition example Ansuel Smith

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=20211107231009.7674734b@thinkpad \
    --to=kabel@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=john@phrozen.org \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@kernel.org \
    --cc=vivien.didelot@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).