]> www.infradead.org Git - users/dwmw2/linux.git/commit
drm/amdgpu: Reset CP_VMID_PREEMPT after trailing fence signaled
authorJiadong Zhu <Jiadong.Zhu@amd.com>
Wed, 24 May 2023 03:42:19 +0000 (11:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Jun 2023 14:02:11 +0000 (16:02 +0200)
commit3be6bfdf9f074cbe608c59cc2bfea0703ed2f993
tree9bee5d47643b158c2c1d8375abe907fbaf495985
parent4e33d192a1b146c9d6fb729941ec3165bad3b99a
drm/amdgpu: Reset CP_VMID_PREEMPT after trailing fence signaled

commit 1dbcf770cc2d15baf8a1e8174d6fd014a68b45ca upstream.

When MEC executes unmap_queue for mid command buffer preemption, it will
kick the write pointer of the gfx ring, set CP_VMID_PREEMPT to trigger the
preemption and wait for CP_VMID_PREEMPT becomes zero after the preemption
done. There is a race condition that PFP may excute the resetting command
before MEC set CP_VMID_PREEMPT. As a result, hang happens as
CP_VMID_PREEMPT is always 0xffff.

To avoid this, we send resetting CP_VMID_PREEMPT command after the trailing
fence is siganled and update gfx write pointer explicitly.

Signed-off-by: Jiadong Zhu <Jiadong.Zhu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 6.3.x
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2535
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c