]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/amdgpu: Force signal hw_fences that are embedded in non-sched jobs
authorYuBiao Wang <YuBiao.Wang@amd.com>
Thu, 16 Mar 2023 03:30:32 +0000 (11:30 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Apr 2023 10:35:11 +0000 (12:35 +0200)
commitb4efb6af93ca755f5469114adfd7f26bb944962c
tree4c1e1a12f5ea36752c02557b79aebf7ec3fed33c
parentdf27bcd0cf2b365d78f3875404de2ffb98651768
drm/amdgpu: Force signal hw_fences that are embedded in non-sched jobs

[ Upstream commit 033c56474acf567a450f8bafca50e0b610f2b716 ]

[Why]
For engines not supporting soft reset, i.e. VCN, there will be a failed
ib test before mode 1 reset during asic reset. The fences in this case
are never signaled and next time when we try to free the sa_bo, kernel
will hang.

[How]
During pre_asic_reset, driver will clear job fences and afterwards the
fences' refcount will be reduced to 1. For drm_sched_jobs it will be
released in job_free_cb, and for non-sched jobs like ib_test, it's meant
to be released in sa_bo_free but only when the fences are signaled. So
we have to force signal the non_sched bad job's fence during
pre_asic_reset or the clear is not complete.

Signed-off-by: YuBiao Wang <YuBiao.Wang@amd.com>
Acked-by: Luben Tuikov <luben.tuikov@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c