tools: refresh all patches
[openwrt/staging/pepe2k.git] / target / linux / generic / pending-6.1 / 742-net-phy-air_en8811h-reset-netdev-rules-when-LED-is-s.patch
1 From 9be9a00adfac8118b6d685e71696f83187308c66 Mon Sep 17 00:00:00 2001
2 Message-ID: <9be9a00adfac8118b6d685e71696f83187308c66.1715125851.git.daniel@makrotopia.org>
3 From: Daniel Golle <daniel@makrotopia.org>
4 Date: Tue, 7 May 2024 22:43:30 +0100
5 Subject: [PATCH net] net: phy: air_en8811h: reset netdev rules when LED is set
6 manually
7 To: Andrew Lunn <andrew@lunn.ch>,
8 Heiner Kallweit <hkallweit1@gmail.com>,
9 Russell King <linux@armlinux.org.uk>,
10 David S. Miller <davem@davemloft.net>,
11 Eric Dumazet <edumazet@google.com>,
12 Jakub Kicinski <kuba@kernel.org>,
13 Paolo Abeni <pabeni@redhat.com>,
14 SkyLake Huang <skylake.huang@mediatek.com>,
15 Eric Woudstra <ericwouds@gmail.com>,
16 netdev@vger.kernel.org,
17 linux-kernel@vger.kernel.org
18
19 Setting LED_OFF via the brightness_set should deactivate hw control,
20 so make sure netdev trigger rules also get cleared in that case.
21
22 Fixes: 71e79430117d ("net: phy: air_en8811h: Add the Airoha EN8811H PHY driver")
23 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
24 ---
25 This is basically a stop-gap measure until unified LED handling has
26 been implemented accross all MediaTek and Airoha PHYs.
27 See also
28 https://patchwork.kernel.org/project/netdevbpf/patch/20240425023325.15586-3-SkyLake.Huang@mediatek.com/
29
30 drivers/net/phy/air_en8811h.c | 4 ++++
31 1 file changed, 4 insertions(+)
32
33 --- a/drivers/net/phy/air_en8811h.c
34 +++ b/drivers/net/phy/air_en8811h.c
35 @@ -544,6 +544,10 @@ static int air_hw_led_on_set(struct phy_
36
37 changed |= (priv->led[index].rules != 0);
38
39 + /* clear netdev trigger rules in case LED_OFF has been set */
40 + if (!on)
41 + priv->led[index].rules = 0;
42 +
43 if (changed)
44 return phy_modify_mmd(phydev, MDIO_MMD_VEND2,
45 AIR_PHY_LED_ON(index),