drm/amdgpu: return error when eeprom checksum failed
authorJinzhou Su <jinzhou.su@amd.com>
Mon, 2 Dec 2024 03:14:40 +0000 (11:14 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 10 Dec 2024 15:26:50 +0000 (10:26 -0500)
Return eeprom table checksum error result, otherwise
it might be overwritten by next call.

V2: replace DRM_ERROR with dev_err

Signed-off-by: Jinzhou Su <jinzhou.su@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c

index f4a9e15389ae24a0b5f5852d9eb08fc8dea63548..bd8acb55f76f2b6eb0adaf3962bd9d0d6d13aae2 100644 (file)
@@ -1412,9 +1412,11 @@ int amdgpu_ras_eeprom_init(struct amdgpu_ras_eeprom_control *control)
                }
 
                res = __verify_ras_table_checksum(control);
-               if (res)
-                       DRM_ERROR("RAS Table incorrect checksum or error:%d\n",
+               if (res) {
+                       dev_err(adev->dev, "RAS Table incorrect checksum or error:%d\n",
                                  res);
+                       return -EINVAL;
+               }
                if (ras->bad_page_cnt_threshold > control->ras_num_recs) {
                        /* This means that, the threshold was increased since
                         * the last time the system was booted, and now,