From patchwork Thu Nov 9 08:59:03 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: 10050513 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 42E9C60381 for ; Thu, 9 Nov 2017 08:59:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EECC2ABF3 for ; Thu, 9 Nov 2017 08:59:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 240F82ABF5; Thu, 9 Nov 2017 08:59:19 +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.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 A86672ABF7 for ; Thu, 9 Nov 2017 08:59:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 23D496E87B; Thu, 9 Nov 2017 08:59:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3F4BC6E879; Thu, 9 Nov 2017 08:59:16 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id p75so15467690wmg.3; Thu, 09 Nov 2017 00:59:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=sQ3C03bRIgNWF4TDcPrRplMZWAn8h0Apps6Dte4MdEU=; b=emyp+9dt/URH4jmVqPw+kpylbby3yOWkLNQWToHO5idhsM4lD1iGq26ul15jsxrLwQ oGjyyz85gn5xELW7tb4AfvRGlTAc+mG+oBwgSv6NMQlje+YbE2dAbU5ZBR0707JPQ89o a773R5LKN1/mdIGxOg5wsHQLJHx4XjVRzeGRizCrAv4baMELha79Ul0ONQ1/cknJNG2S /udviR3DFAgbUEodeTb5S6tLEDlptqGfXYO9WEe/WAkqxEJkm8kg7Q8KjP/JSe1e5u11 903l9O17NbkKHCWh7UTMDSo8MJ5VjjjGZuLuAabSOIwixbidjkoKYgF0wjJOyDTMRyYG cWeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=sQ3C03bRIgNWF4TDcPrRplMZWAn8h0Apps6Dte4MdEU=; b=BsfxiUVENn20t0YQbyxzeyQewfvdUBAfgh7v3Pjev5RRdRRSVrNTcalAFeMFiuxglB 8bbqt1oK7amdOG73TC42LgDP4gemFmVhuCnrV8hVIqpbILovg81y8VYE4Ww1eKDyFYD4 EU4ZtoQeNKpcMXDzJq00t9LZFnLPgkIJ96R/AXt35uKbRu0F+xB8W65LzIm9Lbjl/VJP pUMVvqhsOOVzD0BSeWaFgfufR2T3iLbfT2ULUn9T0i6St7/w28Pnn+CV9fw0+MvcfdlS XLX1PCFVGLQY4d5+LxJnCT1Je80o31scUkNNPFKCzUpD456aFuQwvZjl8qWm0bTMZtcz 95uQ== X-Gm-Message-State: AJaThX6w9ECWYfFkA07ULE8NqbB/JwUXQtMRbg4mw1Chdd3DaK0qENcO LzYrOq8PfVNlGjulO49EYbLMQg== X-Google-Smtp-Source: ABhQp+TQ1TgpR0a0mhh+b3jHQRtFlhnZFsij4mOw314F4iW6GSayt6MaO4uebLHfvN+24Pzhgy0M7g== X-Received: by 10.28.21.4 with SMTP id 4mr2224956wmv.84.1510217954581; Thu, 09 Nov 2017 00:59:14 -0800 (PST) Received: from localhost.localdomain ([2a02:908:1251:7981:61f0:1658:ce3b:16a3]) by smtp.gmail.com with ESMTPSA id 69sm8893723wmp.37.2017.11.09.00.59.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2017 00:59:12 -0800 (PST) From: "=?UTF-8?q?Christian=20K=C3=B6nig?=" X-Google-Original-From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Hongbo.He@amd.com, michel@daenzer.net Subject: [PATCH 1/7] drm/ttm: move unlocking out of ttm_bo_cleanup_memtype_use Date: Thu, 9 Nov 2017 09:59:03 +0100 Message-Id: <20171109085909.1653-1-christian.koenig@amd.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 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 Needed for the next patch and makes the code quite a bit easier to understand. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index c088703777e2..9905cf41cba6 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -390,8 +390,6 @@ static void ttm_bo_cleanup_memtype_use(struct ttm_buffer_object *bo) ttm_tt_destroy(bo->ttm); bo->ttm = NULL; ttm_bo_mem_put(bo, &bo->mem); - - ww_mutex_unlock (&bo->resv->lock); } static int ttm_bo_individualize_resv(struct ttm_buffer_object *bo) @@ -457,6 +455,7 @@ static void ttm_bo_cleanup_refs_or_queue(struct ttm_buffer_object *bo) reservation_object_unlock(&bo->ttm_resv); ttm_bo_cleanup_memtype_use(bo); + reservation_object_unlock(bo->resv); return; } @@ -559,6 +558,7 @@ static int ttm_bo_cleanup_refs_and_unlock(struct ttm_buffer_object *bo, spin_unlock(&glob->lru_lock); ttm_bo_cleanup_memtype_use(bo); + reservation_object_unlock(bo->resv); return 0; }