Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: correct mca ipid die/socket/addr decode

correct mca ipid die/socket/addr decode

v2: squash in fix from Yang

Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Yang Wang and committed by
Alex Deucher
ef71bb41 efb91fea

+13 -5
+13 -5
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
··· 2392 2392 2393 2393 static void mca_bank_entry_info_decode(struct mca_bank_entry *entry, struct mca_bank_info *info) 2394 2394 { 2395 - uint64_t ipid = entry->regs[MCA_REG_IDX_IPID]; 2396 - uint32_t insthi; 2395 + u64 ipid = entry->regs[MCA_REG_IDX_IPID]; 2396 + u32 instidhi, instid; 2397 2397 2398 2398 /* NOTE: All MCA IPID register share the same format, 2399 2399 * so the driver can share the MCMP1 register header file. ··· 2402 2402 info->hwid = REG_GET_FIELD(ipid, MCMP1_IPIDT0, HardwareID); 2403 2403 info->mcatype = REG_GET_FIELD(ipid, MCMP1_IPIDT0, McaType); 2404 2404 2405 - insthi = REG_GET_FIELD(ipid, MCMP1_IPIDT0, InstanceIdHi); 2406 - info->aid = ((insthi >> 2) & 0x03); 2407 - info->socket_id = insthi & 0x03; 2405 + /* 2406 + * Unfied DieID Format: SAASS. A:AID, S:Socket. 2407 + * Unfied DieID[4] = InstanceId[0] 2408 + * Unfied DieID[0:3] = InstanceIdHi[0:3] 2409 + */ 2410 + instidhi = REG_GET_FIELD(ipid, MCMP1_IPIDT0, InstanceIdHi); 2411 + instid = REG_GET_FIELD(ipid, MCMP1_IPIDT0, InstanceIdLo); 2412 + info->aid = ((instidhi >> 2) & 0x03); 2413 + info->socket_id = ((instid & 0x1) << 2) | (instidhi & 0x03); 2408 2414 } 2409 2415 2410 2416 static int mca_bank_read_reg(struct amdgpu_device *adev, enum amdgpu_mca_error_type type, ··· 2584 2578 uint32_t instlo; 2585 2579 2586 2580 instlo = REG_GET_FIELD(entry->regs[MCA_REG_IDX_IPID], MCMP1_IPIDT0, InstanceIdLo); 2581 + instlo &= GENMASK(31, 1); 2587 2582 switch (instlo) { 2588 2583 case 0x36430400: /* SMNAID XCD 0 */ 2589 2584 case 0x38430400: /* SMNAID XCD 1 */ ··· 2603 2596 uint32_t errcode, instlo; 2604 2597 2605 2598 instlo = REG_GET_FIELD(entry->regs[MCA_REG_IDX_IPID], MCMP1_IPIDT0, InstanceIdLo); 2599 + instlo &= GENMASK(31, 1); 2606 2600 if (instlo != 0x03b30400) 2607 2601 return false; 2608 2602