OSDN Git Service

iwlwifi: wrt: add to dump number of lmacs, lmac1 and umac error id
authorShahar S Matityahu <shahar.s.matityahu@intel.com>
Thu, 13 Sep 2018 11:52:59 +0000 (14:52 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 25 Jan 2019 18:57:18 +0000 (20:57 +0200)
Add to the dump the number of lmacs, the error id of the umac
and the error id of lmac1, if supported.
In case the reason for the dump trigger is not an assert
the error id is zero.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/dbg.c
drivers/net/wireless/intel/iwlwifi/fw/dbg.h
drivers/net/wireless/intel/iwlwifi/fw/error-dump.h
drivers/net/wireless/intel/iwlwifi/fw/runtime.h
drivers/net/wireless/intel/iwlwifi/mvm/utils.c

index 2a19b17..d4d6544 100644 (file)
@@ -828,7 +828,13 @@ _iwl_fw_error_dump(struct iwl_fw_runtime *fwrt,
                        sizeof(dump_info->dev_human_readable) - 1);
                strncpy(dump_info->bus_human_readable, fwrt->dev->bus->name,
                        sizeof(dump_info->bus_human_readable) - 1);
-               dump_info->rt_status = cpu_to_le32(fwrt->dump.rt_status);
+               dump_info->num_of_lmacs = fwrt->smem_cfg.num_lmacs;
+               dump_info->lmac_err_id[0] =
+                       cpu_to_le32(fwrt->dump.lmac_err_id[0]);
+               if (fwrt->smem_cfg.num_lmacs > 1)
+                       dump_info->lmac_err_id[1] =
+                               cpu_to_le32(fwrt->dump.lmac_err_id[1]);
+               dump_info->umac_err_id = cpu_to_le32(fwrt->dump.umac_err_id);
 
                dump_data = iwl_fw_error_next_data(dump_data);
        }
index 6aabbdd..40dcc3d 100644 (file)
@@ -102,7 +102,10 @@ static inline void iwl_fw_free_dump_desc(struct iwl_fw_runtime *fwrt)
        if (fwrt->dump.desc != &iwl_dump_desc_assert)
                kfree(fwrt->dump.desc);
        fwrt->dump.desc = NULL;
-       fwrt->dump.rt_status = 0;
+       fwrt->dump.lmac_err_id[0] = 0;
+       if (fwrt->smem_cfg.num_lmacs > 1)
+               fwrt->dump.lmac_err_id[1] = 0;
+       fwrt->dump.umac_err_id = 0;
 }
 
 void iwl_fw_error_dump(struct iwl_fw_runtime *fwrt);
index 65faecf..c02425a 100644 (file)
@@ -180,6 +180,8 @@ enum iwl_fw_error_dump_family {
        IWL_FW_ERROR_DUMP_FAMILY_8 = 8,
 };
 
+#define MAX_NUM_LMAC 2
+
 /**
  * struct iwl_fw_error_dump_info - info on the device / firmware
  * @device_family: the family of the device (7 / 8)
@@ -187,7 +189,10 @@ enum iwl_fw_error_dump_family {
  * @fw_human_readable: human readable FW version
  * @dev_human_readable: name of the device
  * @bus_human_readable: name of the bus used
- * @rt_status: the error_id/rt_status that that triggered the latest dump
+ * @num_of_lmacs: the number of lmacs
+ * @lmac_err_id: the lmac 0/1 error_id/rt_status that triggered the latest dump
+ *     if the dump collection was not initiated by an assert, the value is 0
+ * @umac_err_id: the umac error_id/rt_status that triggered the latest dump
  *     if the dump collection was not initiated by an assert, the value is 0
  */
 struct iwl_fw_error_dump_info {
@@ -196,7 +201,9 @@ struct iwl_fw_error_dump_info {
        u8 fw_human_readable[FW_VER_HUMAN_READABLE_SZ];
        u8 dev_human_readable[64];
        u8 bus_human_readable[8];
-       __le32 rt_status;
+       u8 num_of_lmacs;
+       __le32 umac_err_id;
+       __le32 lmac_err_id[MAX_NUM_LMAC];
 } __packed;
 
 /**
index 4f7090f..a0fcbb2 100644 (file)
@@ -142,7 +142,8 @@ struct iwl_fw_runtime {
                u32 *d3_debug_data;
                struct iwl_fw_ini_active_regs active_regs[IWL_FW_INI_MAX_REGION_ID];
                struct iwl_fw_ini_active_triggers active_trigs[IWL_FW_TRIGGER_ID_NUM];
-               u32 rt_status;
+               u32 lmac_err_id[MAX_NUM_LMAC];
+               u32 umac_err_id;
        } dump;
 #ifdef CONFIG_IWLWIFI_DEBUGFS
        struct {
index d116c6a..e8659bf 100644 (file)
@@ -463,6 +463,9 @@ static void iwl_mvm_dump_umac_error_log(struct iwl_mvm *mvm)
        iwl_trans_read_mem_bytes(trans, mvm->umac_error_event_table, &table,
                                 sizeof(table));
 
+       if (table.valid)
+               mvm->fwrt.dump.umac_err_id = table.error_id;
+
        if (ERROR_START_OFFSET <= table.valid * ERROR_ELEM_SIZE) {
                IWL_ERR(trans, "Start IWL Error Log Dump:\n");
                IWL_ERR(trans, "Status: 0x%08lX, count: %d\n",
@@ -486,11 +489,11 @@ static void iwl_mvm_dump_umac_error_log(struct iwl_mvm *mvm)
        IWL_ERR(mvm, "0x%08X | isr status reg\n", table.nic_isr_pref);
 }
 
-static void iwl_mvm_dump_lmac_error_log(struct iwl_mvm *mvm, u32 base)
+static void iwl_mvm_dump_lmac_error_log(struct iwl_mvm *mvm, u8 lmac_num)
 {
        struct iwl_trans *trans = mvm->trans;
        struct iwl_error_event_table table;
-       u32 val;
+       u32 val, base = mvm->error_event_table[lmac_num];
 
        if (mvm->fwrt.cur_fw_img == IWL_UCODE_INIT) {
                if (!base)
@@ -541,7 +544,7 @@ static void iwl_mvm_dump_lmac_error_log(struct iwl_mvm *mvm, u32 base)
        iwl_trans_read_mem_bytes(trans, base, &table, sizeof(table));
 
        if (table.valid)
-               mvm->fwrt.dump.rt_status = table.error_id;
+               mvm->fwrt.dump.lmac_err_id[lmac_num] = table.error_id;
 
        if (ERROR_START_OFFSET <= table.valid * ERROR_ELEM_SIZE) {
                IWL_ERR(trans, "Start IWL Error Log Dump:\n");
@@ -598,10 +601,10 @@ void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm)
                return;
        }
 
-       iwl_mvm_dump_lmac_error_log(mvm, mvm->error_event_table[0]);
+       iwl_mvm_dump_lmac_error_log(mvm, 0);
 
        if (mvm->error_event_table[1])
-               iwl_mvm_dump_lmac_error_log(mvm, mvm->error_event_table[1]);
+               iwl_mvm_dump_lmac_error_log(mvm, 1);
 
        iwl_mvm_dump_umac_error_log(mvm);
 }