[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <03202725-ecf3-1b49-f22a-1cbff84156bc@mblankhorst.nl>
Date: Mon, 28 Nov 2016 13:42:26 +0100
From: Maarten Lankhorst <dev@...ankhorst.nl>
To: Nicolai Hähnle <nhaehnle@...il.com>,
linux-kernel@...r.kernel.org
Cc: Nicolai Hähnle <Nicolai.Haehnle@....com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Daniel Vetter <daniel@...ll.ch>,
Chris Wilson <chris@...is-wilson.co.uk>,
dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH 01/11] drm/vgem: Use ww_mutex_(un)lock even with a NULL
context
Op 28-11-16 om 13:20 schreef Nicolai Hähnle:
> From: Nicolai Hähnle <Nicolai.Haehnle@....com>
>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Maarten Lankhorst <dev@...ankhorst.nl>
> Cc: Daniel Vetter <daniel@...ll.ch>
> Cc: Chris Wilson <chris@...is-wilson.co.uk>
> Cc: dri-devel@...ts.freedesktop.org
> Signed-off-by: Nicolai Hähnle <Nicolai.Haehnle@....com>
> ---
> 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
Powered by blists - more mailing lists