[02/10] drm/ttm: return immediately in case of a signal

Submitted by =?UTF-8?q?Christian=20K=C3=B6nig?= on May 22, 2019, 12:59 p.m.

Details

Message ID 20190522125947.4592-2-christian.koenig@amd.com
State New
Headers show
Series "Series without cover letter" ( rev: 2 1 ) in DRI devel

Not browsing as part of any series.

Commit Message

=?UTF-8?q?Christian=20K=C3=B6nig?= May 22, 2019, 12:59 p.m.
When a signal arrives we should return immediately for
handling it and not try other placements first.

Signed-off-by: Christian K├Ânig <christian.koenig@amd.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 2845fceb2fbd..4336893cb35e 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -978,7 +978,6 @@  int ttm_bo_mem_space(struct ttm_buffer_object *bo,
 	uint32_t cur_flags = 0;
 	bool type_found = false;
 	bool type_ok = false;
-	bool has_erestartsys = false;
 	int i, ret;
 
 	ret = reservation_object_reserve_shared(bo->resv, 1);
@@ -1069,8 +1068,8 @@  int ttm_bo_mem_space(struct ttm_buffer_object *bo,
 			mem->placement = cur_flags;
 			return 0;
 		}
-		if (ret == -ERESTARTSYS)
-			has_erestartsys = true;
+		if (ret && ret != -EBUSY)
+			return ret;
 	}
 
 	if (!type_found) {
@@ -1078,7 +1077,7 @@  int ttm_bo_mem_space(struct ttm_buffer_object *bo,
 		return -EINVAL;
 	}
 
-	return (has_erestartsys) ? -ERESTARTSYS : -ENOMEM;
+	return -ENOMEM;
 }
 EXPORT_SYMBOL(ttm_bo_mem_space);