[Intel-gfx] [CI] drm/i915/pmu: check runtime resume vs pmu race

Tvrtko Ursulin tursulin at ursulin.net
Mon Apr 9 16:05:34 UTC 2018


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
 drivers/gpu/drm/i915/i915_pmu.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
index bd7e695fc663..9302b4abe357 100644
--- a/drivers/gpu/drm/i915/i915_pmu.c
+++ b/drivers/gpu/drm/i915/i915_pmu.c
@@ -479,7 +479,11 @@ static u64 get_rc6(struct drm_i915_private *i915)
 
 		val = kdev->power.suspended_jiffies -
 		      i915->pmu.suspended_jiffies_last;
-		val += jiffies - kdev->power.accounting_timestamp;
+
+		if (kdev->power.runtime_status == RPM_SUSPENDED)
+			val += jiffies - kdev->power.accounting_timestamp;
+		else
+			WARN(1, "not suspended");
 
 		spin_unlock(&kdev->power.lock);
 
-- 
2.14.1



More information about the Intel-gfx mailing list