From patchwork Mon Nov 28 12:20:02 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: 9449463 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 84DF9600CB for ; Mon, 28 Nov 2016 12:20:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 73FE627BE5 for ; Mon, 28 Nov 2016 12:20:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 65F3527BFF; Mon, 28 Nov 2016 12:20:27 +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 AA35627BE5 for ; Mon, 28 Nov 2016 12:20:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9B4796E2B9; Mon, 28 Nov 2016 12:20:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wj0-x241.google.com (mail-wj0-x241.google.com [IPv6:2a00:1450:400c:c01::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9FF396E2B9 for ; Mon, 28 Nov 2016 12:20:23 +0000 (UTC) Received: by mail-wj0-x241.google.com with SMTP id xy5so13847806wjc.1 for ; Mon, 28 Nov 2016 04:20:23 -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=xYtopZ7VX4PknnOY0NWV1XkNCQJP4K0YzLeV54/t3q0=; b=PDxR+c39ksNXTFR1z70BWpVq5Qo6YkNKUIAidIbw6VJKlo6cTNd2iNKhRYYS5h1BPe FY74wcR6tZX8/0r/KCGdDWFX0r+1oVpFzKNXf/zYw2QjvhEViL0wtRk/jWMZJIgaX7Xn O/tvhXmIKb094kU8grEkqZU7kcz0tsYfsevJlyv0JjafzIbJmdEFeBHgFsohmVIMCiFf JHCcU9nt/H5mkFvVEAD/DUWXH30GSR7BAXA5TXQuKmSfwWh+hsv5dXiDPGQjJptXhCke OFqEHCW+sYIfUQ7ZUdfYyWHEP7VFN/GWNuc/2FSn0WiNchd1wcfPx7AKTm4FoE7jc5JO MLkg== 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=xYtopZ7VX4PknnOY0NWV1XkNCQJP4K0YzLeV54/t3q0=; b=g0kpT9V5ucAkGKo2/3hKqqLsYlDkBjbCyUSk/Oq/YzyPvM5vweoYg8EXjrbV/9ANrY wfNlTsMO5z4gQUIOmJ8A16tXUp2NHdY2TzQR14tkVVTDIvIjmadYhR9z6eljVeWjwZBw XjsyyqB1oYJbeMHD0kcz3ZY2z6Q1Dyk3Hbv6klSQ6k9+eoqvUGeAeybNdgxVFcUYfK6J gjZR5Xml3NM4PJ8/Sb8kRZvm9kaLbpL88kisv71b+0DDcefrMU22m416KEKmf2niYWgv UQVd2QH6d34QWiFmExuK+QCKbBrgvscdk3tl+KQU6Y07JMkWUoZPS3SKdmWgad8h1+sZ yNDw== X-Gm-Message-State: AKaTC00IQHLwaf3scxzHhv8nsWT5h2wIGjHGFYMODBYUoGLQZxa//kQaobLKNcJ5s1XyTg== X-Received: by 10.194.248.233 with SMTP id yp9mr18512936wjc.228.1480335622115; Mon, 28 Nov 2016 04:20:22 -0800 (PST) Received: from cassiopeia.fritz.box ([2001:a61:1119:dc01:d88b:9432:f601:27ed]) by smtp.gmail.com with ESMTPSA id a13sm28830511wma.18.2016.11.28.04.20.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Nov 2016 04:20:21 -0800 (PST) From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= To: linux-kernel@vger.kernel.org Subject: [PATCH 01/11] drm/vgem: Use ww_mutex_(un)lock even with a NULL context Date: Mon, 28 Nov 2016 13:20:02 +0100 Message-Id: <1480335612-12069-2-git-send-email-nhaehnle@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480335612-12069-1-git-send-email-nhaehnle@gmail.com> References: <1480335612-12069-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 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 --- 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..e1d516f 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.base, 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.base); /* Record the fence in our idr for later signaling */ if (ret == 0) {