diff options
author | 2017-11-15 11:05:17 +0100 | |
---|---|---|
committer | 2017-12-06 12:47:53 -0500 | |
commit | 090528639321ab09c150603c0da3c38c26aa5ea9 (patch) | |
tree | 303bd957f6d24cfd9938d8d334793a9858e506af | |
parent | drm/amdgpu: require a root bus window above 4GB for BAR resize (diff) | |
download | wireguard-linux-090528639321ab09c150603c0da3c38c26aa5ea9.tar.xz wireguard-linux-090528639321ab09c150603c0da3c38c26aa5ea9.zip |
drm/ttm: fix ttm_mem_evict_first once more
The code path isn't hit at the moment, but we need to take the lock to
add the BO back to the LRU.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Roger He <Hongbo.He@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 07d9c6e5b6ca..7c1eac4f4b4b 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -793,10 +793,13 @@ static int ttm_mem_evict_first(struct ttm_bo_device *bdev, spin_unlock(&glob->lru_lock); ret = ttm_bo_evict(bo, interruptible, no_wait_gpu); - if (locked) + if (locked) { ttm_bo_unreserve(bo); - else + } else { + spin_lock(&glob->lru_lock); ttm_bo_add_to_lru(bo); + spin_unlock(&glob->lru_lock); + } kref_put(&bo->list_kref, ttm_bo_release_list); return ret; |