aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2010-08-20 18:25:16 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-08 05:13:28 -0400
commit75ef9da2cdb64e7926404dd2b755bbbfe98eaeaf (patch)
treeef200ecba7bb6c9a8cb2ee3d830f30c5d5377207
parentc911fc1c6ad61b56869ee521f1a477c741b039da (diff)
drm/i915: unload: fix retire_work races
ums-gem code correctly cancels the retire work (at lastclose time), kms does not do so. Fix this by canceling the work right after ideling the gpu. While staring at the code I noticed that the work function is not static. Fix this, too. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c3
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h1
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c2
3 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 14133ebef33b..c58ec5c02919 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -2261,6 +2261,9 @@ int i915_driver_unload(struct drm_device *dev)
2261 DRM_ERROR("failed to idle hardware: %d\n", ret); 2261 DRM_ERROR("failed to idle hardware: %d\n", ret);
2262 mutex_unlock(&dev->struct_mutex); 2262 mutex_unlock(&dev->struct_mutex);
2263 2263
2264 /* Cancel the retire work handler, which should be idle now. */
2265 cancel_delayed_work_sync(&dev_priv->mm.retire_work);
2266
2264 io_mapping_free(dev_priv->mm.gtt_mapping); 2267 io_mapping_free(dev_priv->mm.gtt_mapping);
2265 if (dev_priv->mm.gtt_mtrr >= 0) { 2268 if (dev_priv->mm.gtt_mtrr >= 0) {
2266 mtrr_del(dev_priv->mm.gtt_mtrr, dev->agp->base, 2269 mtrr_del(dev_priv->mm.gtt_mtrr, dev->agp->base,
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index af4a263cf257..04aada08a6f9 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -978,7 +978,6 @@ bool i915_seqno_passed(uint32_t seq1, uint32_t seq2);
978int i915_gem_object_get_fence_reg(struct drm_gem_object *obj); 978int i915_gem_object_get_fence_reg(struct drm_gem_object *obj);
979int i915_gem_object_put_fence_reg(struct drm_gem_object *obj); 979int i915_gem_object_put_fence_reg(struct drm_gem_object *obj);
980void i915_gem_retire_requests(struct drm_device *dev); 980void i915_gem_retire_requests(struct drm_device *dev);
981void i915_gem_retire_work_handler(struct work_struct *work);
982void i915_gem_clflush_object(struct drm_gem_object *obj); 981void i915_gem_clflush_object(struct drm_gem_object *obj);
983int i915_gem_object_set_domain(struct drm_gem_object *obj, 982int i915_gem_object_set_domain(struct drm_gem_object *obj,
984 uint32_t read_domains, 983 uint32_t read_domains,
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 4cccdce5f80f..26eb6e31c743 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1797,7 +1797,7 @@ i915_gem_retire_requests(struct drm_device *dev)
1797 i915_gem_retire_requests_ring(dev, &dev_priv->bsd_ring); 1797 i915_gem_retire_requests_ring(dev, &dev_priv->bsd_ring);
1798} 1798}
1799 1799
1800void 1800static void
1801i915_gem_retire_work_handler(struct work_struct *work) 1801i915_gem_retire_work_handler(struct work_struct *work)
1802{ 1802{
1803 drm_i915_private_t *dev_priv; 1803 drm_i915_private_t *dev_priv;