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

drm/ttm: use reservation_object_trylock in ttm_bo_individualize_resv v2

Fixes a false positive from might_sleep(). The reservation object is freshly
initialized, so nobody else can hold the mutex but the function is
called from atomic context.

v2: Correctly invert the check as well.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d5de797f
...@@ -403,7 +403,7 @@ static int ttm_bo_individualize_resv(struct ttm_buffer_object *bo) ...@@ -403,7 +403,7 @@ static int ttm_bo_individualize_resv(struct ttm_buffer_object *bo)
return 0; return 0;
reservation_object_init(&bo->ttm_resv); reservation_object_init(&bo->ttm_resv);
BUG_ON(reservation_object_lock(&bo->ttm_resv, NULL)); BUG_ON(!reservation_object_trylock(&bo->ttm_resv));
r = reservation_object_copy_fences(&bo->ttm_resv, bo->resv); r = reservation_object_copy_fences(&bo->ttm_resv, bo->resv);
if (r) { if (r) {
......
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