* [PATCH 0/2] net: phy: air_en8811h: fix LED GPIO not surviving MCU restart
@ 2026-08-23 13:06 Vitaliy Sochnev
2026-08-23 13:06 ` [PATCH 1/2] net: phy: air_en8811h: move LED GPIO configuration to config_init Vitaliy Sochnev
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Vitaliy Sochnev @ 2026-08-23 13:06 UTC (permalink / raw)
To: netdev; +Cc: Vitaliy Sochnev
The EN8811H PHY's LED GPIO pins are only ever configured as outputs
once, in .probe(). Every .config_init() call after the first restarts
the PHY's MD32 MCU, which resets that GPIO configuration back to
inputs, so the LEDs silently stop reflecting link/activity state after
the first link renegotiation, ifdown/ifup, or resume. Patch 1 fixes
that. Patch 2 is a small follow-on cleanup enabled by patch 1's
removal of code from .probe(), kept as a separate patch so patch 1
stays a minimal, clean Fixes: change.
Verified on hardware (Nokia XG-040G-MD, Airoha AN7581) via OpenWrt:
before the fix, the LED stayed dark after the board's first link
renegotiation post-boot; after the fix, it lit correctly through
repeated link up/down cycles.
Vitaliy Sochnev (2):
net: phy: air_en8811h: move LED GPIO configuration to config_init
net: phy: air_en8811h: simplify en8811h_probe() trailing return
drivers/net/phy/air_en8811h.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
--
2.55.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] net: phy: air_en8811h: move LED GPIO configuration to config_init
2026-08-23 13:06 [PATCH 0/2] net: phy: air_en8811h: fix LED GPIO not surviving MCU restart Vitaliy Sochnev
@ 2026-08-23 13:06 ` Vitaliy Sochnev
2026-08-23 13:06 ` [PATCH 2/2] net: phy: air_en8811h: simplify en8811h_probe() trailing return Vitaliy Sochnev
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Vitaliy Sochnev @ 2026-08-23 13:06 UTC (permalink / raw)
To: netdev
Cc: Vitaliy Sochnev, Mikhail Zhilkin, Andrew Lunn, Heiner Kallweit,
Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Eric Woudstra, open list
The LED GPIO pins (GPIO3/4/5, mapped to LED2/LED1/LED0) are only ever
configured as outputs once, in .probe(). But .config_init() restarts
the MD32 MCU via en8811h_restart_mcu() on every call after the first
(priv->mcu_needs_restart), and that restart resets buckpbus-mapped MCU
state, including EN8811H_GPIO_OUTPUT. As a result the LED GPIOs fall
back to inputs after the first event that re-triggers .config_init()
(link renegotiation, ifdown/ifup, resume), and the PHY's LEDs stop
reflecting link/activity state even though they worked right after
probe.
Move the GPIO-as-output configuration from .probe() to the end of
.config_init(), so it is reapplied every time the MCU may have been
restarted.
Fixes: 71e79430117d ("net: phy: air_en8811h: Add the Airoha EN8811H PHY driver")
Suggested-by: Mikhail Zhilkin <csharper2005@gmail.com>
Signed-off-by: Vitaliy Sochnev <sochnev.v.74@gmail.com>
---
drivers/net/phy/air_en8811h.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/net/phy/air_en8811h.c b/drivers/net/phy/air_en8811h.c
index edd49c193e47..0eeb7b9a4e26 100644
--- a/drivers/net/phy/air_en8811h.c
+++ b/drivers/net/phy/air_en8811h.c
@@ -1173,13 +1173,6 @@ static int en8811h_probe(struct phy_device *phydev)
if (ret)
return ret;
- /* Configure led gpio pins as output */
- ret = air_phy_buckpbus_reg_modify(phydev, EN8811H_GPIO_OUTPUT,
- EN8811H_GPIO_OUTPUT_345,
- EN8811H_GPIO_OUTPUT_345);
- if (ret < 0)
- return ret;
-
return 0;
}
@@ -1324,6 +1317,17 @@ static int en8811h_config_init(struct phy_device *phydev)
return ret;
}
+ /* Configure led gpio pins as output. Must be redone on every
+ * .config_init(), not just once in .probe(): en8811h_restart_mcu()
+ * resets buckpbus-mapped MCU state (incl. this register) on every
+ * call after the first, e.g. on link renegotiation or ifup/ifdown.
+ */
+ ret = air_phy_buckpbus_reg_modify(phydev, EN8811H_GPIO_OUTPUT,
+ EN8811H_GPIO_OUTPUT_345,
+ EN8811H_GPIO_OUTPUT_345);
+ if (ret < 0)
+ return ret;
+
return 0;
}
--
2.55.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] net: phy: air_en8811h: simplify en8811h_probe() trailing return
2026-08-23 13:06 [PATCH 0/2] net: phy: air_en8811h: fix LED GPIO not surviving MCU restart Vitaliy Sochnev
2026-08-23 13:06 ` [PATCH 1/2] net: phy: air_en8811h: move LED GPIO configuration to config_init Vitaliy Sochnev
@ 2026-08-23 13:06 ` Vitaliy Sochnev
2026-08-27 9:45 ` [PATCH 0/2] net: phy: air_en8811h: fix LED GPIO not surviving MCU restart Paolo Abeni
2026-08-27 9:50 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Vitaliy Sochnev @ 2026-08-23 13:06 UTC (permalink / raw)
To: netdev
Cc: Vitaliy Sochnev, Andrew Lunn, Heiner Kallweit, Russell King,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
open list
en8811h_clk_provider_setup() is now the last statement in the
function, so the intermediate "if (ret) return ret; return 0;" is
redundant.
Signed-off-by: Vitaliy Sochnev <sochnev.v.74@gmail.com>
---
drivers/net/phy/air_en8811h.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/net/phy/air_en8811h.c b/drivers/net/phy/air_en8811h.c
index 0eeb7b9a4e26..8f4498cf0a7c 100644
--- a/drivers/net/phy/air_en8811h.c
+++ b/drivers/net/phy/air_en8811h.c
@@ -1169,11 +1169,7 @@ static int en8811h_probe(struct phy_device *phydev)
priv->phydev = phydev;
/* Co-Clock Output */
- ret = en8811h_clk_provider_setup(&phydev->mdio.dev, &priv->hw);
- if (ret)
- return ret;
-
- return 0;
+ return en8811h_clk_provider_setup(&phydev->mdio.dev, &priv->hw);
}
static int an8811hb_config_serdes_polarity(struct phy_device *phydev)
--
2.55.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] net: phy: air_en8811h: fix LED GPIO not surviving MCU restart
2026-08-23 13:06 [PATCH 0/2] net: phy: air_en8811h: fix LED GPIO not surviving MCU restart Vitaliy Sochnev
2026-08-23 13:06 ` [PATCH 1/2] net: phy: air_en8811h: move LED GPIO configuration to config_init Vitaliy Sochnev
2026-08-23 13:06 ` [PATCH 2/2] net: phy: air_en8811h: simplify en8811h_probe() trailing return Vitaliy Sochnev
@ 2026-08-27 9:45 ` Paolo Abeni
2026-08-27 9:50 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Paolo Abeni @ 2026-08-27 9:45 UTC (permalink / raw)
To: Vitaliy Sochnev, netdev
On 8/23/26 3:06 PM, Vitaliy Sochnev wrote:
> The EN8811H PHY's LED GPIO pins are only ever configured as outputs
> once, in .probe(). Every .config_init() call after the first restarts
> the PHY's MD32 MCU, which resets that GPIO configuration back to
> inputs, so the LEDs silently stop reflecting link/activity state after
> the first link renegotiation, ifdown/ifup, or resume. Patch 1 fixes
> that. Patch 2 is a small follow-on cleanup enabled by patch 1's
> removal of code from .probe(), kept as a separate patch so patch 1
> stays a minimal, clean Fixes: change.
Patch 2/2 is net-next material, please re-submit after the merge window.
/P
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] net: phy: air_en8811h: fix LED GPIO not surviving MCU restart
2026-08-23 13:06 [PATCH 0/2] net: phy: air_en8811h: fix LED GPIO not surviving MCU restart Vitaliy Sochnev
` (2 preceding siblings ...)
2026-08-27 9:45 ` [PATCH 0/2] net: phy: air_en8811h: fix LED GPIO not surviving MCU restart Paolo Abeni
@ 2026-08-27 9:50 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-08-27 9:50 UTC (permalink / raw)
To: Vitaliy Sochnev; +Cc: netdev
Hello:
This series was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Sun, 23 Aug 2026 14:06:35 +0100 you wrote:
> The EN8811H PHY's LED GPIO pins are only ever configured as outputs
> once, in .probe(). Every .config_init() call after the first restarts
> the PHY's MD32 MCU, which resets that GPIO configuration back to
> inputs, so the LEDs silently stop reflecting link/activity state after
> the first link renegotiation, ifdown/ifup, or resume. Patch 1 fixes
> that. Patch 2 is a small follow-on cleanup enabled by patch 1's
> removal of code from .probe(), kept as a separate patch so patch 1
> stays a minimal, clean Fixes: change.
>
> [...]
Here is the summary with links:
- [1/2] net: phy: air_en8811h: move LED GPIO configuration to config_init
https://git.kernel.org/netdev/net/c/03b4702fc5e3
- [2/2] net: phy: air_en8811h: simplify en8811h_probe() trailing return
(no matching commit)
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-08-27 9:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-23 13:06 [PATCH 0/2] net: phy: air_en8811h: fix LED GPIO not surviving MCU restart Vitaliy Sochnev
2026-08-23 13:06 ` [PATCH 1/2] net: phy: air_en8811h: move LED GPIO configuration to config_init Vitaliy Sochnev
2026-08-23 13:06 ` [PATCH 2/2] net: phy: air_en8811h: simplify en8811h_probe() trailing return Vitaliy Sochnev
2026-08-27 9:45 ` [PATCH 0/2] net: phy: air_en8811h: fix LED GPIO not surviving MCU restart Paolo Abeni
2026-08-27 9:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox