Skip to contentSkip to conversation

net: txgbe: use phylink_pcs_change() to report PCS link change events

PATCH Applied Russell King (Oracle) 4 participants 4 messages Apr 26, 2024 – Apr 30, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: txgbe: use phylink_pcs_change() to report PCS link change events

Use phylink_pcs_change() when reporting changes in PCS link state to phylink as the interrupts are informing us about changes to the PCS state.

---
 drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c +1 -1
index 93295916b1d2..5f502265f0a6 100644
@@ -302,7 +302,7 @@ irqreturn_t txgbe_link_irq_handler(int irq, void *data)
 	status = rd32(wx, TXGBE_CFG_PORT_ST);
 	up = !!(status & TXGBE_CFG_PORT_ST_LINK_UP);
 
-	phylink_mac_change(wx->phylink, up);
+	phylink_pcs_change(&txgbe->xpcs->pcs, up);
 
 	return IRQ_HANDLED;
 }
Signature · 1 line
2.30.2
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · Russell King

Use phylink_pcs_change() when reporting changes in PCS link state to phylink as the interrupts are informing us about changes to the PCS state.

---
 drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c +0 -0
index 93295916b1d2..5f502265f0a6 100644

drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c irqreturn_t txgbe_link_irq_handler(int irq, void *data) · line 308

Quoted 8 lines
drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c +1 -1
@@ -302,7 +302,7 @@ irqreturn_t txgbe_link_irq_handler(int irq, void *data)
 	status = rd32(wx, TXGBE_CFG_PORT_ST);
 	up = !!(status & TXGBE_CFG_PORT_ST_LINK_UP);
 
-	phylink_mac_change(wx->phylink, up);
+	phylink_pcs_change(&txgbe->xpcs->pcs, up);
 
 	return IRQ_HANDLED;
 }

Does this only affect the log of phylink_dbg()?
If so,

#2 lore raw
Quoted 18 lines · Jiawen Wu
Quoted 17 lines · Russell King

Use phylink_pcs_change() when reporting changes in PCS link state to phylink as the interrupts are informing us about changes to the PCS state.

---
 drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c +0 -0
index 93295916b1d2..5f502265f0a6 100644
@@ -302,7 +302,7 @@ irqreturn_t txgbe_link_irq_handler(int irq, void *data)
 	status = rd32(wx, TXGBE_CFG_PORT_ST);
 	up = !!(status & TXGBE_CFG_PORT_ST_LINK_UP);
 
Quoted 7 lines

drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c irqreturn_t txgbe_link_irq_handler(int irq, void *data) · line 308

Quoted 5 lines
drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c +1 -1
-	phylink_mac_change(wx->phylink, up);
+	phylink_pcs_change(&txgbe->xpcs->pcs, up);
 
 	return IRQ_HANDLED;
 }

Does this only affect the log of phylink_dbg()?

It means that phylink won't react unless the PCS is being used. The link status should be coming from the PCS block since MII itself doesn't have the notion of link status.

I'm trying to get rid of phylink_mac_change(), which was fine back in the days when it was invented (when phylink didn't distinguish between the MAC and PCS) but it now does.

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
#3 lore raw
In reply to Russell King (Oracle)
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Fri, 26 Apr 2024 17:18:08 +0100 you wrote:

Use phylink_pcs_change() when reporting changes in PCS link state to phylink as the interrupts are informing us about changes to the PCS state.

---
 drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
- [net-next] net: txgbe: use phylink_pcs_change() to report PCS link change events

    https://git.kernel.org/netdev/net-next/c/dd1941f801bc

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html