* [PATCH net] net: phy: air_en8811h: reset netdev rules when LED is set manually
@ 2024-05-08 0:51 Daniel Golle
2024-05-09 9:18 ` Paolo Abeni
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Golle @ 2024-05-08 0:51 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, SkyLake Huang,
Eric Woudstra, netdev, linux-kernel
Cc: John Crispin
Setting LED_OFF via the brightness_set should deactivate hw control,
so make sure netdev trigger rules also get cleared in that case.
This matches the behaviour when using the 'netdev' trigger without
any hardware offloading and fixes unwanted memory of the default
netdev trigger rules when another trigger (or no trigger) had been
selected meanwhile.
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(+)
diff --git a/drivers/net/phy/air_en8811h.c b/drivers/net/phy/air_en8811h.c
index 4c9a1c9c805e..3cdc8c6b30b6 100644
--- 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_device *phydev, u8 index, bool on)
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),
--
2.45.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: phy: air_en8811h: reset netdev rules when LED is set manually
2024-05-08 0:51 [PATCH net] net: phy: air_en8811h: reset netdev rules when LED is set manually Daniel Golle
@ 2024-05-09 9:18 ` Paolo Abeni
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Abeni @ 2024-05-09 9:18 UTC (permalink / raw)
To: Daniel Golle, Andrew Lunn, Heiner Kallweit, Russell King,
David S. Miller, Eric Dumazet, Jakub Kicinski, SkyLake Huang,
Eric Woudstra, netdev, linux-kernel
Cc: John Crispin
Hi,
On Wed, 2024-05-08 at 01:51 +0100, Daniel Golle wrote:
> Setting LED_OFF via the brightness_set should deactivate hw control,
> so make sure netdev trigger rules also get cleared in that case.
> This matches the behaviour when using the 'netdev' trigger without
> any hardware offloading and fixes unwanted memory of the default
> netdev trigger rules when another trigger (or no trigger) had been
> selected meanwhile.
>
> Fixes: 71e79430117d ("net: phy: air_en8811h: Add the Airoha EN8811H PHY driver")
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The patch is marked for 'net' but it's actually targeting net-next,
since the air_en8811h is only there. Does not apply to 'net' so our CI
did not trigger. Could you please repost with a the correct target
tree?
Thanks,
Paolo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-09 9:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-08 0:51 [PATCH net] net: phy: air_en8811h: reset netdev rules when LED is set manually Daniel Golle
2024-05-09 9:18 ` Paolo Abeni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®