From nobody Fri Sep 11 20:16:18 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hhQmL6J2Zz6rDZ6 for ; Fri, 11 Sep 2026 20:16:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hhQmL5qPHz4K37 for ; Fri, 11 Sep 2026 20:16:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789157778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G9mpoUP7eKkJ8VzRe2Wxl8fjJalA8dWOOBGZ7JjSDes=; b=T0MCby4j/v/uTjyDtzRWXF87R8d/XOoHFI6K9OFMMOydaaxQ4MTVf74U9bDmMr2TIYVZHY wT4rfqRn//QvcueWC/ZEljYunCkupoIopDfpZbmVgs/TPCSQQlcSNZf4FNn2BpgkE5vSzL u1kwjpC3O0pzOZ8UZYiDQB9FuKZlYw0P6GxWLoNyTpctmKYDsSAri5MpD7jo8PX2TXAjo3 1GjEgWRkh2oPn4NJiXGYAwLd5Fh0MeXGdjXLXLJ4ZXRzKvMp/hrG+XWT7QxrYhRbFz4zoM vIT3UrJQNG3PKKj4kn4ZXAfUALj50zzRKSojp3qYwdmfpkuNg5JpqSchLsM25A== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1789157778; b=v6eaujwqMbyFgt6O/Yk2jB5e/I4bXj5WoT9ntKivBjOIP2n2BaLLVvN8otuboEoXOdht7I L6KO8zJidFRCXUsBalhHFRDVvU6BaNQN45Y427gd1d70vmqjIZNrqi/U94RPjfqyzoNN11 Yp3XjY7QGfdMSmeECwpHLlp0oDBPCcYFckkWbGoUQgolBMlGXqGeBQb1H7lgxf/JFnum7W pvLp1Gna7mjgY1nhAgMAyhHWJqhkfOETXvNwxdqc3ywj1x2TjpBg9RLTDosMUU6sMeYgoI Es5wVY6NJ80F+l0zd5H/wU+g2KaXsoHWIpglN+GherOMQqS4lGi+F4nHtoforQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789157778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G9mpoUP7eKkJ8VzRe2Wxl8fjJalA8dWOOBGZ7JjSDes=; b=KJiYiMBRdgsdRiJbT7jU9X11nbd9r3z79TN5pfaIOrPMAe0M4APkBh9NL0vsXAb8hYHGLs zvlpBFPxghEMTinwHjPi6e7sjkv3Mm3HAV8Q7QEIGEqdwl87MXECrS5iBCyMLNPgoJOKRd s9mSTqwc4+vUHQWT+4tFvoeIFRngrkv0bQ9bgzbxLotpnRsNOnS1pbByI5Xl1aPTq/h1vS oVWV8ndyYLhqo53yoQLDSIB4X2JVs5jtT1M0lohM55d1Ntg+Ty1WZzktVy8kO8vYu/SENK 927nfcg7wrdROcj+JBGdtCSxFhZ7nlJzS5L2Yk/bkB8C4QRsfHuEHC/JR9wzoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hhQmL4szSzScF for ; Fri, 11 Sep 2026 20:16:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2515e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 11 Sep 2026 20:16:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 45dc4a13654c - main - ixgbe: Pause firmware recovery polling in low power List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45dc4a13654c5e90bcf5f757e46f1353b30848ee Auto-Submitted: auto-generated Date: Fri, 11 Sep 2026 20:16:18 +0000 Message-Id: <6aa46192.2515e.23f50619@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=45dc4a13654c5e90bcf5f757e46f1353b30848ee commit 45dc4a13654c5e90bcf5f757e46f1353b30848ee Author: Kevin Bowling AuthorDate: 2026-09-04 06:37:25 +0000 Commit: Kevin Bowling CommitDate: 2026-09-11 20:15:55 +0000 ixgbe: Pause firmware recovery polling in low power The firmware recovery callout continues polling controller registers after a power transition. An inaccessible E610 GL_MNG_FWSM register reads as all ones in D3, which looks like firmware recovery mode and queues an iflib reset while the device is suspended. A later D0 poll then reports recovery complete and queues another reset. Pause and drain the callout before terminal stop policy is applied, prevent an in-flight callback from rearming it, and restart polling only after resume has cleared the wake state. Track callout initialization so partial attach cleanup does not drain an uninitialized callout. The false transition was reproduced on a dual-port E610 with direct D3 and system S3. Validate the guard with wake-disabled and wake-armed D3, three repeated D3 cycles per port, and an S3 magic-packet wake. Both ports returned to D0 without a false recovery transition. MFC after: 2 weeks Sponsored by: BBOX.io --- sys/dev/ixgbe/if_ix.c | 38 +++++++++++++++++++++++++++++++++----- sys/dev/ixgbe/ixgbe.h | 2 ++ 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index f734db0f79f0..b2a133c80b55 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -254,6 +254,8 @@ static void ixgbe_update_stats_counters(struct ixgbe_softc *); static void ixgbe_config_link(if_ctx_t); static void ixgbe_get_slot_info(struct ixgbe_softc *); static void ixgbe_fw_mode_timer(void *); +static void ixgbe_fw_mode_timer_pause(struct ixgbe_softc *); +static void ixgbe_fw_mode_timer_resume(struct ixgbe_softc *); static void ixgbe_configure_wakeup(if_ctx_t); static void ixgbe_configure_wakeup_mta(if_ctx_t); static void ixgbe_prepare_wakeup(if_ctx_t, bool); @@ -1408,6 +1410,7 @@ ixgbe_if_attach_post(if_ctx_t ctx) /* Set up the timer callout */ callout_init(&sc->fw_mode_timer, true); + sc->fw_mode_timer_initialized = true; /* Start the task */ callout_reset(&sc->fw_mode_timer, hz, ixgbe_fw_mode_timer, sc); @@ -3916,6 +3919,7 @@ ixgbe_if_detach(if_ctx_t ctx) INIT_DEBUGOUT("ixgbe_detach: begin"); sc->iov_recovery_stop = true; + ixgbe_fw_mode_timer_pause(sc); ixgbe_setup_low_power_mode(ctx); @@ -3924,8 +3928,6 @@ ixgbe_if_detach(if_ctx_t ctx) ctrl_ext &= ~IXGBE_CTRL_EXT_DRV_LOAD; IXGBE_WRITE_REG(&sc->hw, IXGBE_CTRL_EXT, ctrl_ext); - callout_drain(&sc->fw_mode_timer); - if (sc->hw.mac.type == ixgbe_mac_E610) { ixgbe_disable_lse(sc); ixgbe_shutdown_aci(&sc->hw); @@ -4004,7 +4006,9 @@ ixgbe_configure_wakeup_mta(if_ctx_t ctx) static int ixgbe_if_power_prepare(if_ctx_t ctx, enum iflib_power_event event) { + struct ixgbe_softc *sc = iflib_get_softc(ctx); + ixgbe_fw_mode_timer_pause(sc); ixgbe_prepare_wakeup(ctx, event != IFLIB_POWER_DETACH); return (0); } @@ -4154,6 +4158,7 @@ ixgbe_if_resume(if_ctx_t ctx) pci_clear_pme(dev); hw->wol_enabled = false; sc->wol_filters = 0; + ixgbe_fw_mode_timer_resume(sc); return (0); } /* ixgbe_if_resume */ @@ -4796,6 +4801,9 @@ ixgbe_fw_mode_timer(void *arg) struct ixgbe_softc *sc = arg; struct ixgbe_hw *hw = &sc->hw; + if (atomic_load_acq_int(&sc->fw_mode_timer_paused) != 0) + return; + if (ixgbe_fw_recovery_mode(hw)) { if (atomic_cmpset_acq_int(&sc->recovery_mode, 0, 1)) { /* Firmware error detected, entering recovery mode */ @@ -4815,11 +4823,31 @@ ixgbe_fw_mode_timer(void *arg) iflib_admin_intr_deferred(sc->ctx); } - - callout_reset(&sc->fw_mode_timer, hz, - ixgbe_fw_mode_timer, sc); + if (atomic_load_acq_int(&sc->fw_mode_timer_paused) == 0) + callout_reset(&sc->fw_mode_timer, hz, + ixgbe_fw_mode_timer, sc); } /* ixgbe_fw_mode_timer */ +static void +ixgbe_fw_mode_timer_pause(struct ixgbe_softc *sc) +{ + + if (!sc->fw_mode_timer_initialized || + atomic_swap_int(&sc->fw_mode_timer_paused, 1) != 0) + return; + callout_drain(&sc->fw_mode_timer); +} + +static void +ixgbe_fw_mode_timer_resume(struct ixgbe_softc *sc) +{ + + if (!sc->fw_mode_timer_initialized || + atomic_swap_int(&sc->fw_mode_timer_paused, 0) == 0) + return; + callout_reset(&sc->fw_mode_timer, hz, ixgbe_fw_mode_timer, sc); +} + /************************************************************************ * ixgbe_sfp_probe * diff --git a/sys/dev/ixgbe/ixgbe.h b/sys/dev/ixgbe/ixgbe.h index ba8cfb94915a..fb0ac15f5008 100644 --- a/sys/dev/ixgbe/ixgbe.h +++ b/sys/dev/ixgbe/ixgbe.h @@ -505,6 +505,8 @@ struct ixgbe_softc { /* Firmware error check */ int recovery_mode; + u_int fw_mode_timer_paused; + bool fw_mode_timer_initialized; bool overtemp_shutdown_pending; struct callout fw_mode_timer;