drm/amd/ras: reset CPER ring on corrupt entry size
authorXiang Liu <xiang.liu@amd.com>
Mon, 11 May 2026 07:48:55 +0000 (15:48 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 May 2026 15:49:25 +0000 (11:49 -0400)
commit4d695e66d7027a0c78302e47ac76293675fbbb4d
tree58111813cde3d8d235f01cdf91a8bc8e595068ae
parent5c02889ea22575c3bcfdf212e65fac316cbc6c6a
drm/amd/ras: reset CPER ring on corrupt entry size

When CPER ring overflow handling advances the read pointer, it trusts the
parsed entry size from the current ring contents. Corrupt CPER data can
produce an entry size that does not advance rptr after dword conversion
and pointer masking.

In that case the recovery loop keeps testing the same location while
holding the CPER ring mutex. This can hang the worker that is writing the
next CPER record.

Detect a no-progress rptr update and reset the CPER ring to an empty
state instead. This drops the corrupt contents and lets the writer leave
the recovery path without spinning.

Signed-off-by: Xiang Liu <xiang.liu@amd.com>
Reviewed-by: Stanley.Yang <Stanley.Yang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c