Skip to content

Commit 8140b07

Browse files
Yang Wangalexdeucher
authored andcommitted
drm/amdgpu: correct mca debugfs dump reg list
avoid driver to touch invalid mca reg. Signed-off-by: Yang Wang <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent d406aec commit 8140b07

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,14 +389,21 @@ static int amdgpu_mca_smu_debug_mode_set(void *data, u64 val)
389389
static void mca_dump_entry(struct seq_file *m, struct mca_bank_entry *entry)
390390
{
391391
int i, idx = entry->idx;
392+
int reg_idx_array[] = {
393+
MCA_REG_IDX_STATUS,
394+
MCA_REG_IDX_ADDR,
395+
MCA_REG_IDX_MISC0,
396+
MCA_REG_IDX_IPID,
397+
MCA_REG_IDX_SYND,
398+
};
392399

393400
seq_printf(m, "mca entry[%d].type: %s\n", idx, entry->type == AMDGPU_MCA_ERROR_TYPE_UE ? "UE" : "CE");
394401
seq_printf(m, "mca entry[%d].ip: %d\n", idx, entry->ip);
395402
seq_printf(m, "mca entry[%d].info: socketid:%d aid:%d hwid:0x%03x mcatype:0x%04x\n",
396403
idx, entry->info.socket_id, entry->info.aid, entry->info.hwid, entry->info.mcatype);
397404

398-
for (i = 0; i < ARRAY_SIZE(entry->regs); i++)
399-
seq_printf(m, "mca entry[%d].regs[%d]: 0x%016llx\n", idx, i, entry->regs[i]);
405+
for (i = 0; i < ARRAY_SIZE(reg_idx_array); i++)
406+
seq_printf(m, "mca entry[%d].regs[%d]: 0x%016llx\n", idx, reg_idx_array[i], entry->regs[reg_idx_array[i]]);
400407
}
401408

402409
static int mca_dump_show(struct seq_file *m, enum amdgpu_mca_error_type type)

0 commit comments

Comments
 (0)