]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: fix a potential deadlock in amdgpu_bo_create_restricted()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 9 Feb 2017 10:33:36 +0000 (11:33 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 9 Feb 2017 16:28:24 +0000 (11:28 -0500)
commit68bb01e1e9469f084ce1728f4d3ab3d4ecf9b89f
tree05fbb3d3fd00c13e13acca4a08c11de583cbe840
parentd8d8a5d5ad9e15d5948f03f961926562f95df104
drm/amdgpu: fix a potential deadlock in amdgpu_bo_create_restricted()

When ttm_bo_init() fails, the reservation mutex should be unlocked.

In debug build, the kernel reported "possible recursive locking
detected" in this codepath. For debugging purposes, I also added
a "WARN_ON(ww_mutex_is_locked())" when ttm_bo_init() fails and the
mutex was locked as expected.

This should fix (random) GPU hangs. The easy way to reproduce the
issue is to change the "Super Sampling" option from 1.0 to 2.0 in
Hitman. It will create a huge buffer, evict a bunch of buffers
(around ~5k) and deadlock.

This regression has been introduced pretty recently.

v2: only release the mutex if resv is NULL

Fixes: 12a852219583 ("drm/amdgpu: improve AMDGPU_GEM_CREATE_VRAM_CLEARED handling (v2)")
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c