[PATCH 2/2] wifi: iwlwifi: mvm: take the NVM from CSME when it takes the device back
From: Andrei Rusu de Castro
Date: Mon Nov 16 2026 - 11:42:07 EST
Right after Intel AMT powered the host on, ownership of the device can
still move between CSME and the host. The last iwl_pcie_prepare_card_hw()
of the probe may get the device, clearing csme_own, and CSME take it back
before iwl_mvm_start_get_nvm() starts it. iwl_trans_start_hw() then fails
with -EBUSY after setting csme_own again:
iwlwifi 0000:00:14.3: SAP not supported for this NIC family
iwlwifi 0000:00:14.3: Error while preparing HW: -16
and the op mode never comes up, so the host has no Wi-Fi until it is
rebooted. HW_IF_CONFIG read 0x10080000 at probe in that case (IAMT_UP
without ME_OWN).
When starting the device fails with -EBUSY and csme_own is set, take the
NVM from CSME, as when CSME owned the device at probe; the device itself
is then requested over SAP when the interface comes up.
Fixes: 6d19a5eba5cd ("iwlwifi: integrate with iwlmei")
Signed-off-by: Andrei Rusu de Castro <arc@empyreal.works>
---
drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index 183251457361..7818453db4d4 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -822,9 +822,12 @@ static const struct iwl_fw_runtime_ops iwl_mvm_fwrt_ops = {
static int iwl_mvm_start_get_nvm(struct iwl_mvm *mvm)
{
struct iwl_trans *trans = mvm->trans;
+ bool tried_csme = false;
int ret;
+get_nvm_from_csme:
if (trans->csme_own) {
+ tried_csme = true;
if (WARN(!mvm->mei_registered,
"csme is owner, but we aren't registered to iwlmei\n"))
goto get_nvm_from_fw;
@@ -859,6 +862,16 @@ static int iwl_mvm_start_get_nvm(struct iwl_mvm *mvm)
mutex_unlock(&mvm->mutex);
wiphy_unlock(mvm->hw->wiphy);
rtnl_unlock();
+ /*
+ * Right after CSME (Intel AMT) powered the host on, ownership
+ * can still move between CSME and the host: the probe's last
+ * check may get the device and CSME take it back before we
+ * start it. Then the device is busy and csme_own is set again,
+ * so take the NVM from CSME, as when CSME owned it at probe,
+ * and get the device over SAP when the interface comes up.
+ */
+ if (ret == -EBUSY && trans->csme_own && !tried_csme)
+ goto get_nvm_from_csme;
return ret;
}
--
2.55.0