drm/amdgpu: Fix CPER error handling on VFs
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix CPER error handling on VFs
From: Tony Yi <[email protected]>
CPER read will loop infinitely if an error is encountered and the more bit is set. Add error checks to break upon failure.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +5 -3
@@ -1378,14 +1378,16 @@ amdgpu_virt_write_cpers_to_ring(struct amdgpu_device *adev, used_size = host_telemetry->header.used_size;if (used_size > (AMD_SRIOV_RAS_TELEMETRY_SIZE_KB <<10 )) -return 0 ; +return -EINVAL ; cper_dump =kmemdup (&host_telemetry->body.cper_dump, used_size,GFP_KERNEL );if (!cper_dump)return -ENOMEM ; -if (checksum !=amd_sriov_msg_checksum (cper_dump, used_size,0 ,0 )) +if (checksum !=amd_sriov_msg_checksum (cper_dump, used_size,0 ,0 )) { + ret = -EINVAL ; goto out; + } *more = cper_dump->more;
@@ -1434,7 +1436,7 @@ static int amdgpu_virt_req_ras_cper_dump_internal(struct amdgpu_device *adev) adev, virt->fw_reserve.ras_telemetry, &more); else ret =0 ; - }while (more); + }while (more && !ret);return ret; }
Signature · 1 line
2.34.1
[AMD Official Use Only - AMD Internal Distribution Only]
Regards,
Hawking
-----Original Message-----
From: Skvortsov, Victor <[email protected]>
Sent: Wednesday, April 2, 2025 04:44
To: [email protected]
Cc: Luo, Zhigang <[email protected]>; Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; Zhao, Victor <[email protected]>; Yi, Tony <[email protected]>; Skvortsov, Victor <[email protected]>
Subject: [PATCH] drm/amdgpu: Fix CPER error handling on VFs
From: Tony Yi <[email protected]>
CPER read will loop infinitely if an error is encountered and the more bit is set. Add error checks to break upon failure.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +5 -3
@@ -1378,14 +1378,16 @@ amdgpu_virt_write_cpers_to_ring(struct amdgpu_device *adev, used_size = host_telemetry->header.used_size;if (used_size > (AMD_SRIOV_RAS_TELEMETRY_SIZE_KB <<10 )) -return 0 ; +return -EINVAL ; cper_dump =kmemdup (&host_telemetry->body.cper_dump, used_size,GFP_KERNEL );if (!cper_dump)return -ENOMEM ; -if (checksum !=amd_sriov_msg_checksum (cper_dump, used_size,0 ,0 )) +if (checksum !=amd_sriov_msg_checksum (cper_dump, used_size,0 ,0 )) { + ret = -EINVAL ; goto out; + } *more = cper_dump->more;
@@ -1434,7 +1436,7 @@ static int amdgpu_virt_req_ras_cper_dump_internal(struct amdgpu_device *adev) adev, virt->fw_reserve.ras_telemetry, &more); else ret =0 ; - }while (more); + }while (more && !ret);return ret; }
--
2.34.1
Yi, Tony
Reviewed-by Hawking Zhang[AMD Official Use Only - AMD Internal Distribution Only]
________________________________
From: Zhang, Hawking <[email protected]>
Sent: Wednesday, April 2, 2025 12:23 AM
To: Skvortsov, Victor <[email protected]>; [email protected] <[email protected]>
Cc: Luo, Zhigang <[email protected]>; Zhou1, Tao <[email protected]>; Zhao, Victor <[email protected]>; Yi, Tony <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: Fix CPER error handling on VFs
[AMD Official Use Only - AMD Internal Distribution Only]
Regards,
Hawking
-----Original Message-----
From: Skvortsov, Victor <[email protected]>
Sent: Wednesday, April 2, 2025 04:44
To: [email protected]
Cc: Luo, Zhigang <[email protected]>; Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; Zhao, Victor <[email protected]>; Yi, Tony <[email protected]>; Skvortsov, Victor <[email protected]>
Subject: [PATCH] drm/amdgpu: Fix CPER error handling on VFs
From: Tony Yi <[email protected]>
CPER read will loop infinitely if an error is encountered and the more bit is set. Add error checks to break upon failure.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +5 -3
@@ -1378,14 +1378,16 @@ amdgpu_virt_write_cpers_to_ring(struct amdgpu_device *adev, used_size = host_telemetry->header.used_size;if (used_size > (AMD_SRIOV_RAS_TELEMETRY_SIZE_KB <<10 )) -return 0 ; +return -EINVAL ; cper_dump =kmemdup (&host_telemetry->body.cper_dump, used_size,GFP_KERNEL );if (!cper_dump)return -ENOMEM ; -if (checksum !=amd_sriov_msg_checksum (cper_dump, used_size,0 ,0 )) +if (checksum !=amd_sriov_msg_checksum (cper_dump, used_size,0 ,0 )) { + ret = -EINVAL ; goto out; + } *more = cper_dump->more;
@@ -1434,7 +1436,7 @@ static int amdgpu_virt_req_ras_cper_dump_internal(struct amdgpu_device *adev) adev, virt->fw_reserve.ras_telemetry, &more); else ret =0 ; - }while (more); + }while (more && !ret);return ret; }
--
2.34.1