aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorFelix Kuehling <Felix.Kuehling@amd.com>2018-01-17 23:54:07 -0500
committerAlex Deucher <alexander.deucher@amd.com>2018-01-18 16:14:32 -0500
commitad76c65ec39f20139885ecd4e5830f2c2a643dcb (patch)
treeab56885a0f12f07714e80e92a2c1b040cd93ecdd /drivers/gpu
parentdrm/ttm: Don't add swapped BOs to swap-LRU list (diff)
downloadlinux-dev-ad76c65ec39f20139885ecd4e5830f2c2a643dcb.tar.xz
linux-dev-ad76c65ec39f20139885ecd4e5830f2c2a643dcb.zip
drm/ttm: Don't unreserve swapped BOs that were previously reserved
If ttm_bo_swapout doesn't own the lock, don't release it. Someone else probably depends on it still being locked. Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 62518b669ca1..893003fc76a1 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -1780,8 +1780,8 @@ out:
* Unreserve without putting on LRU to avoid swapping out an
* already swapped buffer.
*/
-
- reservation_object_unlock(bo->resv);
+ if (locked)
+ reservation_object_unlock(bo->resv);
kref_put(&bo->list_kref, ttm_bo_release_list);
return ret;
}