On module load, if we fail to initialise GEM, we will try to keep the
module alive (so that we can bring KMS up to keep the system usable).
However, if we outright fail to load and choose to abort the module, we
have to flush the GEM deferred cleanup before reporting that failure.

Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>
Cc: Michal Wajdeczko <michal.wajdec...@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index e779dba2e5a3..f88ae652e919 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1601,6 +1601,10 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
                mutex_unlock(&dev_priv->drm.struct_mutex);
        }
 
+       /* Flush any deferred RCU cleanup */
+       rcu_barrier();
+       flush_workqueue(dev_priv->rq);
+
        i915_gem_drain_freed_objects(dev_priv);
        return ret;
 }
-- 
2.23.0.rc0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to