From: Nicolai Hähnle Date: Thu, 1 Dec 2016 14:06:44 +0000 (+0100) Subject: drm/vgem: Use ww_mutex_(un)lock even with a NULL context X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ad1231080be5a5cb34bbecf08fa3fea50209ef94;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drm/vgem: Use ww_mutex_(un)lock even with a NULL context 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 Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/1480601214-26583-2-git-send-email-nhaehnle@gmail.com --- diff --git a/drivers/gpu/drm/vgem/vgem_fence.c b/drivers/gpu/drm/vgem/vgem_fence.c index 488909a21ed8..9cb00a5d5d08 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) {