Commit 91d502f6 authored by Maíra Canal's avatar Maíra Canal Committed by Melissa Wen

drm/v3d: switch to drmm_mutex_init

mutex_init is supposed to be balanced by a call to mutex_destroy, but
this is not currently happening on the v3d driver.

Considering the introduction of a DRM-managed mutex_init variant, switch
to the drmm_mutex_init.
Signed-off-by: default avatarMaíra Canal <mcanal@igalia.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarMelissa Wen <melissa.srw@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221108175425.39819-2-mcanal@igalia.com
parent 6b818c53
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/sched/signal.h> #include <linux/sched/signal.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <drm/drm_managed.h>
#include <drm/drm_syncobj.h> #include <drm/drm_syncobj.h>
#include <uapi/drm/v3d_drm.h> #include <uapi/drm/v3d_drm.h>
...@@ -1075,10 +1076,18 @@ v3d_gem_init(struct drm_device *dev) ...@@ -1075,10 +1076,18 @@ v3d_gem_init(struct drm_device *dev)
spin_lock_init(&v3d->mm_lock); spin_lock_init(&v3d->mm_lock);
spin_lock_init(&v3d->job_lock); spin_lock_init(&v3d->job_lock);
mutex_init(&v3d->bo_lock); ret = drmm_mutex_init(dev, &v3d->bo_lock);
mutex_init(&v3d->reset_lock); if (ret)
mutex_init(&v3d->sched_lock); return ret;
mutex_init(&v3d->cache_clean_lock); ret = drmm_mutex_init(dev, &v3d->reset_lock);
if (ret)
return ret;
ret = drmm_mutex_init(dev, &v3d->sched_lock);
if (ret)
return ret;
ret = drmm_mutex_init(dev, &v3d->cache_clean_lock);
if (ret)
return ret;
/* Note: We don't allocate address 0. Various bits of HW /* Note: We don't allocate address 0. Various bits of HW
* treat 0 as special, such as the occlusion query counters * treat 0 as special, such as the occlusion query counters
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment