diff mbox series

[net-next,v2] net: phy: air_en8811h: reset netdev rules when LED is set manually

Message ID 5ed8ea615890a91fa4df59a7ae8311bbdf63cdcf.1715248281.git.daniel@makrotopia.org (mailing list archive)
State Accepted
Commit 87bfdbbb199249f677a92c6e13234b9c450992c6
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v2] net: phy: air_en8811h: reset netdev rules when LED is set manually | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 926 this patch: 926
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 937 this patch: 937
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 937 this patch: 937
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 10 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-05-13--18-00 (tests: 1019)

Commit Message

Daniel Golle May 9, 2024, 10 a.m. UTC
Setting LED_OFF via brightness_set should deactivate hw control, so make
sure netdev trigger rules also get cleared in that case.
This fixes unwanted restoration of the default netdev trigger rules and
matches the behaviour when using the 'netdev' trigger without any
hardware offloading.

Fixes: 71e79430117d ("net: phy: air_en8811h: Add the Airoha EN8811H PHY driver")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
v2: send to net-next instead of net tree because driver is present only
    in net-next tree. Improve commit description while at it.

 drivers/net/phy/air_en8811h.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

patchwork-bot+netdevbpf@kernel.org May 13, 2024, 9 p.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 9 May 2024 11:00:42 +0100 you wrote:
> Setting LED_OFF via brightness_set should deactivate hw control, so make
> sure netdev trigger rules also get cleared in that case.
> This fixes unwanted restoration of the default netdev trigger rules and
> matches the behaviour when using the 'netdev' trigger without any
> hardware offloading.
> 
> Fixes: 71e79430117d ("net: phy: air_en8811h: Add the Airoha EN8811H PHY driver")
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> 
> [...]

Here is the summary with links:
  - [net-next,v2] net: phy: air_en8811h: reset netdev rules when LED is set manually
    https://git.kernel.org/netdev/net-next/c/87bfdbbb1992

You are awesome, thank you!
diff mbox series

Patch

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),