@@ -115,6 +115,7 @@ err_unref:
mutex_unlock(&dev->struct_mutex);
return NULL;
}
+
/**
* i915_context_hw_init - Create a valid context for the given object
* on the specified ring. This may need to be hardware dependent in the future,
@@ -315,12 +316,14 @@ void i915_context_init(struct drm_device *dev)
}
}
+static int warn_idr_cleanup = 0;
+
static
int i915_context_idr_cleanup(int id, void *p, void *data)
{
struct drm_device *dev = (struct drm_device *)data;
struct drm_i915_gem_context *ctx = (struct drm_i915_gem_context *)p;
- DRM_DEBUG_DRIVER("Destroying abandoned context %d\n", ctx->ctx_id);
+ WARN_ON_ONCE(warn_idr_cleanup);
do_context_destroy(dev, ctx);
return 0;
}
@@ -333,8 +336,10 @@ void i915_context_deinit(struct drm_device *dev)
i915_destroy_hw_context(dev, dev_priv->default_context);
spin_lock(&dev_priv->i915_ctx_lock);
+ warn_idr_cleanup=1;
idr_for_each(&dev_priv->i915_ctx_idr, i915_context_idr_cleanup, dev);
idr_remove_all(&dev_priv->i915_ctx_idr);
idr_destroy(&dev_priv->i915_ctx_idr);
+ warn_idr_cleanup=0;
spin_unlock(&dev_priv->i915_ctx_lock);
}