drm/amdgpu: Add check to prevent IH overflow
authorDefang Bo <bodefang@126.com>
Tue, 5 Jan 2021 16:06:39 +0000 (00:06 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 5 Jan 2021 20:05:16 +0000 (15:05 -0500)
commite4180c4253f3f2da09047f5139959227f5cf1173
tree6bab3c2cc0e2cceb8db66c7a813c4ab265dbf006
parent88d5cb2517a7190d0f51cabbdb2a1e7594bfec21
drm/amdgpu: Add check to prevent IH overflow

Similar to commit <b82175750131>("drm/amdgpu: fix IH overflow on Vega10 v2").
When an ring buffer overflow happens the appropriate bit is set in the WPTR
register which is also written back to memory. But clearing the bit in the
WPTR doesn't trigger another memory writeback.

So what can happen is that we end up processing the buffer overflow over and
over again because the bit is never cleared. Resulting in a random system
lockup because of an infinite loop in an interrupt handler.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Defang Bo <bodefang@126.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/cz_ih.c
drivers/gpu/drm/amd/amdgpu/iceland_ih.c
drivers/gpu/drm/amd/amdgpu/tonga_ih.c