[PATCH 01/10] drm/i915: Print wakeref debug even with wakerefs held

Imre Deak imre.deak at intel.com
Wed May 1 10:31:24 UTC 2019


It's useful to know where wakeref leaks originate during unload and
suspend, so print those even if there are wakeref holders.

Since this also clears the wakeref tracking table, a later RPM ref put
will trigger an unknown wakeref WARN, but probably rightly so, because
the put happened too late.

Signed-off-by: Imre Deak <imre.deak at intel.com>
---
 drivers/gpu/drm/i915/intel_runtime_pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index 30e7cb9d5801..a0ea38319841 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -4521,12 +4521,12 @@ void intel_runtime_pm_cleanup(struct drm_i915_private *i915)
 	struct i915_runtime_pm *rpm = &i915->runtime_pm;
 	int count;
 
-	count = atomic_fetch_inc(&rpm->wakeref_count); /* balance untrack */
+	count = atomic_xchg(&rpm->wakeref_count, 1); /* force printing */
 	WARN(count,
 	     "i915->runtime_pm.wakeref_count=%d on cleanup\n",
 	     count);
-
 	untrack_intel_runtime_pm_wakeref(i915);
+	atomic_add(count, &rpm->wakeref_count);
 }
 
 void intel_runtime_pm_init_early(struct drm_i915_private *i915)
-- 
2.17.1



More information about the Intel-gfx-trybot mailing list