diff mbox

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

Message ID 20180409160534.23118-1-tvrtko.ursulin@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tvrtko Ursulin April 9, 2018, 4:05 p.m. UTC
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

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

Patch

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);