Received: by 10.223.185.116 with SMTP id b49csp608879wrg; Tue, 20 Feb 2018 05:02:03 -0800 (PST) X-Google-Smtp-Source: AH8x227QiyUa1oOKHuqavD9eQnWVzbf2M2rr/Ao/lQyj0FtvQk86h42WmmtvA/y6dfp6oLIN1yTC X-Received: by 10.99.64.196 with SMTP id n187mr15025398pga.147.1519131723384; Tue, 20 Feb 2018 05:02:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519131723; cv=none; d=google.com; s=arc-20160816; b=B3mwBhA6ltEkC9cUSJpWCQfXS6XzpA1JBFE7DRhkVCCZR1qffRmx7+ue2F4aqvr4PY c1BKO7pob9moT8XS01IdhWxZUdNGNZYLM2LwhsYlVGvAWZ9I9bNuWI8720IFymDYJdeN Exc5WY26DVS8NAcZ1d41XVCaU413NELNJ/JwhW3bri9eAxIfQDtqW99lijMKkdJFRKqt B4Gf2FI477W0pdemkcb4JSet3CnBzuFAxxDNsbHbNXSvz8gh87/kN25uhtwXfW3f6Yv/ D5otWtYc9jN50J73kaB9Y9Ctk7ec/j2o3Arwl14u9kJ8JyHuEUqQLGI5F+dix27PVBQA OVHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature:arc-authentication-results; bh=Ts8fdtE5WNgdK9AJbN6f9RDHdLgf+QkPea9o1TSDPq8=; b=ep42Eld2xkZOfKw2MCRYTAL6we78CHfJPW09MhlZ/vQq9ozjFL7oUE2X/3WHjuuYLc crcpaoxdTJbLP3vwTmCwxry/2Deabi9D7QjW0ZX1RqwOFcG/5hbPA0xbDcoK+gWUb+ZX UhW3+ruDh0tsUWjJHlwWyuxsaZMCy+OcoXCwSsw6h1MFQcDfe6zTqb39PgsCCDPsETU0 /1VTCi4MLQua4ighnOl1YNCGMoydRkCEplpCFca4XjPTpE6TQ6xHt8LgZwcR7cS8mfAW hVBfkkc/aBA6n5q//xzk3hzwX3nGVB3YWHd9b+vo+iftY3PW4g65eaU2O3hntfcuk4/b AJ+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EgYR9a2v; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t21-v6si5527463plj.269.2018.02.20.05.01.42; Tue, 20 Feb 2018 05:02:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EgYR9a2v; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751998AbeBTM73 (ORCPT + 99 others); Tue, 20 Feb 2018 07:59:29 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:36526 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751754AbeBTM6c (ORCPT ); Tue, 20 Feb 2018 07:58:32 -0500 Received: by mail-wr0-f196.google.com with SMTP id u15so14119733wrg.3 for ; Tue, 20 Feb 2018 04:58:32 -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=IFAxpv2jErglTYIGrfv8jhRP1GTvAi1demHuw9aH8TrOBNLbhLE6eD2UEY5zzOBWEh 2SbnC7xI6Z2Jefo2Fze5YnNyherRUARae6yMmO6BzeRXCBZcDAsyGrts3RvHdgv6GEhz rx5wANqpi9VxaFHLoUc8sRqMDSXfILCLnUBBKtGvjnFqsuNE1CLMMcW2O+3w+acIEPmj LgvAmrKWJEQ0XI47vgoOY1O/0rHTRZ+J4BYBoO5ni9XLTyZnvfL4IuS1cwC0mB6NG1PI K/AgGD+654dj6M1ZMOIoP8dnm6dzzKWYBEl9YZrHQDf7DaPOCfkv0a4foJut2TRaPX4h ovSQ== X-Gm-Message-State: APf1xPDJ5L1diHIN/BKGuiFVRO2hq+REuFBFcu39tLMDdaW69fRrZ/vF cV2DsrwR16cYD6gxVmGFrP4= 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)) { -- 2.14.1