From: Andrei Rusu de Castro <arc@empyreal.works>
To: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
Emmanuel Grumbach <emmanuel.grumbach@intel.com>,
Luca Coelho <luciano.coelho@intel.com>,
Kalle Valo <kvalo@kernel.org>,
Ayala Beker <ayala.beker@intel.com>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] wifi: iwlwifi: pcie: use the CSME path when the NIC cannot be woken at probe
Date: Mon, 16 Nov 2026 16:41:04 +0000 [thread overview]
Message-ID: <bc42d99ffe982a5af20cd7dd7809680b3979789c.1794846777.git.arc@empyreal.works> (raw)
In-Reply-To: <cover.1794846777.git.arc@empyreal.works>
When Intel AMT powers the host on shortly after a shutdown, CSME can
still be driving the NIC while it hands it back to the host. The host's
NIC_READY semaphore is free then, so iwl_pcie_prepare_card_hw() succeeds,
but the MAC clock does not come up within the 25 ms that
iwl_pcie_activate_nic() polls, and the probe fails for good:
iwlwifi 0000:00:14.3: CSR_RESET = 0x11
iwlwifi 0000:00:14.3: probe with driver iwlwifi failed with error -110
CSME then keeps the device, and the following boots fail the same way
until AMT's wireless is switched off and on again.
At that point HW_IF_CONFIG reads 0x02080000 (ME_OWN and IAMT_UP set). If
the SAP connection to CSME is up, or comes up within 5 seconds, continue
as when CSME visibly owns the device at probe: drop the init-done request,
set csme_own and let the op mode take the NVM from CSME and request the
device over SAP before using it.
Tested on an HP ZBook Firefly 14 G10 (AX211, CSME 16.1) with AMT's
wireless enabled: without this change four of six AMT power-ons and
resets left the host without Wi-Fi; with it, power-ons pressed as soon as
AMT reported the host off came back on Wi-Fi 36-48 s later.
Fixes: 2fd8aaaeb874 ("iwlwifi: pcie: try to grab NIC access early")
Signed-off-by: Andrei Rusu de Castro <arc@empyreal.works>
---
.../net/wireless/intel/iwlwifi/pcie/trans.c | 40 ++++++++++++++++++-
1 file changed, 38 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index 0f4e309fe32b..e95b52332cea 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -4182,6 +4182,40 @@ static void iwl_pcie_check_me_status(struct iwl_trans *trans)
schedule_delayed_work(&trans_pcie->me_recheck_wk, HZ);
}
+/*
+ * CSME (Intel AMT) can still be driving the NIC while it hands the device
+ * over to the host, for example right after the host was powered on through
+ * AMT: the host gets the hardware semaphore, but the MAC does not wake. If
+ * the SAP connection to CSME is up, or comes up shortly, continue as when
+ * CSME visibly owns the device: the op mode gets the NVM from CSME and asks
+ * it for the device over SAP before using it.
+ */
+static bool iwl_pcie_csme_drives_nic(struct iwl_trans *trans)
+{
+ int t;
+
+ for (t = 0; !iwl_mei_is_connected() && t < 5000; t += 100)
+ msleep(100);
+
+ if (!iwl_mei_is_connected())
+ return false;
+
+ IWL_INFO(trans,
+ "Couldn't wake the NIC but SAP is connected, CSME owns it (HW_IF_CONFIG 0x%08x)\n",
+ iwl_trans_pcie_read32(trans, CSR_HW_IF_CONFIG_REG));
+
+ if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_BZ)
+ iwl_trans_clear_bit(trans, CSR_GP_CNTRL,
+ CSR_GP_CNTRL_REG_FLAG_BZ_MAC_ACCESS_REQ |
+ CSR_GP_CNTRL_REG_FLAG_MAC_INIT);
+ else
+ iwl_trans_clear_bit(trans, CSR_GP_CNTRL,
+ CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
+
+ trans->csme_own = true;
+ return true;
+}
+
int _iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent,
const struct iwl_mac_cfg *mac_cfg,
u8 __iomem *hw_base, u32 hw_rev)
@@ -4218,9 +4252,11 @@ int _iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent,
ret = iwl_pcie_prepare_card_hw(iwl_trans);
if (!ret) {
ret = iwl_trans_activate_nic(iwl_trans);
- if (ret)
+ if (ret && iwl_pcie_csme_drives_nic(iwl_trans)) {
+ ret = 0;
+ } else if (ret) {
goto out_free_trans;
- if (iwl_trans_grab_nic_access(iwl_trans)) {
+ } else if (iwl_trans_grab_nic_access(iwl_trans)) {
get_crf_id(iwl_trans, &info, &hw_wfpm_id);
/* all good */
iwl_trans_release_nic_access(iwl_trans);
--
2.55.0
next prev parent reply other threads:[~2026-11-16 16:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 16:40 [PATCH 0/2] wifi: iwlwifi: keep Wi-Fi when Intel AMT powers the host on Andrei Rusu de Castro
2026-11-16 16:41 ` Andrei Rusu de Castro [this message]
2026-11-16 16:41 ` [PATCH 2/2] wifi: iwlwifi: mvm: take the NVM from CSME when it takes the device back Andrei Rusu de Castro
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=bc42d99ffe982a5af20cd7dd7809680b3979789c.1794846777.git.arc@empyreal.works \
--to=arc@empyreal.works \
--cc=ayala.beker@intel.com \
--cc=emmanuel.grumbach@intel.com \
--cc=johannes@sipsolutions.net \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=luciano.coelho@intel.com \
--cc=miriam.rachel.korenblit@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®