From patchwork Wed Dec 21 18:46:29 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: 9483625 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 2F8E7601D3 for ; Wed, 21 Dec 2016 18:47:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23CA528419 for ; Wed, 21 Dec 2016 18:47:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18A8228458; Wed, 21 Dec 2016 18:47:00 +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 AE43A28419 for ; Wed, 21 Dec 2016 18:46:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C12496E100; Wed, 21 Dec 2016 18:46:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 77E566E0F0 for ; Wed, 21 Dec 2016 18:46:50 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id l2so6523234wml.2 for ; Wed, 21 Dec 2016 10:46:50 -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=g/dK4+87/c0lakgR4uE7MFwOuAEbJEijGQZuFM47cl4=; b=sz2pHYE9k6kTHo6M3elWkIOdunuiwG6mVWmvNMn8bsWUVULCTvlA1JYRTPCPdItIiO dB93F9u9UTHb6vr4n6gdWML8QGrz8gb+IIacfKVOjnmw4BvxVg4CremFzssYZEitl05v snebClJN+dzSlFsfSKgNF5WB88jYWp+0+8ho+5X89OsX/teq+SzuyJjDBfUN4eq7Ggar GoofbbNSwH2Fx502bg0lwohZKfXROrQh3V43N6TTPzXRns2NZnikC9NdoeImj03Byatu fXvLmLo7YUqX4NUUVHw9aelRx7Lc7Lyj4ySk8jy9ayoD95l++pKM6bgLcTX4vvb0G7z1 GJMg== 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=g/dK4+87/c0lakgR4uE7MFwOuAEbJEijGQZuFM47cl4=; b=aBEpetrrM3yNei+U4d2Fre1DLwUdKDs3u/LdXTneGkQqI9yHhRXhcCgkNn5rNxdB86 KvzKv1OppqD6cumzfsKq0y8jSbIKWas0YfpyS1MX+tymPUYHbDHqtBCvzB607JyP1Hai stDiIAu5L/9Pb6jdKVSZHJsh0Yr2Jpa313Du7QcpejzOoBE61j1/iXdMJ8l5fD6KyXIN YkvliZKSm6/dF7JpcZ6xvAs1XfxC1bQtWtW34Z3L68bnXcaDsVUbX8ZGvMeE5DzYisF9 KPW5s4w2OVXIc+LT7OEj8XKI2s1v8DBmy8Lv+gGYznUzkhwlwrV+ACaFA4INtdjh3YDz ayOQ== X-Gm-Message-State: AIkVDXIaCQgDbLkapK18pgNZUZLhA41kEpDKLK5mQGCnfl9l6ivDMvvUPS+QQKPZiuVjOA== X-Received: by 10.28.64.67 with SMTP id n64mr5512433wma.34.1482346008769; Wed, 21 Dec 2016 10:46:48 -0800 (PST) Received: from cassiopeia.fritz.box ([2001:a61:110a:1701:2511:6687:1ba5:b45b]) by smtp.gmail.com with ESMTPSA id ke6sm31840526wjb.21.2016.12.21.10.46.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Dec 2016 10:46:48 -0800 (PST) From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= To: linux-kernel@vger.kernel.org Subject: [PATCH v3 01/12] drm/vgem: Use ww_mutex_(un)lock even with a NULL context Date: Wed, 21 Dec 2016 19:46:29 +0100 Message-Id: <1482346000-9927-2-git-send-email-nhaehnle@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482346000-9927-1-git-send-email-nhaehnle@gmail.com> References: <1482346000-9927-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 --- 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) {