Commit 4a1db2a3 authored by Lijo Lazar's avatar Lijo Lazar Committed by Greg Kroah-Hartman
Browse files

drm/amdgpu: Fix map/unmap queue logic



[ Upstream commit fa317985 ]

In current logic, it calls ring_alloc followed by a ring_test. ring_test
in turn will call another ring_alloc. This is illegal usage as a
ring_alloc is expected to be closed properly with a ring_commit. Change
to commit the map/unmap queue packet first followed by a ring_test. Add a
comment about the usage of ring_test.

Also, reorder the current pre-condition checks of job hang or kiq ring
scheduler not ready. Without them being met, it is not useful to attempt
ring or memory allocations.

Fixes tag refers to the original patch which introduced this issue which
then got carried over into newer code.

Signed-off-by: default avatarLijo Lazar <lijo.lazar@amd.com>
Reviewed-by: default avatarLe Ma <le.ma@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Fixes: 6c10b5cc ("drm/amdgpu: Remove duplicate code in gfx_v8_0.c")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 27eaeebd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment