iwlwifi: mvm: add IML/ROM information to the assertion dumps
authorLuca Coelho <luciano.coelho@intel.com>
Fri, 24 Apr 2020 16:47:01 +0000 (19:47 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 8 May 2020 06:51:55 +0000 (09:51 +0300)
Dump the IML/ROM error code and data, which are read from some
registers, when printing an assertion dump.  This makes it easier to
debug IML/ROM errors.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20200424194456.a522161a7372.I2a65ee35a5e0242f8a0e106f126356dff81ef59d@changeid
drivers/net/wireless/intel/iwlwifi/mvm/utils.c

index ee8f152..be57b83 100644 (file)
@@ -586,6 +586,23 @@ static void iwl_mvm_dump_lmac_error_log(struct iwl_mvm *mvm, u8 lmac_num)
        IWL_ERR(mvm, "0x%08X | flow_handler\n", table.flow_handler);
 }
 
+static void iwl_mvm_dump_iml_error_log(struct iwl_mvm *mvm)
+{
+       struct iwl_trans *trans = mvm->trans;
+       u32 error;
+
+       error = iwl_read_umac_prph(trans, UMAG_SB_CPU_2_STATUS);
+
+       IWL_ERR(trans, "IML/ROM dump:\n");
+
+       if (error & 0xFFFF0000)
+               IWL_ERR(trans, "IML/ROM SYSASSERT:\n");
+
+       IWL_ERR(mvm, "0x%08X | IML/ROM error/state\n", error);
+       IWL_ERR(mvm, "0x%08X | IML/ROM data1\n",
+               iwl_read_umac_prph(trans, UMAG_SB_CPU_1_STATUS));
+}
+
 void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm)
 {
        if (!test_bit(STATUS_DEVICE_ENABLED, &mvm->trans->status)) {
@@ -601,6 +618,9 @@ void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm)
 
        iwl_mvm_dump_umac_error_log(mvm);
 
+       if (mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210)
+               iwl_mvm_dump_iml_error_log(mvm);
+
        iwl_fw_error_print_fseq_regs(&mvm->fwrt);
 }