From nobody Wed May 28 09:06:54 2025 X-Original-To: dev-commits-src-all@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 4b6kCL3hSZz5xCLm; Wed, 28 May 2025 09:06:54 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4b6kCL2RpKz3vWS; Wed, 28 May 2025 09:06:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748423214; 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=VD0y+H2ZCVQNExaM8ypJ22ctAE5GOzPQoKmlTUyzpXQ=; b=mBY+CBXAWS74uVMdRA19zVJ6e77PDMFvsxL70SLu2MluFaaMNzHOJWHQRwDUoX5HPFntEM YEfC7TL6mDnJhsxWH4SuYH2tZ8qhywKL0NF79pNpu/AxnSl/Wdm+0xgGl8Rr2EwsKvW3f5 slG4AfyDwpYqcuee+VxMVPM4N0uZNTXGTOiS7fzQaPq500NmQU4Hj46EzMvu8XXZrBFFh8 Ja2IaEWGt2bTVa4zyP3JFjPfu+PD4+wn62OzmCtMsr1seOEOJ/5Dr7aAo0am/XXzoIaNnF OK7qNu8EP5keI64/JoEt/yDYaMzNSXjX9/fPKfvwE38bVVpa6U1fggjPxn3diQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1748423214; a=rsa-sha256; cv=none; b=wEptTtoUnhr1z1jVicSr2r9vtRzoRl+4N9nPsHSf755RAzN2t6Mx76t2l6jo1yAGO6clu4 Oqp40dGSX5LI/qhFCTpA/JX74GqiUC1bBqpNh/hb/cCwCMKvCyZlVyRfOLoREgZixH8M41 9mGUPryIA3jUGuRKgaJ9r5HfrLWuOy/NIy+tfNWcN+nSdgjOFZew3336JIrbYAeZWE5v5V hc/yppdgecgkkMBXct8aTfX81O6ijgYKVn6DXWBxQOap60ekQU/FNFpWnbzqgD58W/wExs fJ8hpHLnNvcOM7bfsixF0zg8m4axMTxMdTeW3+XboL51ycoYYSiKv4N97FcXOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1748423214; 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=VD0y+H2ZCVQNExaM8ypJ22ctAE5GOzPQoKmlTUyzpXQ=; b=fB6Yl+4iaH8gFhcrxokdrOzGnJJ8OcnOndg+Cn1uG4WFzNGWv4KaUvB5kdlSFwghyBRP8e SIe78MTlqVF2ZHLbRpz9Qv5pkh8L3qyCsyogY8qJiHJ2szoGtHQHPPKRfQPm60p8Yf39/d nysof7GivqSU0Y8Vyxerzuo7JO+rq1zNGL7+yB5RkfcOUGh3bNwqUjdwD+GDPCzuqgXfne Du/Iw3vQGTUnkzwwl6W52sHitB2TAPmou/Qa2Ofk6QldV6liM/1pBQH6AavQd0UtpBI9GD 6+JmRjYLIYhT7xvzbXlwMmdH+7VrOVgYodW8KZy+48CrFjw7EuikORwmL1Bo1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4b6kCL1yLpzX1q; Wed, 28 May 2025 09:06:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 54S96sYs012095; Wed, 28 May 2025 09:06:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54S96skP012092; Wed, 28 May 2025 09:06:54 GMT (envelope-from git) Date: Wed, 28 May 2025 09:06:54 GMT Message-Id: <202505280906.54S96skP012092@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Tom Jones Subject: git: 969f6c635358 - main - if_iwx: use net80211 suspend and resume methods List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: thj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 969f6c635358a079c50fd3ecd3d060bb5d9e0816 Auto-Submitted: auto-generated The branch main has been updated by thj: URL: https://cgit.FreeBSD.org/src/commit/?id=969f6c635358a079c50fd3ecd3d060bb5d9e0816 commit 969f6c635358a079c50fd3ecd3d060bb5d9e0816 Author: Tom Jones AuthorDate: 2025-05-28 09:02:54 +0000 Commit: Tom Jones CommitDate: 2025-05-28 09:02:54 +0000 if_iwx: use net80211 suspend and resume methods Use net80211 suspend and resume methods when entering and leaving suspend. Move the resume action outside of the IWX_LOCK. Re-assert disabling the PCI timeout, this is copied from OpenBSD (and a common pattern), but it doesn't seem to hurt. PR: 286059 Reviewed by: adrian Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50462 --- sys/dev/iwx/if_iwx.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/sys/dev/iwx/if_iwx.c b/sys/dev/iwx/if_iwx.c index 029031802a26..a0e4bf8a53f6 100644 --- a/sys/dev/iwx/if_iwx.c +++ b/sys/dev/iwx/if_iwx.c @@ -195,6 +195,8 @@ int iwx_lomark = 192; #include +#define PCI_CFG_RETRY_TIMEOUT 0x41 + #define PCI_VENDOR_INTEL 0x8086 #define PCI_PRODUCT_INTEL_WL_22500_1 0x2723 /* Wi-Fi 6 AX200 */ #define PCI_PRODUCT_INTEL_WL_22500_2 0x02f0 /* Wi-Fi 6 AX201 */ @@ -10142,7 +10144,6 @@ iwx_attach(device_t dev) * We disable the RETRY_TIMEOUT register (0x41) to keep * PCI Tx retries from interfering with C3 CPU state. */ -#define PCI_CFG_RETRY_TIMEOUT 0x41 pci_write_config(dev, PCI_CFG_RETRY_TIMEOUT, 0x00, 1); if (pci_msix_count(dev)) { @@ -10657,8 +10658,11 @@ static int iwx_suspend(device_t dev) { struct iwx_softc *sc = device_get_softc(dev); + struct ieee80211com *ic = &sc->sc_ic; if (sc->sc_flags & IWX_FLAG_HW_INITED) { + ieee80211_suspend_all(ic); + iwx_stop(sc); sc->sc_flags &= ~IWX_FLAG_HW_INITED; } @@ -10669,21 +10673,27 @@ static int iwx_resume(device_t dev) { struct iwx_softc *sc = device_get_softc(dev); + struct ieee80211com *ic = &sc->sc_ic; int err; - err = iwx_start_hw(sc); - if (err) { - return err; - } + /* + * We disable the RETRY_TIMEOUT register (0x41) to keep + * PCI Tx retries from interfering with C3 CPU state. + */ + pci_write_config(dev, PCI_CFG_RETRY_TIMEOUT, 0x00, 1); - err = iwx_init_hw(sc); + IWX_LOCK(sc); + + err = iwx_init(sc); if (err) { iwx_stop_device(sc); + IWX_UNLOCK(sc); return err; } - ieee80211_start_all(&sc->sc_ic); + IWX_UNLOCK(sc); + ieee80211_resume_all(ic); return (0); }