Commit d3561e0e authored by Shahar S Matityahu's avatar Shahar S Matityahu Committed by Luca Coelho

iwlwifi: wrt: add to dump number of lmacs, lmac1 and umac error id

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: default avatarShahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent aba1e632
...@@ -828,7 +828,13 @@ _iwl_fw_error_dump(struct iwl_fw_runtime *fwrt, ...@@ -828,7 +828,13 @@ _iwl_fw_error_dump(struct iwl_fw_runtime *fwrt,
sizeof(dump_info->dev_human_readable) - 1); sizeof(dump_info->dev_human_readable) - 1);
strncpy(dump_info->bus_human_readable, fwrt->dev->bus->name, strncpy(dump_info->bus_human_readable, fwrt->dev->bus->name,
sizeof(dump_info->bus_human_readable) - 1); 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); dump_data = iwl_fw_error_next_data(dump_data);
} }
......
...@@ -102,7 +102,10 @@ static inline void iwl_fw_free_dump_desc(struct iwl_fw_runtime *fwrt) ...@@ -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) if (fwrt->dump.desc != &iwl_dump_desc_assert)
kfree(fwrt->dump.desc); kfree(fwrt->dump.desc);
fwrt->dump.desc = NULL; 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); void iwl_fw_error_dump(struct iwl_fw_runtime *fwrt);
......
...@@ -180,6 +180,8 @@ enum iwl_fw_error_dump_family { ...@@ -180,6 +180,8 @@ enum iwl_fw_error_dump_family {
IWL_FW_ERROR_DUMP_FAMILY_8 = 8, IWL_FW_ERROR_DUMP_FAMILY_8 = 8,
}; };
#define MAX_NUM_LMAC 2
/** /**
* struct iwl_fw_error_dump_info - info on the device / firmware * struct iwl_fw_error_dump_info - info on the device / firmware
* @device_family: the family of the device (7 / 8) * @device_family: the family of the device (7 / 8)
...@@ -187,7 +189,10 @@ enum iwl_fw_error_dump_family { ...@@ -187,7 +189,10 @@ enum iwl_fw_error_dump_family {
* @fw_human_readable: human readable FW version * @fw_human_readable: human readable FW version
* @dev_human_readable: name of the device * @dev_human_readable: name of the device
* @bus_human_readable: name of the bus used * @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 * if the dump collection was not initiated by an assert, the value is 0
*/ */
struct iwl_fw_error_dump_info { struct iwl_fw_error_dump_info {
...@@ -196,7 +201,9 @@ 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 fw_human_readable[FW_VER_HUMAN_READABLE_SZ];
u8 dev_human_readable[64]; u8 dev_human_readable[64];
u8 bus_human_readable[8]; u8 bus_human_readable[8];
__le32 rt_status; u8 num_of_lmacs;
__le32 umac_err_id;
__le32 lmac_err_id[MAX_NUM_LMAC];
} __packed; } __packed;
/** /**
......
...@@ -142,7 +142,8 @@ struct iwl_fw_runtime { ...@@ -142,7 +142,8 @@ struct iwl_fw_runtime {
u32 *d3_debug_data; u32 *d3_debug_data;
struct iwl_fw_ini_active_regs active_regs[IWL_FW_INI_MAX_REGION_ID]; 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]; 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; } dump;
#ifdef CONFIG_IWLWIFI_DEBUGFS #ifdef CONFIG_IWLWIFI_DEBUGFS
struct { struct {
......
...@@ -463,6 +463,9 @@ static void iwl_mvm_dump_umac_error_log(struct iwl_mvm *mvm) ...@@ -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, iwl_trans_read_mem_bytes(trans, mvm->umac_error_event_table, &table,
sizeof(table)); sizeof(table));
if (table.valid)
mvm->fwrt.dump.umac_err_id = table.error_id;
if (ERROR_START_OFFSET <= table.valid * ERROR_ELEM_SIZE) { if (ERROR_START_OFFSET <= table.valid * ERROR_ELEM_SIZE) {
IWL_ERR(trans, "Start IWL Error Log Dump:\n"); IWL_ERR(trans, "Start IWL Error Log Dump:\n");
IWL_ERR(trans, "Status: 0x%08lX, count: %d\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) ...@@ -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); 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_trans *trans = mvm->trans;
struct iwl_error_event_table table; 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 (mvm->fwrt.cur_fw_img == IWL_UCODE_INIT) {
if (!base) if (!base)
...@@ -541,7 +544,7 @@ static void iwl_mvm_dump_lmac_error_log(struct iwl_mvm *mvm, u32 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)); iwl_trans_read_mem_bytes(trans, base, &table, sizeof(table));
if (table.valid) 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) { if (ERROR_START_OFFSET <= table.valid * ERROR_ELEM_SIZE) {
IWL_ERR(trans, "Start IWL Error Log Dump:\n"); IWL_ERR(trans, "Start IWL Error Log Dump:\n");
...@@ -598,10 +601,10 @@ void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm) ...@@ -598,10 +601,10 @@ void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm)
return; 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]) 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); iwl_mvm_dump_umac_error_log(mvm);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment