Commit 183e260b authored by Chris Wilson's avatar Chris Wilson

drm/i915: Track the rpm wakerefs for error handling

Keep hold of the local wakeref used in error handling, to cancel
the tracking upon release so that leaks can be identified.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190114142129.24398-4-chris@chris-wilson.co.uk
parent 506d1f62
...@@ -3291,6 +3291,7 @@ void i915_handle_error(struct drm_i915_private *dev_priv, ...@@ -3291,6 +3291,7 @@ void i915_handle_error(struct drm_i915_private *dev_priv,
const char *fmt, ...) const char *fmt, ...)
{ {
struct intel_engine_cs *engine; struct intel_engine_cs *engine;
intel_wakeref_t wakeref;
unsigned int tmp; unsigned int tmp;
char error_msg[80]; char error_msg[80];
char *msg = NULL; char *msg = NULL;
...@@ -3312,7 +3313,7 @@ void i915_handle_error(struct drm_i915_private *dev_priv, ...@@ -3312,7 +3313,7 @@ void i915_handle_error(struct drm_i915_private *dev_priv,
* isn't the case at least when we get here by doing a * isn't the case at least when we get here by doing a
* simulated reset via debugfs, so get an RPM reference. * simulated reset via debugfs, so get an RPM reference.
*/ */
intel_runtime_pm_get(dev_priv); wakeref = intel_runtime_pm_get(dev_priv);
engine_mask &= INTEL_INFO(dev_priv)->ring_mask; engine_mask &= INTEL_INFO(dev_priv)->ring_mask;
...@@ -3374,7 +3375,7 @@ void i915_handle_error(struct drm_i915_private *dev_priv, ...@@ -3374,7 +3375,7 @@ void i915_handle_error(struct drm_i915_private *dev_priv,
wake_up_all(&dev_priv->gpu_error.reset_queue); wake_up_all(&dev_priv->gpu_error.reset_queue);
out: out:
intel_runtime_pm_put_unchecked(dev_priv); intel_runtime_pm_put(dev_priv, wakeref);
} }
/* Called from drm generic code, passed 'crtc' which /* Called from drm generic code, passed 'crtc' which
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment