Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'net-stmmac-disable-eee-on-i-mx'

Laurent Pinchart says:

====================
net: stmmac: Disable EEE on i.MX

This small patch series fixes a long-standing interrupt storm issue with
stmmac on NXP i.MX platforms.

The initial attempt to fix^Wwork around the problem in DT ([1]) was
painfully but rightfully rejected by Russell, who helped me investigate
the issue in depth. It turned out that the root cause is a mistake in
how interrupts are wired in the SoC, a hardware bug that has been
replicated in all i.MX SoCs that integrate an stmmac. The only viable
solution is to disable EEE on those devices.

Individual patches explain the issue in more details. Patch 1/2,
authored by Russell, adds a new STMMAC_FLAG to disable EEE, and patch
2/2 sets the flag for i.MX platforms.

[1] https://lore.kernel.org/r/20251026122905.29028-1-laurent.pinchart@ideasonboard.com
====================

Link: https://patch.msgid.link/20260325210003.2752013-1-laurent.pinchart@ideasonboard.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+16 -13
+3 -6
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
··· 325 325 return ret; 326 326 } 327 327 328 - if (data->flags & STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY) 329 - plat_dat->flags |= STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY; 330 - 331 - if (data->flags & STMMAC_FLAG_KEEP_PREAMBLE_BEFORE_SFD) 332 - plat_dat->flags |= STMMAC_FLAG_KEEP_PREAMBLE_BEFORE_SFD; 328 + plat_dat->flags |= data->flags; 333 329 334 330 /* Default TX Q0 to use TSO and rest TXQ for TBS */ 335 331 for (int i = 1; i < plat_dat->tx_queues_to_use; i++) ··· 362 366 .addr_width = 34, 363 367 .mac_rgmii_txclk_auto_adj = false, 364 368 .set_intf_mode = imx8mp_set_intf_mode, 365 - .flags = STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY | 369 + .flags = STMMAC_FLAG_EEE_DISABLE | 370 + STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY | 366 371 STMMAC_FLAG_KEEP_PREAMBLE_BEFORE_SFD, 367 372 }; 368 373
+6 -1
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 1438 1438 config->supported_interfaces, 1439 1439 pcs->supported_interfaces); 1440 1440 1441 - if (priv->dma_cap.eee) { 1441 + /* Some platforms, e.g. iMX8MP, wire lpi_intr_o to the same interrupt 1442 + * used for stmmac's main interrupts, which leads to interrupt storms. 1443 + * STMMAC_FLAG_EEE_DISABLE allows EEE to be disabled on such platforms. 1444 + */ 1445 + if (priv->dma_cap.eee && 1446 + !(priv->plat->flags & STMMAC_FLAG_EEE_DISABLE)) { 1442 1447 /* The GMAC 3.74a databook states that EEE is only supported 1443 1448 * in MII, GMII, and RGMII interfaces. 1444 1449 */
+7 -6
include/linux/stmmac.h
··· 204 204 #define STMMAC_FLAG_MULTI_MSI_EN BIT(7) 205 205 #define STMMAC_FLAG_EXT_SNAPSHOT_EN BIT(8) 206 206 #define STMMAC_FLAG_INT_SNAPSHOT_EN BIT(9) 207 - #define STMMAC_FLAG_RX_CLK_RUNS_IN_LPI BIT(10) 208 - #define STMMAC_FLAG_EN_TX_LPI_CLOCKGATING BIT(11) 209 - #define STMMAC_FLAG_EN_TX_LPI_CLK_PHY_CAP BIT(12) 210 - #define STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY BIT(13) 211 - #define STMMAC_FLAG_KEEP_PREAMBLE_BEFORE_SFD BIT(14) 212 - #define STMMAC_FLAG_SERDES_SUPPORTS_2500M BIT(15) 207 + #define STMMAC_FLAG_EEE_DISABLE BIT(10) 208 + #define STMMAC_FLAG_RX_CLK_RUNS_IN_LPI BIT(11) 209 + #define STMMAC_FLAG_EN_TX_LPI_CLOCKGATING BIT(12) 210 + #define STMMAC_FLAG_EN_TX_LPI_CLK_PHY_CAP BIT(13) 211 + #define STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY BIT(14) 212 + #define STMMAC_FLAG_KEEP_PREAMBLE_BEFORE_SFD BIT(15) 213 + #define STMMAC_FLAG_SERDES_SUPPORTS_2500M BIT(16) 213 214 214 215 struct mac_device_info; 215 216