Netdev List
 help / color / mirror / Atom feed
* [PATCH iwl-net] e1000e: fix link stuck at 10 Mb/s after DMoff exit
@ 2026-11-19 22:15 Craig I. Hagan
  0 siblings, 0 replies; only message in thread
From: Craig I. Hagan @ 2026-11-19 22:15 UTC (permalink / raw)
  To: anthony.l.nguyen, przemyslaw.kitszel
  Cc: intel-wired-lan, netdev, davem, edumazet, kuba, pabeni,
	andrew+netdev, linux-kernel, tactii, aleksandr.loktionov,
	moriyax.kadosh, vitaly.lifshits, hagan

On an I219 (pch_spt+), a link outage of more than a few seconds (e.g. a
switch reboot) can bring the MAC back in DMoff, with the STATUS speed bits
reading 0. If DMoff has already ended by the time the watchdog runs, the
speed bits can still read 0. The watchdog decodes them as SPEED_10, and the
link stays at 10 Mb/s Full while the PHY is at 1000 Mb/s Full.
rx_crc_errors climb and jumbo traffic stalls until the interface is
manually reset. Seen on deployed machines and reproduced on an I219-LM
(8086:15b7).

The patch "e1000e: restore jumbo config after DMoff exit"
(https://lore.kernel.org/netdev/20260928210552.13266-1-hagan@amazon.com/)
handles DMoff that is still set when the watchdog runs. The watchdog
cannot detect the case above on its own, because STATUS then reads the
same as a real 10 Mb/s Full link.

Record DMoff (PCIM_STATE) in the link status interrupt, next to
mac.get_link_status, and have the watchdog's existing DMoff wait loop
start as if it had seen it, so it takes the same full-reset path.

This depends on that patch. Without it the loop ends in a bare PHY
reset, which clears the 10 Mb/s but not the jumbo configuration.

The unpatched driver stuck at 10 Mb/s on an I219-LM (8086:15b7) when
the switch port was shut for 90 s or the switch power cycled, behind a
Cisco C9200-48P and a TP-Link TL-SG108PE. Reproducing it needs no
kernel change. A debug build that logs STATUS was used to find the
cause, and the patch was tested on the same hardware and switches.

Fixes: def4ec6dce39 ("e1000e: PCIm function state support")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Craig I. Hagan <hagan@amazon.com>
---
Please keep this patch and "e1000e: restore jumbo config after DMoff
exit" (queued in net-queue dev-queue) together, in that order, when
they go to net and to stable. Without it, this patch ends in a bare PHY
reset: the link no longer sticks at 10 Mb/s, but the jumbo
configuration is still not restored.

This was seen on deployed machines running the stock Ubuntu 5.4.0-117
driver behind Cisco C9200-48P switches, on both IOS-XE 16.12.3a and
17.9.4a. After a switch reboot, ethtool reported 10 Mb/s Full while
mii-tool showed the PHY at 1000 Full, and rx_crc_errors kept climbing.
One machine stayed in that state for about a week.

On the bench, the unpatched driver on 5.4.0-117 (HZ=250) was logged
across 16 link-ups, each after the switch port had been shut for 90 s.
All 16 read 0x40080003 in the link status interrupt, and in 2 of them
DMoff had already ended by the time the watchdog ran:

  link status interrupt   0x40080003  DMoff, link up, FD, speed bits 0
  watchdog, +14.6 ms      0x00080003  DMoff over, speed bits still 0
  about 100 ms later      0x00080083  1000 Mb/s Full

With the unpatched driver, the link stuck at 10 Mb/s in 2 of 10 outages
behind the Cisco and in 2 of 20 behind a TP-Link TL-SG108PE V3, both on
5.4.0-117 at HZ=250. On 6.17.0-19 and 7.0.0-14 rebuilt with only
CONFIG_HZ changed to 250 (the Kconfig default), it stuck in 2 of 10
outages on each. At HZ=1000 it did not stick: in the logged runs the
watchdog always found DMoff still set, so the existing DMoff handling
ran. The difference comes from HZ, not the kernel version.

Behind the Cisco, every outage that stuck at 10 Mb/s also dropped jumbo
traffic: 8972-byte pings were lost while small pings passed. On
7.4.0-rc2 built from the same dev-queue tree without this patch (HZ=250,
Cisco on 17.9.4a), 2 of 10 outages instead ended at 1000 Mb/s with jumbo
traffic dropped until "ethtool -r". Neither of those two got a full
reset before link-up, and the full reset is what restores the jumbo
configuration ("e1000e: restore jumbo config after DMoff exit"). With
this patch, all 26 trials there got the full reset and passed jumbo
traffic.

With this patch, every reset and link cycle ended at 1000 Mb/s Full
with 8972-byte pings passing. Each cycle cut power to the switch for 5 s
to 4 min, or shut the port for 90 s. The port-shut cycles behind the
Cisco also ran under 200 Mb/s of jumbo traffic.
That covered 50 cycles on 5.4, 129 on 6.17, 404 on 7.0 and 29 on
7.4.0-rc2 (40 each on 6.17 and 7.0 and all 29 on 7.4.0-rc2 at HZ=250),
behind both switches. The new path was taken 21 times at HZ=250, 5 each
on 6.17 and 7.0 and 4 on 7.4.0-rc2, and never at HZ=1000.

 drivers/net/ethernet/intel/e1000e/hw.h     | 1 +
 drivers/net/ethernet/intel/e1000e/netdev.c | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/intel/e1000e/hw.h b/drivers/net/ethernet/intel/e1000e/hw.h
index c7ac599e5..efb945590 100644
--- a/drivers/net/ethernet/intel/e1000e/hw.h
+++ b/drivers/net/ethernet/intel/e1000e/hw.h
@@ -604,6 +604,7 @@ struct e1000_mac_info {
 	bool autoneg;
 	bool autoneg_failed;
 	bool get_link_status;
+	bool dmoff_at_lsc;
 	bool in_ifs_mode;
 	bool serdes_has_link;
 	bool tx_pkt_filtering;
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index c3e944ee4..47a6964fa 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -1785,6 +1785,7 @@ static irqreturn_t e1000_intr_msi(int __always_unused irq, void *data)
 	/* read ICR disables interrupts using IAM */
 	if (icr & E1000_ICR_LSC) {
 		hw->mac.get_link_status = true;
+		hw->mac.dmoff_at_lsc = er32(STATUS) & E1000_STATUS_PCIM_STATE;
 		/* ICH8 workaround-- Call gig speed drop workaround on cable
 		 * disconnect (LSC) before accessing any PHY registers
 		 */
@@ -1864,6 +1865,7 @@ static irqreturn_t e1000_intr(int __always_unused irq, void *data)
 
 	if (icr & E1000_ICR_LSC) {
 		hw->mac.get_link_status = true;
+		hw->mac.dmoff_at_lsc = er32(STATUS) & E1000_STATUS_PCIM_STATE;
 		/* ICH8 workaround-- Call gig speed drop workaround on cable
 		 * disconnect (LSC) before accessing any PHY registers
 		 */
@@ -5302,6 +5304,9 @@ static void e1000_watchdog_task(struct work_struct *work)
 			/* Checking if MAC is in DMoff state*/
 			if (er32(FWSM) & E1000_ICH_FWSM_FW_VALID) {
 				pcim_state = er32(STATUS);
+				/* DMoff may have ended since the LSC */
+				if (mac->dmoff_at_lsc)
+					pcim_state |= E1000_STATUS_PCIM_STATE;
 				while (pcim_state & E1000_STATUS_PCIM_STATE) {
 					if (tries++ == dmoff_exit_timeout) {
 						e_dbg("Error in exiting dmoff\n");

base-commit: 6055ab4d82e42de89871db03045b568ed706ef50
-- 
2.47.3


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-19 22:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 22:15 [PATCH iwl-net] e1000e: fix link stuck at 10 Mb/s after DMoff exit Craig I. Hagan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox