Commit 68c84342 authored by Shaohua Li's avatar Shaohua Li Committed by Eric Anholt

drm/i915: fix scheduling while holding the new active list spinlock

regression caused by commit 5e118f41:
i915_gem_object_move_to_inactive() should be called in task context,
as it calls fput();

Signed-off-by: Shaohua Li<shaohua.li@intel.com>
[anholt: Add more detail to the comment about the lock break that's added]
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
parent 280b713b
...@@ -1596,8 +1596,19 @@ i915_gem_retire_request(struct drm_device *dev, ...@@ -1596,8 +1596,19 @@ i915_gem_retire_request(struct drm_device *dev,
if (obj->write_domain != 0) if (obj->write_domain != 0)
i915_gem_object_move_to_flushing(obj); i915_gem_object_move_to_flushing(obj);
else else {
/* Take a reference on the object so it won't be
* freed while the spinlock is held. The list
* protection for this spinlock is safe when breaking
* the lock like this since the next thing we do
* is just get the head of the list again.
*/
drm_gem_object_reference(obj);
i915_gem_object_move_to_inactive(obj); i915_gem_object_move_to_inactive(obj);
spin_unlock(&dev_priv->mm.active_list_lock);
drm_gem_object_unreference(obj);
spin_lock(&dev_priv->mm.active_list_lock);
}
} }
out: out:
spin_unlock(&dev_priv->mm.active_list_lock); spin_unlock(&dev_priv->mm.active_list_lock);
......
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