From 9be9a00adfac8118b6d685e71696f83187308c66 Mon Sep 17 00:00:00 2001 Message-ID: <9be9a00adfac8118b6d685e71696f83187308c66.1715125851.git.daniel@makrotopia.org> From: Daniel Golle Date: Tue, 7 May 2024 22:43:30 +0100 Subject: [PATCH net] net: phy: air_en8811h: reset netdev rules when LED is set manually To: Andrew Lunn , Heiner Kallweit , Russell King , David S. Miller , Eric Dumazet , Jakub Kicinski , Paolo Abeni , SkyLake Huang , Eric Woudstra , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Setting LED_OFF via the brightness_set should deactivate hw control, so make sure netdev trigger rules also get cleared in that case. Fixes: 71e79430117d ("net: phy: air_en8811h: Add the Airoha EN8811H PHY driver") Signed-off-by: Daniel Golle --- This is basically a stop-gap measure until unified LED handling has been implemented accross all MediaTek and Airoha PHYs. See also https://patchwork.kernel.org/project/netdevbpf/patch/20240425023325.15586-3-SkyLake.Huang@mediatek.com/ drivers/net/phy/air_en8811h.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/net/phy/air_en8811h.c +++ b/drivers/net/phy/air_en8811h.c @@ -544,6 +544,10 @@ static int air_hw_led_on_set(struct phy_ changed |= (priv->led[index].rules != 0); + /* clear netdev trigger rules in case LED_OFF has been set */ + if (!on) + priv->led[index].rules = 0; + if (changed) return phy_modify_mmd(phydev, MDIO_MMD_VEND2, AIR_PHY_LED_ON(index),