All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Craig I. Hagan" <hagan@amazon.com>
Cc: intel-wired-lan@lists.osuosl.org
Subject: Re: [PATCH iwl-net] e1000e: fix link stuck at 10 Mb/s after DMoff exit
Date: Fri, 20 Nov 2026 22:15:58 +0000	[thread overview]
Message-ID: <sashiko-outbox-226237@kernel.org> (raw)
In-Reply-To: <20261119221548.10466-1-hagan@amazon.com>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] e1000e: data race on adapter->flags in e1000_watchdog_task()
  [1]
--

commit a2887ea1ca15cc20dbf05390436bdded73c4d7b5
Author: Craig I. Hagan <hagan@amazon.com>

e1000e: fix link stuck at 10 Mb/s after DMoff exit

This commit records the PCIM_STATE (DMoff) bit in the link status change
interrupt handler so e1000_watchdog_task() still enters the DMoff wait and
full-reset path if DMoff ends before the watchdog runs.

> diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
> index c3e944ee4cf9a..47a6964fa7df0 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
>  		 */

[Severity: High]
This problem wasn't introduced by this patch, but can unlocked updates to
adapter->flags in e1000_intr_msi() and e1000_watchdog_task() cause a data
race [1]?

e1000_watchdog_task() runs in process context with interrupts enabled and
calls e1000e_enable_receives(), which clears FLAG_RESTART_NOW with a
non-atomic read-modify-write while the LSC interrupt handler sets
FLAG_RESTART_NOW in adapter->flags:

drivers/net/ethernet/intel/e1000e/netdev.c:e1000e_enable_receives() {
	if ((adapter->flags & FLAG_RX_NEEDS_RESTART) &&
	    (adapter->flags & FLAG_RESTART_NOW)) {
		...
		ew32(RCTL, rctl | E1000_RCTL_EN);
		adapter->flags &= ~FLAG_RESTART_NOW;
	}
}

CPU0 (kworker)                    CPU1 (<hardirq>)
e1000_watchdog_task()
  e1000e_enable_receives()
    tmp = adapter->flags
                                  e1000_intr_msi()
                                    adapter->flags |= FLAG_RESTART_NOW
    adapter->flags = tmp & ~FLAG_RESTART_NOW  <-- overwrites interrupt update

Losing the flag update skips the needed device reset or Rx restart and can
stall traffic.

[1] https://sashiko.dev/#/bug/linux-63b75aa0-7ff8-4f26-8fdb-d0ecb891cbfa

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261119221548.10466-1-hagan@amazon.com?part=1

      reply	other threads:[~2026-11-20 22:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 22:15 [PATCH iwl-net] e1000e: fix link stuck at 10 Mb/s after DMoff exit Craig I. Hagan
2026-11-20 22:15 ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-226237@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=hagan@amazon.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.