Skip to contentSkip to conversation

drm/amdgpu: Generate BP threshold exceed CPER once threshold exceeded

PATCH In review Xiang Liu 2 participants 2 messages Aug 5, 2025

Subsystems (3)
lore
Share & tools
lore

Xiang Liu

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Generate BP threshold exceed CPER once threshold exceeded

The bad pages threshold exceed CPER should be generated once threshold exceeded, no matter the bad_page_threshold setted or not.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 4 ++++
 drivers/gpu/drm/amd/pm/amdgpu_dpm.c            | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +4 -0
index b66e09ad0cc9..e3d7071b5853 100644
@@ -763,6 +763,10 @@ amdgpu_ras_eeprom_update_header(struct amdgpu_ras_eeprom_control *control)
 		dev_warn(adev->dev,
 			"Saved bad pages %d reaches threshold value %d\n",
 			control->ras_num_bad_pages, ras->bad_page_cnt_threshold);
+
+		if (adev->cper.enabled && amdgpu_cper_generate_bp_threshold_record(adev))
+			dev_warn(adev->dev, "fail to generate bad page threshold cper records\n");
+
 		if ((amdgpu_bad_page_threshold != -1) &&
 		    (amdgpu_bad_page_threshold != -2)) {
 			control->tbl_hdr.header = RAS_TABLE_HDR_BAD;
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +0 -4
index 0d94cc04e322..607e3048eacb 100644
@@ -764,10 +764,6 @@ int amdgpu_dpm_send_rma_reason(struct amdgpu_device *adev)
 	ret = smu_send_rma_reason(smu);
 	mutex_unlock(&adev->pm.mutex);
 
-	if (adev->cper.enabled)
-		if (amdgpu_cper_generate_bp_threshold_record(adev))
-			dev_warn(adev->dev, "fail to generate bad page threshold cper records\n");
-
 	return ret;
 }
 
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: Tuesday, August 5, 2025 11:44
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Liu, Xiang(Dean) <[email protected]>
Subject: [PATCH] drm/amdgpu: Generate BP threshold exceed CPER once threshold exceeded

The bad pages threshold exceed CPER should be generated once threshold exceeded, no matter the bad_page_threshold setted or not.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 4 ++++
 drivers/gpu/drm/amd/pm/amdgpu_dpm.c            | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c +5 -0
index b66e09ad0cc9..e3d7071b5853 100644
@@ -763,6 +763,10 @@ amdgpu_ras_eeprom_update_header(struct amdgpu_ras_eeprom_control *control)
                dev_warn(adev->dev,
                        "Saved bad pages %d reaches threshold value %d\n",
                        control->ras_num_bad_pages, ras->bad_page_cnt_threshold);
+
+               if (adev->cper.enabled && amdgpu_cper_generate_bp_threshold_record(adev))
+                       dev_warn(adev->dev, "fail to generate bad page threshold cper
+records\n");
+
                if ((amdgpu_bad_page_threshold != -1) &&
                    (amdgpu_bad_page_threshold != -2)) {
                        control->tbl_hdr.header = RAS_TABLE_HDR_BAD; diff --git a/drivers/gpu/drm/amd/pm/amdgpu_dpm.c b/drivers/gpu/drm/amd/pm/amdgpu_dpm.c

index 0d94cc04e322..607e3048eacb 100644

drivers/gpu/drm/amd/pm/amdgpu_dpm.c +0 -4
@@ -764,10 +764,6 @@ int amdgpu_dpm_send_rma_reason(struct amdgpu_device *adev)
        ret = smu_send_rma_reason(smu);
        mutex_unlock(&adev->pm.mutex);
 
-       if (adev->cper.enabled)
-               if (amdgpu_cper_generate_bp_threshold_record(adev))
-                       dev_warn(adev->dev, "fail to generate bad page threshold cper records\n");
-
        return ret;
 }
 

--
2.34.1