Kaynağa Gözat

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 <[email protected]>
Amine Najahi 3 yıl önce
ebeveyn
işleme
3e63669e71
1 değiştirilmiş dosya ile 4 ekleme ve 4 silme
  1. 4 4
      msm/msm_gem.c

+ 4 - 4
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;