Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09052863 authored by Christian König's avatar Christian König Committed by Alex Deucher
Browse files

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: default avatarChristian König <christian.koenig@amd.com>
Reviewed-and-Tested-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Reviewed-by: default avatarRoger He <Hongbo.He@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 31b8adab
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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;