diff mbox

[1/2] drm/i915: Flush the residual parking on emergency shutdown

Message ID 20180710094421.16223-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson July 10, 2018, 9:44 a.m. UTC
On unwinding following a critical failure inside GEM init, we also need
to be sure to flush the workers before unloading the module.

Testcase: igt/drv_module_reload/basic-reload-inject
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c      | 2 ++
 drivers/gpu/drm/i915/intel_display.c | 2 ++
 2 files changed, 4 insertions(+)

Comments

Matthew Auld July 10, 2018, 12:34 p.m. UTC | #1
On 10 July 2018 at 10:44, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On unwinding following a critical failure inside GEM init, we also need
> to be sure to flush the workers before unloading the module.
>
> Testcase: igt/drv_module_reload/basic-reload-inject
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

For the series:
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Chris Wilson July 10, 2018, 1:10 p.m. UTC | #2
Quoting Matthew Auld (2018-07-10 13:34:02)
> On 10 July 2018 at 10:44, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > On unwinding following a critical failure inside GEM init, we also need
> > to be sure to flush the workers before unloading the module.
> >
> > Testcase: igt/drv_module_reload/basic-reload-inject
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> 
> For the series:
> Reviewed-by: Matthew Auld <matthew.auld@intel.com>

Thanks, we should be able to fix drv_module_reload now to stop the
errors creeping back in.
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index b35cbfd16c9c..737580907c0c 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -5548,6 +5548,8 @@  int i915_gem_init(struct drm_i915_private *dev_priv)
 	WARN_ON(i915_gem_suspend(dev_priv));
 	i915_gem_suspend_late(dev_priv);
 
+	i915_gem_drain_workqueue(dev_priv);
+
 	mutex_lock(&dev_priv->drm.struct_mutex);
 	intel_uc_fini_hw(dev_priv);
 err_uc_init:
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 8f3199b06d1f..7998e70a3174 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -15890,6 +15890,8 @@  void intel_modeset_cleanup(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = to_i915(dev);
 
+	flush_workqueue(dev_priv->modeset_wq);
+
 	flush_work(&dev_priv->atomic_helper.free_work);
 	WARN_ON(!llist_empty(&dev_priv->atomic_helper.free_list));