[PATCH RFC net-next 1/3] net: stmmac: Prevent RGSMIIIS IRQs flood

From: Serge Semin
Date: Fri May 24 2024 - 17:03:37 EST


Without reading the GMAC_RGSMIIIS/MAC_PHYIF_Control_Status the IRQ line
won't be de-asserted causing interrupt handler executed over and over. As
a quick-fix let's just dummy-read the CSR for now.

Signed-off-by: Serge Semin <fancer.lancer@xxxxxxxxx>
---
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 2 ++
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 ++
2 files changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
index adb872d5719f..2ae8467c588e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
@@ -304,6 +304,8 @@ static int dwmac1000_irq_status(struct mac_device_info *hw,
dwmac_pcs_isr(ioaddr, GMAC_PCS_BASE, intr_status, x);

if (intr_status & PCS_RGSMIIIS_IRQ) {
+ /* TODO Dummy-read to clear the IRQ status */
+ readl(ioaddr + GMAC_RGSMIIIS);
phylink_pcs_change(&hw->mac_pcs, false);
x->irq_rgmii_n++;
}
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
index a892d361a4e4..cd2ca1d0222c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
@@ -896,6 +896,8 @@ static int dwmac4_irq_status(struct mac_device_info *hw,

dwmac_pcs_isr(ioaddr, GMAC_PCS_BASE, intr_status, x);
if (intr_status & PCS_RGSMIIIS_IRQ) {
+ /* TODO Dummy-read to clear the IRQ status */
+ readl(ioaddr + GMAC_PHYIF_CONTROL_STATUS);
phylink_pcs_change(&hw->mac_pcs, false);
x->irq_rgmii_n++;
}
--
2.43.0