All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Marek Vasut <marex@denx.de>,
	linux-leds@vger.kernel.org,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Christian Marangi <ansuelsmth@gmail.com>,
	Christophe Roullier <christophe.roullier@foss.st.com>,
	Daniel Golle <daniel@makrotopia.org>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Lukasz Majewski <lukma@denx.de>, Pavel Machek <pavel@ucw.cz>,
	kernel@dh-electronics.com,
	linux-stm32@st-md-mailman.stormreply.com, netdev@vger.kernel.org
Subject: Re: [PATCH] leds: trigger: netdev: Check offload ability on interface up
Date: Mon, 16 Dec 2024 09:35:25 +0000	[thread overview]
Message-ID: <20241216093525.GG2418536@google.com> (raw)
In-Reply-To: <5c15ea24-8ca1-4b44-b6d6-fa6adac50334@lunn.ch>

On Sat, 14 Dec 2024, Andrew Lunn wrote:

> On Fri, Dec 13, 2024 at 11:15:09PM +0100, Marek Vasut wrote:
> > On 10/3/24 2:06 PM, Andrew Lunn wrote:
> > > On Tue, Oct 01, 2024 at 04:45:23AM +0200, Marek Vasut wrote:
> > > > The trigger_data->hw_control indicates whether the LED is controlled by HW
> > > > offload, i.e. the PHY. The trigger_data->hw_control = can_hw_control() is
> > > > currently called only from netdev_led_attr_store(), i.e. when writing any
> > > > sysfs attribute of the netdev trigger instance associated with a PHY LED.
> > > > 
> > > > The can_hw_control() calls validate_net_dev() which internally calls
> > > > led_cdev->hw_control_get_device(), which is phy_led_hw_control_get_device()
> > > > for PHY LEDs. The phy_led_hw_control_get_device() returns NULL if the PHY
> > > > is not attached.
> > > > 
> > > > At least in case of DWMAC (STM32MP, iMX8M, ...), the PHY device is attached
> > > > only when the interface is brought up and is detached again when the
> > > > interface is brought down. In case e.g. udev rules configure the netdev
> > > > LED trigger sysfs attributes before the interface is brought up, then when
> > > > the interface is brought up, the LEDs are not blinking.
> > > > 
> > > > This is because trigger_data->hw_control = can_hw_control() was called
> > > > when udev wrote the sysfs attribute files, before the interface was up,
> > > > so can_hw_control() resp. validate_net_dev() returned false, and the
> > > > trigger_data->hw_control = can_hw_control() was never called again to
> > > > update the trigger_data->hw_control content and let the offload take
> > > > over the LED blinking.
> > > > 
> > > > Call data->hw_control = can_hw_control() from netdev_trig_notify() to
> > > > update the offload capability of the LED when the UP notification arrives.
> > > > This makes the LEDs blink after the interface is brought up.
> > > > 
> > > > On STM32MP13xx with RTL8211F, it is enough to have the following udev rule
> > > > in place, boot the machine with cable plugged in, and the LEDs won't work
> > > > without this patch once the interface is brought up, even if they should:
> > > > "
> > > > ACTION=="add", SUBSYSTEM=="leds", KERNEL=="stmmac-0:01:green:wan", ATTR{trigger}="netdev", ATTR{link_10}="1", ATTR{link_100}="1", ATTR{link_1000}="1", ATTR{device_name}="end0"
> > > > ACTION=="add", SUBSYSTEM=="leds", KERNEL=="stmmac-0:01:yellow:wan", ATTR{trigger}="netdev", ATTR{rx}="1", ATTR{tx}="1", ATTR{device_name}="end0"
> > > > "
> > > > 
> > > > Signed-off-by: Marek Vasut <marex@denx.de>
> > > 
> > > Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> > Is there anything blocking this patch from being picked up ?
> 
> I think this should be going via the LED Maintainer. Please check with

It looked like the conversation was continuing.

If you have everything tied up, rather than relying on maintainers to
keep up with the branching conversations of 100's of patch-sets, it's
best to collect the tags you have and submit a [RESEND].

-- 
Lee Jones [李琼斯]

  reply	other threads:[~2024-12-16  9:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-01  2:45 [PATCH] leds: trigger: netdev: Check offload ability on interface up Marek Vasut
2024-10-02 23:21 ` Andrew Lunn
2024-10-03  0:47   ` Marek Vasut
2024-10-03 12:05     ` Andrew Lunn
2024-10-03 12:15       ` Marek Vasut
2025-11-17 11:18     ` Marek Vasut
2025-11-19 16:09       ` Marek Vasut
2024-10-03 12:06 ` Andrew Lunn
2024-12-13 22:15   ` Marek Vasut
2024-12-14 15:20     ` Andrew Lunn
2024-12-16  9:35       ` Lee Jones [this message]
2024-12-16  9:52         ` Andrew Lunn

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=20241216093525.GG2418536@google.com \
    --to=lee@kernel.org \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=christophe.roullier@foss.st.com \
    --cc=daniel@makrotopia.org \
    --cc=hkallweit1@gmail.com \
    --cc=kernel@dh-electronics.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=lukma@denx.de \
    --cc=marex@denx.de \
    --cc=netdev@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.