From patchwork Wed Nov 8 14:59:33 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: 10048627 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 1354260381 for ; Wed, 8 Nov 2017 14:59:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08E6D28EF7 for ; Wed, 8 Nov 2017 14:59:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F10912933A; Wed, 8 Nov 2017 14:59:45 +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 78B5D29348 for ; Wed, 8 Nov 2017 14:59:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 89B886E25C; Wed, 8 Nov 2017 14:59:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id D06506E25C; Wed, 8 Nov 2017 14:59:41 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id p75so11056304wmg.3; Wed, 08 Nov 2017 06:59:41 -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=KiTWrTBmKFswB3psGwZxB8hIJVyESPS72QBeUDbFkPkvsqwWiKja7IGctdgnM76cHe aFTnTujiC+L+d9DeCikmjr1KIXFbI3bVCeQQ/YPGKLK2FirdIUgb5Ue+B2q/GUnW4EU7 i+kHL7HmHvkznu34KsCdjqZqpXf6dcs7rHlRmfJHuApolCQqb9PyedZXWbx2VE6Iuldl Jt/EBr4hHyT7Tzm520e9J59sRPVkTitpdvVIs5VeTaTlBJdU+6U6sJUb5pUXFPz/OUEx SucQY2xIp1go7HVmIR3xpsmVOqYDg72byVxg9qlzYKH2WWr0HZxXtu+SXjThZvnPHQAe clXg== 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=jstpFz8pFRnQha1dO3p5WbDYD2mIhVYXnRu/81bX/Mar5FejRD8J+Kk23BLIxnw10n LpDFZ7aKYpFoOly/cA3jH6ivqsiV9TRv/rTH7Y86xROuoy9O5pEA72ZFNpXY0YzeoUEH mkDOTpkKTVsojADVn0BqkC1DVcwgY7uh1bRZb591ToIWtsMgwuE6zYI1h8hvpK+gGh7Y 0c9wuqIfsWecQzdtPPpy69WE5b9kefE9gMJrBf3Z8WyPvR435kzPLqdnZG2HHM0oEMAa Kg2N2lf+WsOwnKB6T6rvnpQiBKC03ZzENBqOlE+PW2TaAWr77kJCLaAmC/DY1BsFajaj 4xKA== X-Gm-Message-State: AJaThX6EbmWSRMKhf7tL7+4VV1/M3ReFQ2dsc4TVviTwstHopG6zGx5t Q857HYl/iAKGnz4PVQGJ0E4= X-Google-Smtp-Source: ABhQp+Ql/3iStSAYVIsZ4YbJ7gNcbn217dhpdZscVhVHbrhYZww03DmwnUoz21E5JK7K2F5XQGOgSA== X-Received: by 10.28.133.12 with SMTP id h12mr724801wmd.148.1510153180303; Wed, 08 Nov 2017 06:59:40 -0800 (PST) Received: from localhost.localdomain ([2a02:908:1251:7981:c04d:fe7d:a3de:74ad]) by smtp.gmail.com with ESMTPSA id 61sm801346wrl.0.2017.11.08.06.59.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Nov 2017 06:59:39 -0800 (PST) From: "=?UTF-8?q?Christian=20K=C3=B6nig?=" X-Google-Original-From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: Hongbo.He@amd.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 1/4] drm/ttm: move unlocking out of ttm_bo_cleanup_memtype_use Date: Wed, 8 Nov 2017 15:59:33 +0100 Message-Id: <20171108145936.27071-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; }