Received: by 10.223.185.116 with SMTP id b49csp3556864wrg; Mon, 19 Feb 2018 01:58:28 -0800 (PST) X-Google-Smtp-Source: AH8x224r64ErJsvIZ3ce9AVALZIsV5R21i15ZZLwuzzK85b4oe7mS9o0DoNFLDOL52Mtt+cG5inP X-Received: by 10.101.64.4 with SMTP id f4mr11555959pgp.171.1519034308727; Mon, 19 Feb 2018 01:58:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519034308; cv=none; d=google.com; s=arc-20160816; b=Nc+c0fu4muZqDcsyrG0tTrvLEsBwSoh0ZDWdJO2NrZwma6T0bNRdVST2Tk1BZZK9by fFhqJbSkngjgP411Ipbu0ZZY2BBZH9nApSAIBHYZ2wpwtc2PvZbIJ6tsDmii84MJziOe mOmK4xqlGPcZjlMFfT9TRh9nnC4G6V59ieDoKJCkAghFWFmoSCprih1v/oSnrWzFlHLI U6Am2smeRgWLeob/HQnd0fXGzEl0mRnZvVwbwaoaonYy9N5o6+Ge6dOfnOkJ5+Dn/gFV LIyYVeD3stFDdNLkGKpPxwgsAMn2pLeoTFapF/9Cdye2uctEh5r/Ctgs5tI7nft0wA+m b8bw== 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=Fd8Oe4d/2GJlp7FvrN1MvMU8xiSrm897FnPPA2xd5Fs=; b=q6BKoZX+eEu7wCd4BDo36bU1lLrQEP7r8a05pRNqYUT3MyfEz52vvl9Z+0KATsfhFs m+Yw5evmbhKsdulmldQJF1TXO2Q22er+Wsp6y7cbJeEq0P1rJvSIbooKG0Uq4s2oAlRW DR2mrsihIfQzC22egHTGZL/Lsm+quqpcleq1yt5FAs9M228FBNB1BYjD3Z+uNeqjCPyE k5AOeiZ+GcYwyRCTi/y9AS4Vrh3Yk1XLLAQ/d6K6q/pwxvy+S5G5nwkLkUu3LZXdumWf eneBMy1MbGSGFX/92EiH71vVNN28FT7fvlBJtGpIG0mIHEBgpGASvpsAIpXAzy+A73oT ntpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iHyUoW3s; 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 o5-v6si3980551plh.135.2018.02.19.01.58.14; Mon, 19 Feb 2018 01:58:28 -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=iHyUoW3s; 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 S1752288AbeBSJ5C (ORCPT + 99 others); Mon, 19 Feb 2018 04:57:02 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35866 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752347AbeBSJ4N (ORCPT ); Mon, 19 Feb 2018 04:56:13 -0500 Received: by mail-wm0-f65.google.com with SMTP id f3so13897939wmc.1 for ; Mon, 19 Feb 2018 01:56:12 -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=Fd8Oe4d/2GJlp7FvrN1MvMU8xiSrm897FnPPA2xd5Fs=; b=iHyUoW3sckXMeuYBw2M/UV0pQtWhojzbgK+4evMbk6AORmQY5DFaK7zJoRhOOSbgqb Z2E6/IeltVCRgiSQpAW0ew4MPdMMg3aLCOh2bA2gTRLsHoIQ+gf1Cj1A0+d/EbSLWxJf iBN9Mb6nGHWl2/qwVKbzFly8UHlvqhiYNcoVeMDFcODL1wPBQWu93qs9onF9vBk3TzDa Dqf/sjzdunL6laqvivwXSkptmOymVEZ6w/nlYocvFDBjO4Uxov3XBei0Jy4UOYT5oPBM ocggW/NvHgtTJt2QUJ/7PzbIYCGRvjzyInrGxV56DJD8sE8nxAjhYDqUdDx6hsjeBxeJ 5g7A== 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=Fd8Oe4d/2GJlp7FvrN1MvMU8xiSrm897FnPPA2xd5Fs=; b=LkXSUar8wr7z7a3/VmwgRJYDsZWA1Yno2lvqlISBMv8pSTV1e0LENwWs9P4IKIdeJc x+jxZ9nCwRRFrbGfR6W0st16WvTAwFRfbThDbh+ceYyYu/ntomiaiOB97gvODsGJp7OW V83DQ5eg6iL6N/esqqlgOdX8I2V9zdM9UXmESGKuUhXwljZDMQQV745+dkwzfSOlAvXZ raFO0xysiFh03yB6N9KNVHjdFcPSwUvKYo9QdHyFoT+O7nEH7kMWZWvJ1alLOgAek8AM 9wRo69wpTHD/2ViZrwepYSXoJjo7/MVFk8/P1qD/wO9rC/HWo0xGb+MLzYAWscMWKn/E nWIw== X-Gm-Message-State: APf1xPAIEw5KXk39eE+6xvznjr5cybNNmAtgd2BWH3ZZr3X8pfjKMK0K Pp3SnnQEnL/3iUZlhvIxdhE= X-Received: by 10.28.6.147 with SMTP id 141mr1109935wmg.8.1519034172281; Mon, 19 Feb 2018 01:56:12 -0800 (PST) Received: from baker.fritz.box ([2a02:908:1251:8fc0:9533:206a:c0b5:3ad7]) by smtp.gmail.com with ESMTPSA id z74sm22309976wmz.21.2018.02.19.01.56.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Feb 2018 01:56:11 -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, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org Subject: [PATCH 2/4] drm/amdgpu: use new ww_mutex_is_owned_by function Date: Mon, 19 Feb 2018 10:56:08 +0100 Message-Id: <20180219095610.2747-2-christian.koenig@amd.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180219095610.2747-1-christian.koenig@amd.com> References: <20180219095610.2747-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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index eaa3cb0c3ad1..4c04b560e358 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -1594,7 +1594,8 @@ 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, current, + &parser->ticket)) return -EINVAL; if (!((*bo)->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS)) { -- 2.14.1