Re: [PATCH net v3 2/2] net: phy: qca808x: keep an explicit active-high LED across the reset
From: Christian Marangi
Date: Wed Sep 16 2026 - 19:58:19 EST
On Wed, Sep 16, 2026 at 07:31:38AM +0900, Donggeun Yoo wrote:
> With the previous patch an 'active-high' LED node is accepted, so
> led_polarity_mode can now hold 0. qca808x_config_init() only re-asserts
> QCA808X_LED_ACTIVE_HIGH when the mode is -1, the value that means device
> tree asked for nothing, so an explicit active-high does not reach the
> register.
>
> That matters because the bit does not survive a reset. phy_init_hw() runs
> .soft_reset before .config_init on every attach and resume, and
> commit f203c8c77c76 ("net: phy: qcom: qca808x: default to LED active High if not set")
> records why: "on PHY reset, the Active High bit is not set resulting in
> the LED driven as active-low". The polarity written from device tree
> during phy_probe() is therefore gone by the time the link comes up, and
> the LED runs inverted.
>
> Re-assert the bit for anything other than an explicit active-low, which
> is the one case that wants it clear and gets that from the reset for
> free. Name the unset value while here: led_polarity_mode otherwise
> holds a PHY_LED_ACTIVE_* value, so spelling the comparison
> PHY_LED_ACTIVE_LOW says what it means where -1, 0 and 1 did not.
>
> Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
> Closes: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260908105959.70453-1-donggeunyoo.kernel%40gmail.com
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: a274465cc3be ("net: phy: support 'active-high' property for PHY LEDs")
> Signed-off-by: Donggeun Yoo <donggeunyoo.kernel@xxxxxxxxx>
> Assisted-by: Claude:claude-fable-5
Reviewed-by: Christian Marangi <ansuelsmth@xxxxxxxxx>
--
Ansuel