[PATCH] drm/amdgpu: Reset RAS table if header is invalid
Zhou1, Tao
Tao.Zhou1 at amd.com
Tue Apr 8 07:15:51 UTC 2025
[AMD Official Use Only - AMD Internal Distribution Only]
Reviewed-by: Tao Zhou <tao.zhou1 at amd.com>
> -----Original Message-----
> From: Lazar, Lijo <Lijo.Lazar at amd.com>
> Sent: Tuesday, April 8, 2025 2:14 PM
> To: amd-gfx at lists.freedesktop.org; Lazar, Lijo <Lijo.Lazar at amd.com>
> Cc: Zhang, Hawking <Hawking.Zhang at amd.com>; Deucher, Alexander
> <Alexander.Deucher at amd.com>; Li, Candice <Candice.Li at amd.com>; Zhou1, Tao
> <Tao.Zhou1 at amd.com>
> Subject: [PATCH] drm/amdgpu: Reset RAS table if header is invalid
>
> If a valid header is not found during RAS eeprom init, consider it as new and reset
> RAS table info.
>
> Signed-off-by: Lijo Lazar <lijo.lazar at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
> index e979a6086178..bb767fc20242 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
> @@ -1392,6 +1392,12 @@ int amdgpu_ras_eeprom_init(struct
> amdgpu_ras_eeprom_control *control)
>
> __decode_table_header_from_buf(hdr, buf);
>
> + if (hdr->header != RAS_TABLE_HDR_VAL &&
> + hdr->header != RAS_TABLE_HDR_BAD) {
> + dev_info(adev->dev, "Creating a new EEPROM table");
> + return amdgpu_ras_eeprom_reset_table(control);
> + }
> +
> switch (hdr->version) {
> case RAS_TABLE_VER_V2_1:
> case RAS_TABLE_VER_V3:
> @@ -1510,10 +1516,6 @@ int amdgpu_ras_eeprom_check(struct
> amdgpu_ras_eeprom_control *control)
> "User defined threshold is set, runtime service
> will be halt when threshold is reached\n");
> }
> }
> - } else {
> - DRM_INFO("Creating a new EEPROM table");
> -
> - res = amdgpu_ras_eeprom_reset_table(control);
> }
>
> return res < 0 ? res : 0;
> --
> 2.25.1
More information about the amd-gfx
mailing list