aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
diff options
context:
space:
mode:
authorTao Zhou <[email protected]>2024-11-28 10:30:36 +0000
committerAlex Deucher <[email protected]>2024-12-10 15:26:51 +0000
commit1f06e7f344c4ac66184ee6bb49d83b8c413306ca (patch)
tree705e24c07603f5fa8640549ff81bdcc6de842a2f /drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
parentdrm/amd: Add the capability to mark certain firmware as "required" (diff)
downloadkernel-1f06e7f344c4ac66184ee6bb49d83b8c413306ca.tar.gz
kernel-1f06e7f344c4ac66184ee6bb49d83b8c413306ca.zip
drm/amdgpu: split ras_eeprom_init into init and check functions
Init function is for ras table header read and check function is responsible for the validation of the header. Call them in different stages. Signed-off-by: Tao Zhou <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 66e80fcc2899..738a645867ef 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -3015,9 +3015,20 @@ static int amdgpu_ras_load_bad_pages(struct amdgpu_device *adev)
control->rec_type = AMDGPU_RAS_EEPROM_REC_MCA;
}
+ ret = amdgpu_ras_eeprom_check(control);
+ if (ret)
+ goto out;
+
+ /* HW not usable */
+ if (amdgpu_ras_is_rma(adev)) {
+ ret = -EHWPOISON;
+ goto out;
+ }
+
ret = amdgpu_ras_add_bad_pages(adev, bps, control->ras_num_recs, true);
}
+out:
kfree(bps);
return ret;
}
@@ -3408,10 +3419,6 @@ int amdgpu_ras_init_badpage_info(struct amdgpu_device *adev)
if (ret)
return ret;
- /* HW not usable */
- if (amdgpu_ras_is_rma(adev))
- return -EHWPOISON;
-
if (!adev->umc.ras || !adev->umc.ras->convert_ras_err_addr)
control->rec_type = AMDGPU_RAS_EEPROM_REC_PA;