diff mbox

drm/i915: Flush any scheduled tasks during unload

Message ID 1310058772-23464-1-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson July 7, 2011, 5:12 p.m. UTC
As we use the global workqueue for delayed tasks, such as enabling FBC,
we need to be sure that they have finished executing before we unload
the module and remove their code pages.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Right, as Jesse hinted, since we add a task to the global workqueue and
only asynchronously cancel it, we need to be sure that it has indeed
finished executing before we unload the module.

This is a delta patch that can be applied on top of the delayed FBC
enable path.
 drivers/gpu/drm/i915/intel_display.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff mbox


diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 7395e8a..cfa9b61 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8038,6 +8038,9 @@  void intel_modeset_cleanup(struct drm_device *dev)
+	/* flush any delayed tasks or pending work */
+	flush_scheduled_work();
 	/* Shut off idle work before the crtcs get freed. */
 	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
 		intel_crtc = to_intel_crtc(crtc);