From: Christian König Date: Thu, 17 Aug 2017 10:23:51 +0000 (+0200) Subject: drm/ttm: use reservation_object_trylock in ttm_bo_individualize_resv v2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=df9bcb0652bbfde1b37bda98f0ad1fa7fda46d67;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 58e7fcea620e..cba11f13d994 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -403,7 +403,7 @@ static int ttm_bo_individualize_resv(struct ttm_buffer_object *bo) return 0; 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); if (r) {