drm/ttm: fix ttm_bo_unreserve
authorChristian König <christian.koenig@amd.com>
Tue, 4 Jun 2019 15:07:10 +0000 (17:07 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 6 Jun 2019 03:18:09 +0000 (22:18 -0500)
Since we now keep BOs on the LRU we need to explicitely remove
them from the LRU now after they are pinned.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
include/drm/ttm/ttm_bo_driver.h

index 9f54cf9c60df2aaa4c2396a6cd7af0aa944aadce..c9b8ba492f2479549938b47622bad1144fdc1221 100644 (file)
@@ -767,14 +767,12 @@ static inline int ttm_bo_reserve_slowpath(struct ttm_buffer_object *bo,
  */
 static inline void ttm_bo_unreserve(struct ttm_buffer_object *bo)
 {
-       if (!(bo->mem.placement & TTM_PL_FLAG_NO_EVICT)) {
-               spin_lock(&bo->bdev->glob->lru_lock);
-               if (list_empty(&bo->lru))
-                       ttm_bo_add_to_lru(bo);
-               else
-                       ttm_bo_move_to_lru_tail(bo, NULL);
-               spin_unlock(&bo->bdev->glob->lru_lock);
-       }
+       spin_lock(&bo->bdev->glob->lru_lock);
+       if (list_empty(&bo->lru))
+               ttm_bo_add_to_lru(bo);
+       else
+               ttm_bo_move_to_lru_tail(bo, NULL);
+       spin_unlock(&bo->bdev->glob->lru_lock);
        reservation_object_unlock(bo->resv);
 }