summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
index 64dd7a81bff5..44fba4b6aa92 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
@@ -508,6 +508,9 @@ int amdgpu_ras_eeprom_reset_table(struct amdgpu_ras_eeprom_control *control)
control->bad_channel_bitmap = 0;
amdgpu_dpm_send_hbm_bad_channel_flag(adev, control->bad_channel_bitmap);
con->update_channel_flag = false;
+ /* there is no record on eeprom now, clear the counter */
+ if (con->eh_data)
+ con->eh_data->count_saved = 0;
amdgpu_ras_debugfs_set_ret_size(control);
@@ -1701,10 +1704,12 @@ int amdgpu_ras_eeprom_check(struct amdgpu_ras_eeprom_control *control)
}
res = __verify_ras_table_checksum(control);
- if (res)
+ if (res) {
dev_err(adev->dev,
"RAS table incorrect checksum or error:%d\n",
res);
+ return -EINVAL;
+ }
/* Warn if we are at 90% of the threshold or above
*/
@@ -1928,3 +1933,26 @@ int amdgpu_ras_smu_erase_ras_table(struct amdgpu_device *adev,
result);
return -EOPNOTSUPP;
}
+
+void amdgpu_ras_check_bad_page_status(struct amdgpu_device *adev)
+{
+ struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);
+ struct amdgpu_ras_eeprom_control *control = ras ? &ras->eeprom_control : NULL;
+
+ if (!control || amdgpu_bad_page_threshold == 0)
+ return;
+
+ if (control->ras_num_bad_pages >= ras->bad_page_cnt_threshold) {
+ if (amdgpu_dpm_send_rma_reason(adev))
+ dev_warn(adev->dev, "Unable to send out-of-band RMA CPER");
+ else
+ dev_dbg(adev->dev, "Sent out-of-band RMA CPER");
+
+ if (adev->cper.enabled && !amdgpu_uniras_enabled(adev)) {
+ if (amdgpu_cper_generate_bp_threshold_record(adev))
+ dev_warn(adev->dev, "Unable to send in-band RMA CPER");
+ else
+ dev_dbg(adev->dev, "Sent in-band RMA CPER");
+ }
+ }
+}