From 3e63669e716deb8ca461cd9b77c9178364b25d4c Mon Sep 17 00:00:00 2001 From: Amine Najahi Date: Tue, 5 Apr 2022 18:28:54 -0400 Subject: [PATCH] disp: msm: sde: fix GEM object inactive list locking Currently code is locking the struct_mutex when accessing the GEM object inactive list. This causes corruption of the inactive list during stability testing. This change uses the mm_lock mutex instead, as it is used in the allocation and de-allocation paths. Change-Id: I6384fd70e7ea5d7e3c2910c7670d152a61670dc1 Signed-off-by: Amine Najahi --- msm/msm_gem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/msm/msm_gem.c b/msm/msm_gem.c index d75e1576de..99e2ca2ccd 100644 --- a/msm/msm_gem.c +++ b/msm/msm_gem.c @@ -1095,9 +1095,9 @@ static struct drm_gem_object *_msm_gem_new(struct drm_device *dev, } #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) - mutex_lock(&dev->struct_mutex); + mutex_lock(&priv->mm_lock); list_add_tail(&msm_obj->mm_list, &priv->inactive_list); - mutex_unlock(&dev->struct_mutex); + mutex_unlock(&priv->mm_lock); #endif return obj; @@ -1203,9 +1203,9 @@ struct drm_gem_object *msm_gem_import(struct drm_device *dev, mutex_unlock(&msm_obj->lock); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) - mutex_lock(&dev->struct_mutex); + mutex_lock(&priv->mm_lock); list_add_tail(&msm_obj->mm_list, &priv->inactive_list); - mutex_unlock(&dev->struct_mutex); + mutex_unlock(&priv->mm_lock); #endif return obj;