Commit 25c49c83 authored by Rob Clark's avatar Rob Clark

drm/msm: Drop struct_mutex in free_object() path

Now that active_list/inactive_list is protected by mm_lock, we no longer
need dev->struct_mutex in the free_object() path.
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
Reviewed-by: default avatarKristian H. Kristensen <hoegsberg@google.com>
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
parent c5c1643c
...@@ -948,8 +948,6 @@ static void free_object(struct msm_gem_object *msm_obj) ...@@ -948,8 +948,6 @@ static void free_object(struct msm_gem_object *msm_obj)
struct drm_device *dev = obj->dev; struct drm_device *dev = obj->dev;
struct msm_drm_private *priv = dev->dev_private; struct msm_drm_private *priv = dev->dev_private;
WARN_ON(!mutex_is_locked(&dev->struct_mutex));
/* object should not be on active list: */ /* object should not be on active list: */
WARN_ON(is_active(msm_obj)); WARN_ON(is_active(msm_obj));
...@@ -991,20 +989,14 @@ void msm_gem_free_work(struct work_struct *work) ...@@ -991,20 +989,14 @@ void msm_gem_free_work(struct work_struct *work)
{ {
struct msm_drm_private *priv = struct msm_drm_private *priv =
container_of(work, struct msm_drm_private, free_work); container_of(work, struct msm_drm_private, free_work);
struct drm_device *dev = priv->dev;
struct llist_node *freed; struct llist_node *freed;
struct msm_gem_object *msm_obj, *next; struct msm_gem_object *msm_obj, *next;
while ((freed = llist_del_all(&priv->free_list))) { while ((freed = llist_del_all(&priv->free_list))) {
mutex_lock(&dev->struct_mutex);
llist_for_each_entry_safe(msm_obj, next, llist_for_each_entry_safe(msm_obj, next,
freed, freed) freed, freed)
free_object(msm_obj); free_object(msm_obj);
mutex_unlock(&dev->struct_mutex);
if (need_resched()) if (need_resched())
break; break;
} }
......
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