From patchwork Fri Aug 18 13:31:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 9908741 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 71B7360386 for ; Fri, 18 Aug 2017 13:31:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6835B28CC8 for ; Fri, 18 Aug 2017 13:31:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D1D728CDE; Fri, 18 Aug 2017 13:31:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A9BEF28CC8 for ; Fri, 18 Aug 2017 13:31:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EADFC6E060; Fri, 18 Aug 2017 13:31:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from vsmx011.vodafonemail.xion.oxcs.net (vsmx011.vodafonemail.xion.oxcs.net [153.92.174.89]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2ABEB6E05F; Fri, 18 Aug 2017 13:31:44 +0000 (UTC) Received: from vsmx003.vodafonemail.xion.oxcs.net (unknown [192.168.75.197]) by mta-5-out.mta.xion.oxcs.net (Postfix) with ESMTP id 372D33E0458; Fri, 18 Aug 2017 13:31:43 +0000 (UTC) Received: from localhost.localdomain (aftr-109-91-38-107.unity-media.net [109.91.38.107]) by mta-7-out.mta.xion.oxcs.net (Postfix) with ESMTPA id B7D1D300098; Fri, 18 Aug 2017 13:31:38 +0000 (UTC) From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH] drm/ttm: use reservation_object_trylock in ttm_bo_individualize_resv v2 Date: Fri, 18 Aug 2017 15:31:37 +0200 Message-Id: <1503063097-2542-1-git-send-email-deathsimple@vodafone.de> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-VADE-STATUS: LEGIT X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Christian König 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 --- drivers/gpu/drm/ttm/ttm_bo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 58e7fce..cba11f1 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) {