From patchwork Thu Dec 1 14:06:44 2016 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: 9456211 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 4B4B960235 for ; Thu, 1 Dec 2016 14:07:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E474284D9 for ; Thu, 1 Dec 2016 14:07:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 322FD284DE; Thu, 1 Dec 2016 14:07:09 +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 EC640284D9 for ; Thu, 1 Dec 2016 14:07:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C98026E7D7; Thu, 1 Dec 2016 14:07:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 35FB86E1B5 for ; Thu, 1 Dec 2016 14:07:03 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id m203so34328419wma.3 for ; Thu, 01 Dec 2016 06:07:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=g/dK4+87/c0lakgR4uE7MFwOuAEbJEijGQZuFM47cl4=; b=0rZ5dY4jNehMqiqdi+G6oVG4fu8dZAjEb0pB2wmks0YkVdTEycPxV7Bz7jly+YRK5U u2jcNS4mr7KmsqkAb38IojtoZJaU9BrFqtJFHzv6+92CbldgIYeza5U7bXUU8p4EFpSR D2RKzOQNuhqENaa4IO0JxxMTtFlZ4SJMRXE2/YaGnpqj4XLrbPHI3Ut0wM5quFHPpMez f5B/EGQGlBGlMywHhMOOZeFEQdEczmjFXLVY2gVAaPi/iIZPynB06QVaO+ADGOnUBuHA xRA+r3GOl8HVjG112xPrBQiatwssaCXrt4DuixaUny93toq4QA19WJTaroNaRdwOm3e9 3ykw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=g/dK4+87/c0lakgR4uE7MFwOuAEbJEijGQZuFM47cl4=; b=X3mfvQN+j15RJY2IdX3+v4RZHXoXEZERNT+Umc7XUzDtuBojcTBVi/90D+ROcotVgG XZxCEWUu9ueHlI9XDNXA1Ef/GCEWTRfXHppdXmcuXMloqEuMJeEQRu2e3P+xHgOdHXQK 9cQXHe3rpTgiEIbg2Wn6JeHTv4NpF8s8IuVZ/bQhArJcIXHuvipwxUsMrBatgo7CsaWf sE25TxIsCR6tq/k2g2xrgByMfTC1BXEViaSiBbfpewESHVNFQCZqyuiqlnqk/0FLF459 sMD3dkZCO7Gj7BhR8+QyHIkhfai4MRvnM2hVBFmZHM22gmGoNmFRPzKkw5tsWbuUJ6rI kIvQ== X-Gm-Message-State: AKaTC03F2O/cHJUcmihZBlrb8f+tEmpjp7IqMau5JSht7DlXIf4e1L1i9HPTGtpTHsN5Eg== X-Received: by 10.28.226.139 with SMTP id z133mr35978287wmg.139.1480601221625; Thu, 01 Dec 2016 06:07:01 -0800 (PST) Received: from cassiopeia.fritz.box ([2001:a61:116e:7d01:dc12:8e88:ab9d:8694]) by smtp.gmail.com with ESMTPSA id vr9sm411514wjc.35.2016.12.01.06.07.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Dec 2016 06:07:01 -0800 (PST) From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= To: linux-kernel@vger.kernel.org Subject: [PATCH v2 01/11] drm/vgem: Use ww_mutex_(un)lock even with a NULL context Date: Thu, 1 Dec 2016 15:06:44 +0100 Message-Id: <1480601214-26583-2-git-send-email-nhaehnle@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480601214-26583-1-git-send-email-nhaehnle@gmail.com> References: <1480601214-26583-1-git-send-email-nhaehnle@gmail.com> MIME-Version: 1.0 Cc: Maarten Lankhorst , =?UTF-8?q?Nicolai=20H=C3=A4hnle?= , Peter Zijlstra , dri-devel@lists.freedesktop.org, Ingo Molnar 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 v2: use resv->lock instead of resv->lock.base (Christian König) Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Maarten Lankhorst Cc: Daniel Vetter Cc: Chris Wilson Cc: dri-devel@lists.freedesktop.org Signed-off-by: Nicolai Hähnle Reviewed-by: Chris Wilson --- drivers/gpu/drm/vgem/vgem_fence.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vgem/vgem_fence.c b/drivers/gpu/drm/vgem/vgem_fence.c index 488909a..9cb00a5 100644 --- a/drivers/gpu/drm/vgem/vgem_fence.c +++ b/drivers/gpu/drm/vgem/vgem_fence.c @@ -191,12 +191,12 @@ int vgem_fence_attach_ioctl(struct drm_device *dev, /* Expose the fence via the dma-buf */ ret = 0; - mutex_lock(&resv->lock.base); + ww_mutex_lock(&resv->lock, NULL); if (arg->flags & VGEM_FENCE_WRITE) reservation_object_add_excl_fence(resv, fence); else if ((ret = reservation_object_reserve_shared(resv)) == 0) reservation_object_add_shared_fence(resv, fence); - mutex_unlock(&resv->lock.base); + ww_mutex_unlock(&resv->lock); /* Record the fence in our idr for later signaling */ if (ret == 0) {