netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v1] net: stmmac: Disable PCS Link and AN interrupt when PCS AN is disabled
@ 2024-10-18 22:24 Abhishek Chauhan
  2024-10-19  2:45 ` Andrew Lunn
  0 siblings, 1 reply; 8+ messages in thread
From: Abhishek Chauhan @ 2024-10-18 22:24 UTC (permalink / raw)
  To: Alexandre Torgue, Jose Abreu, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, netdev, linux-stm32,
	linux-arm-kernel, Andrew Halaney, Simon Horman, Jon Hunter
  Cc: kernel

Currently we disable PCS ANE when the link speed is 2.5Gbps.
mac_link_up callback internally calls the fix_mac_speed which internally
calls stmmac_pcs_ctrl_ane to disable the ANE for 2.5Gbps.

We observed that the CPU utilization is pretty high. That is because
we saw that the PCS interrupt status line for Link and AN always remain
asserted. Since we are disabling the PCS ANE for 2.5Gbps it makes sense
to also disable the PCS link status and AN complete in the interrupt
enable register.

Interrupt storm Issue:-
[   25.465754][    C2] stmmac_pcs: Link Down
[   25.469888][    C2] stmmac_pcs: Link Down
[   25.474030][    C2] stmmac_pcs: Link Down
[   25.478164][    C2] stmmac_pcs: Link Down
[   25.482305][    C2] stmmac_pcs: Link Down
[   25.486441][    C2] stmmac_pcs: Link Down
[   25.486635][    C4] watchdog0: pretimeout event
[   25.490585][    C2] stmmac_pcs: Link Down
[   25.499341][    C2] stmmac_pcs: Link Down
[   25.503484][    C2] stmmac_pcs: Link Down
[   25.507619][    C2] stmmac_pcs: Link Down
[   25.511760][    C2] stmmac_pcs: Link Down
[   25.515897][    C2] stmmac_pcs: Link Down
[   25.520038][    C2] stmmac_pcs: Link Down
[   25.524174][    C2] stmmac_pcs: Link Down
[   25.528316][    C2] stmmac_pcs: Link Down
[   25.532451][    C2] stmmac_pcs: Link Down
[   25.536591][    C2] stmmac_pcs: Link Down
[   25.540724][    C2] stmmac_pcs: Link Down
[   25.544866][    C2] stmmac_pcs: Link Down

Once we disabled PCS ANE and Link Status interrupt issue
disappears.

Fixes: a818bd12538c ("net: stmmac: dwmac-qcom-ethqos: Add support for 2.5G SGMII")
Signed-off-by: Abhishek Chauhan <quic_abchauha@quicinc.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
index e65a65666cc1..db77d07af9fe 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
@@ -751,7 +751,16 @@ static void dwmac4_flow_ctrl(struct mac_device_info *hw, unsigned int duplex,
 static void dwmac4_ctrl_ane(void __iomem *ioaddr, bool ane, bool srgmi_ral,
 			    bool loopback)
 {
+	u32 intr_mask = readl(ioaddr + GMAC_INT_EN);
+
 	dwmac_ctrl_ane(ioaddr, GMAC_PCS_BASE, ane, srgmi_ral, loopback);
+
+	if (!ane)
+		intr_mask &= ~(GMAC_INT_PCS_LINK | GMAC_INT_PCS_ANE);
+	else
+		intr_mask |= (GMAC_INT_PCS_LINK | GMAC_INT_PCS_ANE);
+
+	writel(intr_mask, ioaddr + GMAC_INT_EN);
 }
 
 static void dwmac4_get_adv_lp(void __iomem *ioaddr, struct rgmii_adv *adv)
-- 
2.25.1


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

end of thread, other threads:[~2024-11-04 21:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-18 22:24 [PATCH net v1] net: stmmac: Disable PCS Link and AN interrupt when PCS AN is disabled Abhishek Chauhan
2024-10-19  2:45 ` Andrew Lunn
2024-10-21  9:20   ` Russell King (Oracle)
2024-10-21  9:32     ` Russell King (Oracle)
2024-10-21 15:09       ` Abhishek Chauhan (ABC)
2024-10-24 22:51         ` Abhishek Chauhan (ABC)
2024-10-25 12:44           ` Andrew Lunn
2024-11-04 21:49             ` Abhishek Chauhan (ABC)

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