Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932601AbcK1Mmh (ORCPT ); Mon, 28 Nov 2016 07:42:37 -0500 Received: from mblankhorst.nl ([141.105.120.124]:38095 "EHLO mblankhorst.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932094AbcK1Mma (ORCPT ); Mon, 28 Nov 2016 07:42:30 -0500 Subject: Re: [PATCH 01/11] drm/vgem: Use ww_mutex_(un)lock even with a NULL context To: =?UTF-8?Q?Nicolai_H=c3=a4hnle?= , linux-kernel@vger.kernel.org References: <1480335612-12069-1-git-send-email-nhaehnle@gmail.com> <1480335612-12069-2-git-send-email-nhaehnle@gmail.com> Cc: =?UTF-8?Q?Nicolai_H=c3=a4hnle?= , Peter Zijlstra , Ingo Molnar , Daniel Vetter , Chris Wilson , dri-devel@lists.freedesktop.org From: Maarten Lankhorst Message-ID: <03202725-ecf3-1b49-f22a-1cbff84156bc@mblankhorst.nl> Date: Mon, 28 Nov 2016 13:42:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1480335612-12069-2-git-send-email-nhaehnle@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1125 Lines: 28 Op 28-11-16 om 13:20 schreef Nicolai Hähnle: > 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); Yuck, can we rename base to __NEVER_TOUCH_DIRECTLY_OUTSIDE_LOCKING_CORE? It's harder to get them confused like that, even with a null context it's illegal to call mutex_lock/unlock directly. ~Maarten