Commit 4fda44bf authored by Chris Wilson's avatar Chris Wilson

drm/i915: Flush the workqueue before draining

Trying to drain a workqueue while we may still be adding to it from
background tasks is, according to kernel/workqueue.c, verboten. So, add
a flush_workqueue() at the start of our cleanup procedure.

References: https://bugs.freedesktop.org/show_bug.cgi?id=110550Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190703171913.16585-4-chris@chris-wilson.co.uk
parent 2006058e
...@@ -2473,6 +2473,7 @@ static inline void i915_gem_drain_workqueue(struct drm_i915_private *i915) ...@@ -2473,6 +2473,7 @@ static inline void i915_gem_drain_workqueue(struct drm_i915_private *i915)
*/ */
int pass = 3; int pass = 3;
do { do {
flush_workqueue(i915->wq);
rcu_barrier(); rcu_barrier();
i915_gem_drain_freed_objects(i915); i915_gem_drain_freed_objects(i915);
} while (--pass); } while (--pass);
......
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