Skip to content

Commit 57417e1

Browse files
jmberg-intellucacoelho
authored andcommitted
iwlwifi: dump both TCM error tables if present
There can be two TCMs in a given device, dump both of the error tables if present. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20211210110539.887cba319301.Ifdc3f617f7e0e3e39c90e8c208e60f11b3bb9404@changeid Signed-off-by: Luca Coelho <[email protected]>
1 parent 9ae4862 commit 57417e1

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

drivers/net/wireless/intel/iwlwifi/fw/dump.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -259,21 +259,21 @@ struct iwl_tcm_error_event_table {
259259
u32 reserved[4];
260260
} __packed; /* TCM_LOG_ERROR_TABLE_API_S_VER_1 */
261261

262-
static void iwl_fwrt_dump_tcm_error_log(struct iwl_fw_runtime *fwrt)
262+
static void iwl_fwrt_dump_tcm_error_log(struct iwl_fw_runtime *fwrt, int idx)
263263
{
264264
struct iwl_trans *trans = fwrt->trans;
265265
struct iwl_tcm_error_event_table table = {};
266-
u32 base = fwrt->trans->dbg.tcm_error_event_table;
266+
u32 base = fwrt->trans->dbg.tcm_error_event_table[idx];
267267
int i;
268+
u32 flag = idx ? IWL_ERROR_EVENT_TABLE_TCM2 :
269+
IWL_ERROR_EVENT_TABLE_TCM1;
268270

269-
if (!base ||
270-
!(fwrt->trans->dbg.error_event_table_tlv_status &
271-
IWL_ERROR_EVENT_TABLE_TCM))
271+
if (!base || !(fwrt->trans->dbg.error_event_table_tlv_status & flag))
272272
return;
273273

274274
iwl_trans_read_mem_bytes(trans, base, &table, sizeof(table));
275275

276-
IWL_ERR(fwrt, "TCM status:\n");
276+
IWL_ERR(fwrt, "TCM%d status:\n", idx + 1);
277277
IWL_ERR(fwrt, "0x%08X | error ID\n", table.error_id);
278278
IWL_ERR(fwrt, "0x%08X | tcm branchlink2\n", table.blink2);
279279
IWL_ERR(fwrt, "0x%08X | tcm interruptlink1\n", table.ilink1);
@@ -375,7 +375,8 @@ void iwl_fwrt_dump_error_logs(struct iwl_fw_runtime *fwrt)
375375
if (fwrt->trans->dbg.lmac_error_event_table[1])
376376
iwl_fwrt_dump_lmac_error_log(fwrt, 1);
377377
iwl_fwrt_dump_umac_error_log(fwrt);
378-
iwl_fwrt_dump_tcm_error_log(fwrt);
378+
iwl_fwrt_dump_tcm_error_log(fwrt, 0);
379+
iwl_fwrt_dump_tcm_error_log(fwrt, 1);
379380
iwl_fwrt_dump_iml_error_log(fwrt);
380381
iwl_fwrt_dump_fseq_regs(fwrt);
381382

drivers/net/wireless/intel/iwlwifi/iwl-drv.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,9 +622,14 @@ static void iwl_parse_dbg_tlv_assert_tables(struct iwl_drv *drv,
622622
IWL_ERROR_EVENT_TABLE_LMAC2;
623623
break;
624624
case IWL_FW_INI_REGION_DEVICE_MEMORY_SUBTYPE_TCM_1_ERROR_TABLE:
625-
drv->trans->dbg.tcm_error_event_table = addr;
625+
drv->trans->dbg.tcm_error_event_table[0] = addr;
626626
drv->trans->dbg.error_event_table_tlv_status |=
627-
IWL_ERROR_EVENT_TABLE_TCM;
627+
IWL_ERROR_EVENT_TABLE_TCM1;
628+
break;
629+
case IWL_FW_INI_REGION_DEVICE_MEMORY_SUBTYPE_TCM_2_ERROR_TABLE:
630+
drv->trans->dbg.tcm_error_event_table[1] = addr;
631+
drv->trans->dbg.error_event_table_tlv_status |=
632+
IWL_ERROR_EVENT_TABLE_TCM2;
628633
break;
629634
default:
630635
break;

drivers/net/wireless/intel/iwlwifi/iwl-trans.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ enum iwl_error_event_table_status {
193193
IWL_ERROR_EVENT_TABLE_LMAC1 = BIT(0),
194194
IWL_ERROR_EVENT_TABLE_LMAC2 = BIT(1),
195195
IWL_ERROR_EVENT_TABLE_UMAC = BIT(2),
196-
IWL_ERROR_EVENT_TABLE_TCM = BIT(3),
196+
IWL_ERROR_EVENT_TABLE_TCM1 = BIT(3),
197+
IWL_ERROR_EVENT_TABLE_TCM2 = BIT(4),
197198
};
198199

199200
/**
@@ -728,7 +729,7 @@ struct iwl_self_init_dram {
728729
* @trigger_tlv: array of pointers to triggers TLVs for debug
729730
* @lmac_error_event_table: addrs of lmacs error tables
730731
* @umac_error_event_table: addr of umac error table
731-
* @tcm_error_event_table: address of TCM error table
732+
* @tcm_error_event_table: address(es) of TCM error table(s)
732733
* @error_event_table_tlv_status: bitmap that indicates what error table
733734
* pointers was recevied via TLV. uses enum &iwl_error_event_table_status
734735
* @internal_ini_cfg: internal debug cfg state. Uses &enum iwl_ini_cfg_state
@@ -755,7 +756,7 @@ struct iwl_trans_debug {
755756

756757
u32 lmac_error_event_table[2];
757758
u32 umac_error_event_table;
758-
u32 tcm_error_event_table;
759+
u32 tcm_error_event_table[2];
759760
unsigned int error_event_table_tlv_status;
760761

761762
enum iwl_ini_cfg_state internal_ini_cfg;

0 commit comments

Comments
 (0)