Commit 8ecc3928 authored by Johannes Berg's avatar Johannes Berg Committed by Miri Korenblit
Browse files

wifi: iwlwifi: pcie: initiate TOP reset if requested



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: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250609211928.0875d5f7e066.I62f14008d89416bc4a3a1056e06762561a7fac57@changeid
parent c8a00a6e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -113,6 +113,7 @@
#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
+9 −0
Original line number Diff line number Diff line
@@ -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);