Message ID | 20180710094421.16223-1-chris@chris-wilson.co.uk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
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>
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 --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));
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(+)