[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260208232931.2272237-1-laurent.pinchart@ideasonboard.com>
Date: Mon, 9 Feb 2026 01:29:31 +0200
From: Laurent Pinchart <laurent.pinchart@...asonboard.com>
To: netdev@...r.kernel.org,
imx@...ts.linux.dev
Cc: Andrew Lunn <andrew+netdev@...n.ch>,
Clark Wang <xiaoning.wang@....com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Fabio Estevam <festevam@...x.de>,
Fabio Estevam <festevam@...il.com>,
Francesco Dolcini <francesco.dolcini@...adex.com>,
Frank Li <Frank.Li@....com>,
Heiko Schocher <hs@...x.de>,
Jakub Kicinski <kuba@...nel.org>,
Joakim Zhang <qiangqing.zhang@....com>,
Joy Zou <joy.zou@....com>,
Kieran Bingham <kieran.bingham@...asonboard.com>,
Marcel Ziswiler <marcel.ziswiler@...adex.com>,
Marco Felsch <m.felsch@...gutronix.de>,
Martyn Welch <martyn.welch@...labora.com>,
Mathieu Othacehe <othacehe@....org>,
Paolo Abeni <pabeni@...hat.com>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Richard Hu <richard.hu@...hnexion.com>,
"Russell King (Oracle)" <rmk+kernel@...linux.org.uk>,
Sascha Hauer <s.hauer@...gutronix.de>,
Shawn Guo <shawnguo@...nel.org>,
Shenwei Wang <shenwei.wang@....com>,
Stefan Klug <stefan.klug@...asonboard.com>,
Stefano Radaelli <stefano.radaelli21@...il.com>,
Wei Fang <wei.fang@....com>,
Xiaoliang Yang <xiaoliang.yang_1@....com>,
linux-arm-kernel@...ts.infradead.org
Subject: [PATCH] net: stmmac: imx: Disable EEE
The i.MX8MP suffers from an interrupt storm related to the stmmac and
EEE. A long and tedious analysis ([1]) concluded that the SoC wires the
stmmac lpi_intr_o signal to an OR gate along with the main dwmac
interrupts, which causes an interrupt storm for two reasons.
First, there's a race condition due to the interrupt deassertion being
synchronous to the RX clock domain:
- When the PHY exits LPI mode, it restarts generating the RX clock
(clk_rx_i input signal to the GMAC).
- The MAC detects exit from LPI, and asserts lpi_intr_o. This triggers
the ENET_EQOS interrupt.
- Before the CPU has time to process the interrupt, the PHY enters LPI
mode again, and stops generating the RX clock.
- The CPU processes the interrupt and reads the GMAC4_LPI_CTRL_STATUS
registers. This does not clear lpi_intr_o as there's no clk_rx_i.
An attempt was made to fixing the issue by not stopping RX_CLK in Rx LPI
state ([2]). This alleviates the symptoms but doesn't fix the issue.
Since lpi_intr_o takes four RX_CLK cycles to clear, an interrupt storm
can still occur during that window. In 1000T mode this is harder to
notice, but slower receive clocks cause hundreds to thousands of
spurious interrupts.
Fix the issue by disabling EEE completely on i.MX8MP.
[1] https://lore.kernel.org/all/20251026122905.29028-1-laurent.pinchart@ideasonboard.com/
[2] https://lore.kernel.org/all/20251123053518.8478-1-laurent.pinchart@ideasonboard.com/
Signed-off-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
---
This patch depends on https://lore.kernel.org/r/20251026122905.29028-1-laurent.pinchart@ideasonboard.com
---
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
index db288fbd5a4d..e8e6f325d92d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
@@ -317,8 +317,7 @@ static int imx_dwmac_probe(struct platform_device *pdev)
return ret;
}
- if (data->flags & STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY)
- plat_dat->flags |= STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY;
+ plat_dat->flags |= data->flags;
/* Default TX Q0 to use TSO and rest TXQ for TBS */
for (int i = 1; i < plat_dat->tx_queues_to_use; i++)
@@ -355,7 +354,8 @@ static struct imx_dwmac_ops imx8mp_dwmac_data = {
.addr_width = 34,
.mac_rgmii_txclk_auto_adj = false,
.set_intf_mode = imx8mp_set_intf_mode,
- .flags = STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY,
+ .flags = STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY
+ | STMMAC_FLAG_EEE_DISABLE,
};
static struct imx_dwmac_ops imx8dxl_dwmac_data = {
base-commit: 18f7fcd5e69a04df57b563360b88be72471d6b62
prerequisite-patch-id: a3c3f8b08fd66ee3ccce632aad3f4a3c21c92718
--
Regards,
Laurent Pinchart
Powered by blists - more mailing lists