[PATCH] drm/i915: Flush any deferred RCU cleanup before switching off GEM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <chris@xxxxxxxxxxxxxxxxxx>
Cc: Michal Wajdeczko <michal.wajdeczko@xxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux