Linux LED subsystem development
 help / color / mirror / Atom feed
From: Carlo Szelinsky <github@szelinsky.de>
To: sashiko-reviews@lists.linux.dev
Cc: Kory Maincent <kory.maincent@bootlin.com>,
	Oleksij Rempel <o.rempel@pengutronix.de>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>,
	Jonas Jelonek <jelonek.jonas@gmail.com>,
	Ross Cawston <ross@r-sc.ca>,
	netdev@vger.kernel.org, linux-leds@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v6 2/2] net: pse-pd: add LED trigger support via notification path
Date: Wed,  2 Dec 2026 18:36:52 +0100	[thread overview]
Message-ID: <20261202173652.207763-1-github@szelinsky.de> (raw)
In-Reply-To: <sashiko-outbox-239581@kernel.org>

On Sun, 29 Nov 2026 12:15, sashiko-bot@kernel.org wrote:
> In pse_controller_register(), pse_led_triggers_register() runs before
> pse_register_pw_ds() populates pcdev->pi[id].pw_d.  If an LED with a
> matching default_trigger activates during trigger registration,
> pse_pw_d_is_sw_pw_control() sees pw_d == NULL and queries
> ops->pi_get_admin_state() instead of admin_state_enabled.

This is fine. pcdev->pi is zeroed, so pw_d is NULL, and then the core
reads the admin state from the hardware. That is the right state at
this point, as no PHY can get the PI yet.

> Even after pse_register_pw_ds() runs, pcdev->pi[id].admin_state_enabled
> remains zero-initialized until a consumer calls of_pse_control_get() ->
> pse_control_get_internal(), which then initializes admin_state_enabled
> without holding pcdev->lock or calling pse_led_update():

This one is right. If a port is already on when its PHY gets the PI,
the "enabled" LED can stay off until the next event. I'll fix it in
v7: pse_control_get_internal() will set admin_state_enabled under
pcdev->lock and call pse_led_update(). That lock order already exists
through __pse_control_release().

Carlo

  reply	other threads:[~2026-12-02 17:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28 12:15 [PATCH net-next v6 0/2] net: pse-pd: add poll path and LED trigger support Carlo Szelinsky
2026-11-28 12:15 ` [PATCH net-next v6 1/2] net: pse-pd: add pse_poll_helper() Carlo Szelinsky
2026-11-30 15:25   ` Kory Maincent
2026-12-02 17:35     ` Carlo Szelinsky
2026-12-02 17:46       ` Kory Maincent
2026-11-28 12:15 ` [PATCH net-next v6 2/2] net: pse-pd: add LED trigger support via notification path Carlo Szelinsky
2026-11-29 12:15   ` sashiko-bot
2026-12-02 17:36     ` Carlo Szelinsky [this message]
2026-11-30 16:31   ` Kory Maincent
2026-12-02 17:36     ` Carlo Szelinsky
2026-12-02 17:54       ` Kory Maincent
2026-11-29 12:16 ` [PATCH net-next v6 0/2] net: pse-pd: add poll path and LED trigger support sashiko-bot

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=20261202173652.207763-1-github@szelinsky.de \
    --to=github@szelinsky.de \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=jelonek.jonas@gmail.com \
    --cc=kory.maincent@bootlin.com \
    --cc=kuba@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=pavel@kernel.org \
    --cc=ross@r-sc.ca \
    --cc=sashiko-reviews@lists.linux.dev \
    /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