[v2] drm/i915: Flush context free work on cleanup
diff mbox series

Message ID 20191112150051.1603-1-chris@chris-wilson.co.uk
State New
Headers show
Series
  • [v2] drm/i915: Flush context free work on cleanup
Related show

Commit Message

Chris Wilson Nov. 12, 2019, 3 p.m. UTC
Throw in a flush_work() to specifically flush the context cleanup work
before the module is unloaded.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=112248
Fixes: a4e7ccdac38e ("drm/i915: Move context management under GEM")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_context.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Mika Kuoppala Nov. 12, 2019, 4:01 p.m. UTC | #1
Chris Wilson <chris@chris-wilson.co.uk> writes:

> Throw in a flush_work() to specifically flush the context cleanup work
> before the module is unloaded.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=112248
> Fixes: a4e7ccdac38e ("drm/i915: Move context management under GEM")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/gem/i915_gem_context.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> index 72d389afa28a..17f395672e5e 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> @@ -776,6 +776,7 @@ int i915_gem_init_contexts(struct drm_i915_private *i915)
>  void i915_gem_driver_release__contexts(struct drm_i915_private *i915)
>  {
>  	destroy_kernel_context(&i915->kernel_context);
> +	flush_work(&i915->gem.contexts.free_work);
>  }
>  
>  static int context_idr_cleanup(int id, void *p, void *data)
> -- 
> 2.24.0

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
index 72d389afa28a..17f395672e5e 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
@@ -776,6 +776,7 @@  int i915_gem_init_contexts(struct drm_i915_private *i915)
 void i915_gem_driver_release__contexts(struct drm_i915_private *i915)
 {
 	destroy_kernel_context(&i915->kernel_context);
+	flush_work(&i915->gem.contexts.free_work);
 }
 
 static int context_idr_cleanup(int id, void *p, void *data)