netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 1/1] net: phy: clear EEE runtime state in PHY_HALTED/PHY_ERROR
@ 2025-09-12 13:20 Oleksij Rempel
  2025-09-15 22:00 ` Andrew Lunn
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Oleksij Rempel @ 2025-09-12 13:20 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni
  Cc: Oleksij Rempel, Russell King (Oracle), kernel, linux-kernel,
	netdev

Clear EEE runtime flags when the PHY transitions to HALTED or ERROR
and the state machine drops the link. This avoids stale EEE state being
reported via ethtool after the PHY is stopped or hits an error.

This change intentionally only clears software runtime flags and avoids
MDIO accesses in HALTED/ERROR. A follow-up patch will address other
link state variables.

Suggested-by: Russell King (Oracle) <linux@armlinux.org.uk>
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
changes v2:
- Update commit message to mention follow-up patch for other link state
  variables.
- v1 Link: https://lore.kernel.org/all/20250909131248.4148301-1-o.rempel@pengutronix.de

Related discussion: https://lore.kernel.org/r/aKg7nf8YczCT6N0O@shell.armlinux.org.uk
---
 drivers/net/phy/phy.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index c02da57a4da5..e046dd858f15 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -1551,6 +1551,8 @@ static enum phy_state_work _phy_state_machine(struct phy_device *phydev)
 	case PHY_ERROR:
 		if (phydev->link) {
 			phydev->link = 0;
+			phydev->eee_active = false;
+			phydev->enable_tx_lpi = false;
 			phy_link_down(phydev);
 		}
 		state_work = PHY_STATE_WORK_SUSPEND;
--
2.47.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2 1/1] net: phy: clear EEE runtime state in PHY_HALTED/PHY_ERROR
  2025-09-12 13:20 [PATCH net-next v2 1/1] net: phy: clear EEE runtime state in PHY_HALTED/PHY_ERROR Oleksij Rempel
@ 2025-09-15 22:00 ` Andrew Lunn
  2025-09-15 22:28 ` Russell King (Oracle)
  2025-09-15 23:30 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2025-09-15 22:00 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Heiner Kallweit, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Russell King (Oracle), kernel, linux-kernel, netdev

On Fri, Sep 12, 2025 at 03:20:00PM +0200, Oleksij Rempel wrote:
> Clear EEE runtime flags when the PHY transitions to HALTED or ERROR
> and the state machine drops the link. This avoids stale EEE state being
> reported via ethtool after the PHY is stopped or hits an error.
> 
> This change intentionally only clears software runtime flags and avoids
> MDIO accesses in HALTED/ERROR. A follow-up patch will address other
> link state variables.
> 
> Suggested-by: Russell King (Oracle) <linux@armlinux.org.uk>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2 1/1] net: phy: clear EEE runtime state in PHY_HALTED/PHY_ERROR
  2025-09-12 13:20 [PATCH net-next v2 1/1] net: phy: clear EEE runtime state in PHY_HALTED/PHY_ERROR Oleksij Rempel
  2025-09-15 22:00 ` Andrew Lunn
@ 2025-09-15 22:28 ` Russell King (Oracle)
  2025-09-15 23:30 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Russell King (Oracle) @ 2025-09-15 22:28 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Andrew Lunn, Heiner Kallweit, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, kernel, linux-kernel, netdev

On Fri, Sep 12, 2025 at 03:20:00PM +0200, Oleksij Rempel wrote:
> Clear EEE runtime flags when the PHY transitions to HALTED or ERROR
> and the state machine drops the link. This avoids stale EEE state being
> reported via ethtool after the PHY is stopped or hits an error.
> 
> This change intentionally only clears software runtime flags and avoids
> MDIO accesses in HALTED/ERROR. A follow-up patch will address other
> link state variables.
> 
> Suggested-by: Russell King (Oracle) <linux@armlinux.org.uk>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Thanks!

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2 1/1] net: phy: clear EEE runtime state in PHY_HALTED/PHY_ERROR
  2025-09-12 13:20 [PATCH net-next v2 1/1] net: phy: clear EEE runtime state in PHY_HALTED/PHY_ERROR Oleksij Rempel
  2025-09-15 22:00 ` Andrew Lunn
  2025-09-15 22:28 ` Russell King (Oracle)
@ 2025-09-15 23:30 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-09-15 23:30 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: andrew, hkallweit1, davem, edumazet, kuba, pabeni, linux, kernel,
	linux-kernel, netdev

Hello:

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

On Fri, 12 Sep 2025 15:20:00 +0200 you wrote:
> Clear EEE runtime flags when the PHY transitions to HALTED or ERROR
> and the state machine drops the link. This avoids stale EEE state being
> reported via ethtool after the PHY is stopped or hits an error.
> 
> This change intentionally only clears software runtime flags and avoids
> MDIO accesses in HALTED/ERROR. A follow-up patch will address other
> link state variables.
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/1] net: phy: clear EEE runtime state in PHY_HALTED/PHY_ERROR
    https://git.kernel.org/netdev/net-next/c/0915cb224527

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] 4+ messages in thread

end of thread, other threads:[~2025-09-15 23:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-12 13:20 [PATCH net-next v2 1/1] net: phy: clear EEE runtime state in PHY_HALTED/PHY_ERROR Oleksij Rempel
2025-09-15 22:00 ` Andrew Lunn
2025-09-15 22:28 ` Russell King (Oracle)
2025-09-15 23:30 ` 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;
as well as URLs for NNTP newsgroup(s).