dev_warn(adev->dev, "RAS records:%u exceeds 90%% of threshold:%d",
control->ras_num_bad_pages,
ras->bad_page_cnt_threshold);
- if (amdgpu_bad_page_threshold != 0 &&
- control->ras_num_bad_pages >= ras->bad_page_cnt_threshold)
- amdgpu_dpm_send_rma_reason(adev);
-
} else if (hdr->header == RAS_TABLE_HDR_BAD &&
amdgpu_bad_page_threshold != 0) {
if (hdr->version >= RAS_TABLE_VER_V2_1) {
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");
+ }
+ }
+}
int amdgpu_ras_eeprom_update_record_num(struct amdgpu_ras_eeprom_control *control);
+void amdgpu_ras_check_bad_page_status(struct amdgpu_device *adev);
+
extern const struct file_operations amdgpu_ras_debugfs_eeprom_size_ops;
extern const struct file_operations amdgpu_ras_debugfs_eeprom_table_ops;