drm/ttm: return -EBUSY if waiting for busy BO fails
authorFelix Kuehling <Felix.Kuehling@amd.com>
Wed, 26 Jun 2019 06:32:43 +0000 (02:32 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 Jun 2019 16:19:36 +0000 (11:19 -0500)
Returning -EAGAIN prevents ttm_bo_mem_space from trying alternate
placements and can lead to live-locks in amdgpu_cs, retrying
indefinitely and never succeeding.

Fixes: d367bd2a5e2b12 ("drm/ttm: fix busy memory to fail other user v10")
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>
drivers/gpu/drm/ttm/ttm_bo.c

index 6953dd264172c3e5f3bd5aa5a44415252ee157ce..a7fd5a4955c969fe8842ee067ac1b52b62a6567a 100644 (file)
@@ -827,7 +827,7 @@ static int ttm_mem_evict_wait_busy(struct ttm_buffer_object *busy_bo,
        if (!r)
                reservation_object_unlock(busy_bo->resv);
 
-       return r == -EDEADLK ? -EAGAIN : r;
+       return r == -EDEADLK ? -EBUSY : r;
 }
 
 static int ttm_mem_evict_first(struct ttm_bo_device *bdev,