[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241018222407.1139697-1-quic_abchauha@quicinc.com>
Date: Fri, 18 Oct 2024 15:24:07 -0700
From: Abhishek Chauhan <quic_abchauha@...cinc.com>
To: Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>, netdev@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org,
Andrew Halaney <ahalaney@...hat.com>, Simon Horman <horms@...nel.org>,
Jon Hunter <jonathanh@...dia.com>
Cc: kernel@...cinc.com
Subject: [PATCH net v1] net: stmmac: Disable PCS Link and AN interrupt when PCS AN is disabled
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@...cinc.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
Powered by blists - more mailing lists