From patchwork Tue Feb 14 09:18:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Nicolai_H=C3=A4hnle?= X-Patchwork-Id: 9571493 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 C080A6045F for ; Tue, 14 Feb 2017 09:19:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B45D527D45 for ; Tue, 14 Feb 2017 09:19:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A8C3928178; Tue, 14 Feb 2017 09:19: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 152FC27D45 for ; Tue, 14 Feb 2017 09:19:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7A08A6E631; Tue, 14 Feb 2017 09:19:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8AB2F6E627; Tue, 14 Feb 2017 09:19:15 +0000 (UTC) Received: by mail-wr0-x244.google.com with SMTP id c4so1290357wrd.1; Tue, 14 Feb 2017 01:19:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qaXMn07/mEG8DwnzaZN6TKBQg3AZqhAIxFEHF0WEu8k=; b=qjVRCy8egciDPvLjOXz9ugjckQCtMbug7tnHgh0i2VatfyqvsZG68cpKcLieiTG1Dy GJewNPDbALKbBkMroKT0O4B+Deyhj1nsUQ2qThCQwqzgkLylWscSvIexCNWwAv66qg6I cTC6jps2HHuR6PR+03QppCYH08k3vEB6+aJ/K+HG2ZPwjkDgVImZ54n8YyAN+PdoLWmQ psv0HATw/hveeoiO44xOFzQGlLRmbgvUjtosVKNCBOFsS02wJWBvxqwQME8wKqiE3r3o 8UZShHxm1dJUrYAfstGMo3a4GurG1rouV4nkkWXBLK7TTJBQh+tVg8CtI2YDMqosDKqF 6QDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qaXMn07/mEG8DwnzaZN6TKBQg3AZqhAIxFEHF0WEu8k=; b=EenYukNbVku2LuiWXEAenolIAzA5ekMU86K4d2DKvHNvEkJZ6NQNIBEBFim3Wza8W2 Rv3VsUZ7i+eXwN3lU1CoNWZw/7zHHfEL2XqFFk6QSQjfIcRPFw34s3dFbxw+S4VQEZ9O BJURFuAD2UwkQg8ufDMHOovkq4kXjs72DjNpb2kEn1ejGm3TBMokHcCiulyvW0XfAHPs kQQuDLGiDkq2UupAnpY3Qzq4Iv0FTQT9FpOHRVlf0Ta04k7GbwD3TVHiyXsTlwgyxFIV IU0RRpbsBWCUN002X+bta63N8gkuIjE4vm4mAPmXz4G1qoRoRJUU9kHX6AzSoQr91JH1 vQiQ== X-Gm-Message-State: AMke39kofsLgoiYS6BhnlLeu/R3xmzl0u1mJ633ZqdPtVjpJ5QQy6DaSrIXrRFJhIlnXIg== X-Received: by 10.223.138.172 with SMTP id y41mr23513995wry.118.1487063954191; Tue, 14 Feb 2017 01:19:14 -0800 (PST) Received: from capella.localdomain (x5ce2e06e.dyn.telefonica.de. [92.226.224.110]) by smtp.gmail.com with ESMTPSA id x39sm17211935wrb.3.2017.02.14.01.19.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Feb 2017 01:19:13 -0800 (PST) From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= To: amd-gfx@lists.freedesktop.org Subject: [PATCH 2/2] Revert "drm/amdgpu: fix a potential deadlock in amdgpu_bo_create_restricted()" Date: Tue, 14 Feb 2017 10:18:45 +0100 Message-Id: <20170214091845.1225-3-nhaehnle@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170214091845.1225-1-nhaehnle@gmail.com> References: <20170214091845.1225-1-nhaehnle@gmail.com> MIME-Version: 1.0 Cc: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= , dri-devel@lists.freedesktop.org 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 From: Nicolai Hähnle This reverts commit 38fc4856ad98f230bc91da0421dec69e4aee40f8, which introduces a use-after-free. The underlying bug should be properly fixed with "drm/ttm: never add BO that failed to validate to the LRU list". Cc: Samuel Pitoiset Cc: zhoucm1 Signed-off-by: Nicolai Hähnle --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 556236a..d1ef1d0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -403,11 +403,8 @@ int amdgpu_bo_create_restricted(struct amdgpu_device *adev, &bo->placement, page_align, !kernel, NULL, acc_size, sg, resv ? resv : &bo->tbo.ttm_resv, &amdgpu_ttm_bo_destroy); - if (unlikely(r != 0)) { - if (!resv) - ww_mutex_unlock(&bo->tbo.resv->lock); + if (unlikely(r != 0)) return r; - } bo->tbo.priority = ilog2(bo->tbo.num_pages); if (kernel)