From nobody Mon Oct 12 02:51:37 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 4j326d6BsLz6k5C2 for ; Mon, 12 Oct 2026 02:51:37 +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 4j326d3J4Dz4TnZ for ; Mon, 12 Oct 2026 02:51:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791773497; 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=Q0dToKkR+/xGL/2uz6p6bOSm3cs42qloNtIoY/LlQDA=; b=hZkfF2n1exGaqJwP7PWwVoQljFMzIEyXD5IlC/g3KAYkGzlVqAf3AJTZR0BL9QWjSBYhnG TuRgAh/2LgxH8yl8JMZma/sQcwv7pbX7aFdYz8JIAQOKUjeLM3rsN5mnrkQEduDF7HAniH jBpPUZXzTqne4Y9QCtZEYXtzkO0+OjHIkF1ltyrH2SohRQnlXmLW4VvgURrkbwmdp1DnuU NDb36o8OF1qmNx+42PrH2hT37VkY6C2/y6pJCVwC2wrw8pfd3AcKmcyrbT6lOiOBbocKv4 KQCvW7u8/C2CtrhmzcFFMqcAhlJBfjP5ElmSQCRcnnWG/1/U6pxSXv9fyoNvhQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791773497; b=oJ+j/lhymU5aTqFGg48JpnZK5KUk4k7k6W4wYncqSY1l6mWrWvCJqK3sDDBbpyS9UVrzvz YIfGYWiTFf8kea0jOucI1UtJX3LUR7xsqoWIp7T3EuXYxi7fYAoYfL5lqdHywYIUHkJeaB 1N2fCTXuiVF3pNT4vSc3y/FduGtFLDiFhMqwOsCtceBp9ErtUoqkpfisITr3fccXAUX1rg OBhuXvUgulCy1aJR9qe8hAEH2unleG0ykMHpvV75YBBwSrruPG34qyHG6n/PhxRG2xtQnx usu4lDFr3j1I+5rIbwjvGMjL8Rw/RU8bFnMkidP9nH2tJst2TjFaQY1MqApxOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791773497; 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=Q0dToKkR+/xGL/2uz6p6bOSm3cs42qloNtIoY/LlQDA=; b=AzdpSi2s5hlNrXqOmFtYQDefOeodAX3/w6ssAiwiHy/NcoJo2gQwZSoQBzvny0BHtwHgLH NCw/8xAbZu9QGkItE+6RRaT9t4OxaJu9JLOzscMgnh7AbOnuWxsEfgE6kaGXYOIQS4rQdP faFXtMnBuFItgTBYbhjsRRkfFB1LajdDXm+J1FSuYbdutcbt0T2YQDLy2rDsLbzDpy5djj +jrtZxASC8jWJKjhBq+Cy8LSMsZQ6lKnob+lMpaOvoMPpATecRpfYGbvezilyHTg5yV/I2 sNgxUyph5TGTSyYz+3wHfikhugxW6pUBeJh8ZDYFd3Cz4W2EXTfrlYoIHTBZdg== 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 4j326d2MXtz187M for ; Mon, 12 Oct 2026 02:51:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 42691 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 12 Oct 2026 02:51:37 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 7ce67909fa68 - main - iwm: clear persistence bit on 9000 series NICs List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: Commit messages for the main branch of the src repository 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: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7ce67909fa683b22546b2ec8d635db1582b56bca Auto-Submitted: auto-generated Date: Mon, 12 Oct 2026 02:51:37 +0000 Message-Id: <6acc4b39.42691.5cfe49b2@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=7ce67909fa683b22546b2ec8d635db1582b56bca commit 7ce67909fa683b22546b2ec8d635db1582b56bca Author: Adrian Chadd AuthorDate: 2026-10-12 02:50:50 +0000 Commit: Adrian Chadd CommitDate: 2026-10-12 02:50:50 +0000 iwm: clear persistence bit on 9000 series NICs From what I've gathered, this is to make sure that the firmware clears state and is reloaded through hardware bring-up and suspend/resume. It may fix instability issues with the 9000 series NICs. I'll need to test it out first. Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674 Differential Revision: https://reviews.freebsd.org/D60078 --- sys/dev/iwm/if_iwm_pcie_trans.c | 25 +++++++++++++++++++++++++ sys/dev/iwm/if_iwm_pcie_trans.h | 1 + 2 files changed, 26 insertions(+) diff --git a/sys/dev/iwm/if_iwm_pcie_trans.c b/sys/dev/iwm/if_iwm_pcie_trans.c index 96134b4c9d81..ce7526b0377d 100644 --- a/sys/dev/iwm/if_iwm_pcie_trans.c +++ b/sys/dev/iwm/if_iwm_pcie_trans.c @@ -620,6 +620,26 @@ iwm_apm_stop(struct iwm_softc *sc) IWM_DPRINTF(sc, IWM_DEBUG_TRANS, "%s: iwm apm stop\n", __func__); } +int +iwm_clear_persistence_bit(struct iwm_softc *sc) +{ + uint32_t hpm, wprot; + + hpm = iwm_read_prph(sc, IWM_HPM_DEBUG); + if (hpm != 0xa5a5a5a0 && (hpm & IWM_HPM_PERSISTENCE_BIT)) { + wprot = iwm_read_prph(sc, IWM_PREG_PRPH_WPROT_9000); + if (wprot & IWM_PREG_WFPM_ACCESS) { + device_printf(sc->sc_dev, + "cannot clear persistence bit\n"); + return EPERM; + } + iwm_write_prph(sc, IWM_HPM_DEBUG, + hpm & ~IWM_HPM_PERSISTENCE_BIT); + } + + return 0; +} + /* iwlwifi pcie/trans.c */ int iwm_start_hw(struct iwm_softc *sc) @@ -629,6 +649,11 @@ iwm_start_hw(struct iwm_softc *sc) if ((error = iwm_prepare_card_hw(sc)) != 0) return error; + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_9000) { + if ((error = iwm_clear_persistence_bit(sc)) != 0) + return error; + } + /* Reset the entire device */ IWM_WRITE(sc, IWM_CSR_RESET, IWM_CSR_RESET_REG_FLAG_SW_RESET); DELAY(5000); diff --git a/sys/dev/iwm/if_iwm_pcie_trans.h b/sys/dev/iwm/if_iwm_pcie_trans.h index 8b00a3fd6a69..f55707e1c96f 100644 --- a/sys/dev/iwm/if_iwm_pcie_trans.h +++ b/sys/dev/iwm/if_iwm_pcie_trans.h @@ -128,6 +128,7 @@ extern int iwm_prepare_card_hw(struct iwm_softc *sc); extern void iwm_apm_config(struct iwm_softc *sc); extern int iwm_apm_init(struct iwm_softc *sc); extern void iwm_apm_stop(struct iwm_softc *sc); +extern int iwm_clear_persistence_bit(struct iwm_softc *sc); extern int iwm_start_hw(struct iwm_softc *sc); extern void iwm_set_pwr(struct iwm_softc *sc); extern int iwm_pcie_rx_stop(struct iwm_softc *sc);