Commit b2f7a616 authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/ttm: return immediately in case of a signal

When a signal arrives we should return immediately for
handling it and not try other placements first.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Acked-by: default avatarChunming Zhou <david1.zhou@amd.com>
Tested-by: default avatarPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 6e58ab7a
...@@ -979,7 +979,6 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo, ...@@ -979,7 +979,6 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo,
uint32_t cur_flags = 0; uint32_t cur_flags = 0;
bool type_found = false; bool type_found = false;
bool type_ok = false; bool type_ok = false;
bool has_erestartsys = false;
int i, ret; int i, ret;
ret = reservation_object_reserve_shared(bo->resv, 1); ret = reservation_object_reserve_shared(bo->resv, 1);
...@@ -1070,8 +1069,8 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo, ...@@ -1070,8 +1069,8 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo,
mem->placement = cur_flags; mem->placement = cur_flags;
return 0; return 0;
} }
if (ret == -ERESTARTSYS) if (ret && ret != -EBUSY)
has_erestartsys = true; return ret;
} }
if (!type_found) { if (!type_found) {
...@@ -1079,7 +1078,7 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo, ...@@ -1079,7 +1078,7 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo,
return -EINVAL; return -EINVAL;
} }
return (has_erestartsys) ? -ERESTARTSYS : -ENOMEM; return -ENOMEM;
} }
EXPORT_SYMBOL(ttm_bo_mem_space); EXPORT_SYMBOL(ttm_bo_mem_space);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment