From patchwork Tue Feb 20 12:58:27 2018 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: 10230007 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 74B6E602A7 for ; Tue, 20 Feb 2018 12:58:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65B2728464 for ; Tue, 20 Feb 2018 12:58:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A87A285B7; Tue, 20 Feb 2018 12:58:44 +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 19B9B28464 for ; Tue, 20 Feb 2018 12:58:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5211B6E3FA; Tue, 20 Feb 2018 12:58:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 211E86E3ED; Tue, 20 Feb 2018 12:58:33 +0000 (UTC) Received: by mail-wr0-x243.google.com with SMTP id 34so14075213wre.13; Tue, 20 Feb 2018 04:58:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Ts8fdtE5WNgdK9AJbN6f9RDHdLgf+QkPea9o1TSDPq8=; b=EgYR9a2vEX4OkPAH4AM8TxJAlPbC7aMs3nFsPSzQDgWrophpeUjxEqB4kpILAWcswk Ipzr95XwebbV9nfpA+7lddekAkTT99wMbedoD32CxcQ4SuZk3bqhXp7rMHyHxNUUmxqo H1qBRmFwByW55Kp44sXpHTiZPWTyZdXDiCxf+NfhUBQKn7vGom/GZO9vl1QvkEb2sqA9 nANJyf6KFbIgiaQoyWYKJcUZQMDpP/8/ZRZjJhA/hFRXGRfY0JDgCbfyMSS6HbTJkC87 nQdlx/Zu/FHXcNmsz1DDDIoeyBvkg6atIvFcES76AeCMl3sTm2V6kzb1a1l9WSwyvbGV h0XA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ts8fdtE5WNgdK9AJbN6f9RDHdLgf+QkPea9o1TSDPq8=; b=tL8RrCEdsB8qdq0An0Rgj+348p0Vt2q+/yH9cl9JJEbThw+HPNy6EtMyOBYqAZ5amd 1DT2rK3ns0IHHkREJ4a+BAI1V8vNVVOxupQDNtmKMcfMa0dFSuWO8D28h79hx+mcYY/H FckI9+an45DEdgcxji+n7r/cbXEe1MHgmw8/bVSFmaiqXCsGuAJ6w9wyTutrekCc+LJL 4pjvd5KCDJfctESNxQW6qM9W0pWEe6NemS+rlRu+AH1VU3jeTlgQ3mk30YxXeOrud/fH Oe1lU75OySYfBkFSNoAJDA8frHb/eiaH5J5RwDZmHLKCiYjFedWAQP/S+gw3BvpOsuUS G2ww== X-Gm-Message-State: APf1xPDKGMoaDBTpGj8VkjkQsSV/+503Ze5ubm6lU1+OunUvBbFeVenN //nx+aDDpRLr+zbRbKZnUR1dcg== X-Google-Smtp-Source: AH8x227dJJy8+7laUPe+FrUiYkRjM9KaoZdR4kB6R9AnIeA2ny2Y6LpzaUR30hVqBHqIqKypr93NQA== X-Received: by 10.223.184.26 with SMTP id h26mr10344298wrf.65.1519131511680; Tue, 20 Feb 2018 04:58:31 -0800 (PST) Received: from baker.fritz.box ([2a02:908:1251:8fc0:7008:2819:5c1a:982d]) by smtp.gmail.com with ESMTPSA id 32sm24179502wrm.14.2018.02.20.04.58.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Feb 2018 04:58:31 -0800 (PST) From: "=?UTF-8?q?Christian=20K=C3=B6nig?=" X-Google-Original-From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] drm/amdgpu: use new ww_mutex_is_owned_by function Date: Tue, 20 Feb 2018 13:58:27 +0100 Message-Id: <20180220125829.27060-2-christian.koenig@amd.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180220125829.27060-1-christian.koenig@amd.com> References: <20180220125829.27060-1-christian.koenig@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 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 Instead of accessing ww_mutex internals directly use the provided function to check if the ww_mutex was indeed locked by the current command submission. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index eaa3cb0c3ad1..6db26a3144dc 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -1594,7 +1594,7 @@ int amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser, *map = mapping; /* Double check that the BO is reserved by this CS */ - if (READ_ONCE((*bo)->tbo.resv->lock.ctx) != &parser->ticket) + if (!ww_mutex_is_owned_by(&(*bo)->tbo.resv->lock, &parser->ticket)) return -EINVAL; if (!((*bo)->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS)) {