Skip to content

Commit

Permalink
drm/ttm: Fix a theoretical race
Browse files Browse the repository at this point in the history
The ttm_mem_evict_first function could theoretically drop the
lru lock without retrying if a reservation from off the LRU list
ended up waiting.
However, since currently there are no users that could cause a wait
in that situation so this is not suitable for stable

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Thomas Hellstrom authored and Dave Airlie committed Oct 23, 2012
1 parent a16d4f8 commit 7bc17a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/ttm/ttm_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,11 +817,11 @@ static int ttm_mem_evict_first(struct ttm_bo_device *bdev,
goto retry;
}

ret = ttm_bo_reserve_locked(bo, false, no_wait_reserve, false, 0);
ret = ttm_bo_reserve_locked(bo, false, true, false, 0);

if (unlikely(ret == -EBUSY)) {
spin_unlock(&glob->lru_lock);
if (likely(!no_wait_gpu))
if (likely(!no_wait_reserve))
ret = ttm_bo_wait_unreserved(bo, interruptible);

kref_put(&bo->list_kref, ttm_bo_release_list);
Expand Down

0 comments on commit 7bc17a7

Please sign in to comment.