]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: iwlwifi: pcie: initiate TOP reset if requested
authorJohannes Berg <johannes.berg@intel.com>
Mon, 9 Jun 2025 18:21:17 +0000 (21:21 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 25 Jun 2025 07:57:32 +0000 (10:57 +0300)
At load time, the firmware may request a TOP reset via
bit 6 in the IPC status register. Handle that and set
TOP reset in that case. Since the init will be retried,
there's no need to do anything else.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250609211928.0875d5f7e066.I62f14008d89416bc4a3a1056e06762561a7fac57@changeid
drivers/net/wireless/intel/iwlwifi/iwl-csr.h
drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/rx.c

index 0fd452cb94ae5eb51705f71bc8bec4cb1cd4f964..f3fa37fee2e497afaa634f30e7529d47e73c77de 100644 (file)
 #define CSR_IPC_STATE_RESET_SW_READY           1
 #define CSR_IPC_STATE_RESET_TOP_READY          2
 #define CSR_IPC_STATE_RESET_TOP_FOLLOWER       3
+#define CSR_IPC_STATE_TOP_RESET_REQ            BIT(6)
 
 #define CSR_IPC_SLEEP_CONTROL  (CSR_BASE + 0x114)
 #define CSR_IPC_SLEEP_CONTROL_SUSPEND  0x3
index 7b56eb78663cd0375d52fcbfb763bbc0e537fae8..0c73b1fe3645d22c1341701877b6ef1e552d4df0 100644 (file)
@@ -1700,6 +1700,15 @@ static void iwl_pcie_irq_handle_error(struct iwl_trans *trans)
                timer_delete(&trans_pcie->txqs.txq[i]->stuck_timer);
        }
 
+       if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_SC) {
+               u32 val = iwl_read32(trans, CSR_IPC_STATE);
+
+               if (val & CSR_IPC_STATE_TOP_RESET_REQ) {
+                       IWL_ERR(trans, "FW requested TOP reset for FSEQ\n");
+                       trans->do_top_reset = 1;
+               }
+       }
+
        /* The STATUS_FW_ERROR bit is set in this function. This must happen
         * before we wake up the command caller, to ensure a proper cleanup. */
        iwl_trans_fw_error(trans, IWL_ERR_TYPE_IRQ);