Skip to contentSkip to conversation

drm/amdgpu: Update IPID value for bad page threshold CPER

PATCH In review Xiang Liu 2 participants 2 messages Jul 23, 2025 – Jul 24, 2025

Subsystems (2)
lore
Share & tools
lore

Xiang Liu

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Update IPID value for bad page threshold CPER

Update the IPID register value for bad page threshold CPER according to the latest definition.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c +6 -2
index 15dde1f50328..d16267868adb 100644
@@ -206,6 +206,7 @@ int amdgpu_cper_entry_fill_bad_page_threshold_section(struct amdgpu_device *adev
 {
 	struct cper_sec_desc *section_desc;
 	struct cper_sec_nonstd_err *section;
+	uint32_t socket_id;
 
 	section_desc = (struct cper_sec_desc *)((uint8_t *)hdr + SEC_DESC_OFFSET(idx));
 	section = (struct cper_sec_nonstd_err *)((uint8_t *)hdr +
@@ -224,6 +225,9 @@ int amdgpu_cper_entry_fill_bad_page_threshold_section(struct amdgpu_device *adev
 	section->ctx.reg_arr_size = sizeof(section->ctx.reg_dump);
 
 	/* Hardcoded Reg dump for bad page threshold CPER */
+	socket_id = (adev->smuio.funcs && adev->smuio.funcs->get_socket_id) ?
+				adev->smuio.funcs->get_socket_id(adev) :
+				0;
 	section->ctx.reg_dump[CPER_ACA_REG_CTL_LO]    = 0x1;
 	section->ctx.reg_dump[CPER_ACA_REG_CTL_HI]    = 0x0;
 	section->ctx.reg_dump[CPER_ACA_REG_STATUS_LO] = 0x137;
@@ -234,8 +238,8 @@ int amdgpu_cper_entry_fill_bad_page_threshold_section(struct amdgpu_device *adev
 	section->ctx.reg_dump[CPER_ACA_REG_MISC0_HI]  = 0x0;
 	section->ctx.reg_dump[CPER_ACA_REG_CONFIG_LO] = 0x2;
 	section->ctx.reg_dump[CPER_ACA_REG_CONFIG_HI] = 0x1ff;
-	section->ctx.reg_dump[CPER_ACA_REG_IPID_LO]   = 0x0;
-	section->ctx.reg_dump[CPER_ACA_REG_IPID_HI]   = 0x96;
+	section->ctx.reg_dump[CPER_ACA_REG_IPID_LO]   = (socket_id / 4) & 0x01;
+	section->ctx.reg_dump[CPER_ACA_REG_IPID_HI]   = 0x096 | (((socket_id % 4) & 0x3) << 12);
 	section->ctx.reg_dump[CPER_ACA_REG_SYND_LO]   = 0x0;
 	section->ctx.reg_dump[CPER_ACA_REG_SYND_HI]   = 0x0;
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Regards,
Hawking
-----Original Message-----
From: Liu, Xiang(Dean) <[email protected]>
Sent: Wednesday, July 23, 2025 14:41
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Liu, Xiang(Dean) <[email protected]>
Subject: [PATCH] drm/amdgpu: Update IPID value for bad page threshold CPER

Update the IPID register value for bad page threshold CPER according to the latest definition.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c +1 -0
index 15dde1f50328..d16267868adb 100644
@@ -206,6 +206,7 @@ int amdgpu_cper_entry_fill_bad_page_threshold_section(struct amdgpu_device *adev  {
        struct cper_sec_desc *section_desc;
        struct cper_sec_nonstd_err *section;
+       uint32_t socket_id;
 
        section_desc = (struct cper_sec_desc *)((uint8_t *)hdr + SEC_DESC_OFFSET(idx));
        section = (struct cper_sec_nonstd_err *)((uint8_t *)hdr + @@ -224,6 +225,9 @@ int amdgpu_cper_entry_fill_bad_page_threshold_section(struct amdgpu_device *adev
        section->ctx.reg_arr_size = sizeof(section->ctx.reg_dump);
        /* Hardcoded Reg dump for bad page threshold CPER */
+       socket_id = (adev->smuio.funcs && adev->smuio.funcs->get_socket_id) ?
+                               adev->smuio.funcs->get_socket_id(adev) :
+                               0;
        section->ctx.reg_dump[CPER_ACA_REG_CTL_LO]    = 0x1;
        section->ctx.reg_dump[CPER_ACA_REG_CTL_HI]    = 0x0;
        section->ctx.reg_dump[CPER_ACA_REG_STATUS_LO] = 0x137; @@ -234,8 +238,8 @@ int amdgpu_cper_entry_fill_bad_page_threshold_section(struct amdgpu_device *adev
        section->ctx.reg_dump[CPER_ACA_REG_MISC0_HI]  = 0x0;
        section->ctx.reg_dump[CPER_ACA_REG_CONFIG_LO] = 0x2;
        section->ctx.reg_dump[CPER_ACA_REG_CONFIG_HI] = 0x1ff;
-       section->ctx.reg_dump[CPER_ACA_REG_IPID_LO]   = 0x0;
-       section->ctx.reg_dump[CPER_ACA_REG_IPID_HI]   = 0x96;
+       section->ctx.reg_dump[CPER_ACA_REG_IPID_LO]   = (socket_id / 4) & 0x01;
+       section->ctx.reg_dump[CPER_ACA_REG_IPID_HI]   = 0x096 | (((socket_id % 4) & 0x3) << 12);
        section->ctx.reg_dump[CPER_ACA_REG_SYND_LO]   = 0x0;
        section->ctx.reg_dump[CPER_ACA_REG_SYND_HI]   = 0x0;

--
2.34.1