openwrt/target/linux/generic/pending-6.1/742-net-phy-air_en8811h-reset-netdev-rules-when-LED-is-s.patch

46 lines
1.7 KiB
Diff
Raw Normal View History

From 9be9a00adfac8118b6d685e71696f83187308c66 Mon Sep 17 00:00:00 2001
Message-ID: <9be9a00adfac8118b6d685e71696f83187308c66.1715125851.git.daniel@makrotopia.org>
From: Daniel Golle <daniel@makrotopia.org>
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 <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
David S. Miller <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
SkyLake Huang <skylake.huang@mediatek.com>,
Eric Woudstra <ericwouds@gmail.com>,
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 <daniel@makrotopia.org>
---
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),