[PATCH] drm/i915: Check that we disable RPS interrupts prior to suspending

Chris Wilson chris at chris-wilson.co.uk
Mon Aug 21 13:12:04 UTC 2017


Anytime we suspend, either at runtime or S3, check that we have disabled
the RPS interrupt generator (via PMINTRMSK). This should have been done
upon idling (see gen6_rps_idle()) prior to dropping our GT wakeref.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Imre Deak <imre.deak at intel.com>
Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
Cc: Katarzyna Dec <katarzyna.dec at intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c  |  2 ++
 drivers/gpu/drm/i915/intel_drv.h |  1 +
 drivers/gpu/drm/i915/intel_pm.c  | 15 +++++++++++++++
 3 files changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 43100229613c..e96b74bff48d 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1531,6 +1531,7 @@ static int i915_drm_suspend(struct drm_device *dev)
 
 	intel_dp_mst_suspend(dev);
 
+	intel_check_gt_powersave(dev_priv);
 	intel_runtime_pm_disable_interrupts(dev_priv);
 	intel_hpd_cancel_work(dev_priv);
 
@@ -2488,6 +2489,7 @@ static int intel_runtime_suspend(struct device *kdev)
 
 	intel_guc_suspend(dev_priv);
 
+	intel_check_gt_powersave(dev_priv);
 	intel_runtime_pm_disable_interrupts(dev_priv);
 
 	ret = 0;
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 2940d393ecfd..eda5a31cc599 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1840,6 +1840,7 @@ void intel_enable_gt_powersave(struct drm_i915_private *dev_priv);
 void intel_autoenable_gt_powersave(struct drm_i915_private *dev_priv);
 void intel_disable_gt_powersave(struct drm_i915_private *dev_priv);
 void intel_suspend_gt_powersave(struct drm_i915_private *dev_priv);
+void intel_check_gt_powersave(struct drm_i915_private *dev_priv);
 void gen6_rps_busy(struct drm_i915_private *dev_priv);
 void gen6_rps_reset_ei(struct drm_i915_private *dev_priv);
 void gen6_rps_idle(struct drm_i915_private *dev_priv);
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 68187bcfded4..09f04cabe2ee 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -7805,6 +7805,21 @@ void intel_suspend_gt_powersave(struct drm_i915_private *dev_priv)
 	/* gen6_rps_idle() will be called later to disable interrupts */
 }
 
+void intel_check_gt_powersave(struct drm_i915_private *dev_priv)
+{
+	GEM_BUG_ON(dev_priv->gt.awake);
+
+	if (INTEL_GEN(dev_priv) < 6)
+		return;
+
+	if (GEM_WARN_ON(I915_READ(GEN6_PMINTRMSK) !=
+			gen6_sanitize_rps_pm_mask(dev_priv, ~0)))
+		DRM_ERROR("PMINTRMSK=%08x, expected=%08x; rps.enabled? %s\n",
+			  I915_READ(GEN6_PMINTRMSK),
+			  gen6_sanitize_rps_pm_mask(dev_priv, ~0),
+			  yesno(dev_priv->rps.enabled));
+}
+
 void intel_sanitize_gt_powersave(struct drm_i915_private *dev_priv)
 {
 	dev_priv->rps.enabled = true; /* force disabling */
-- 
2.14.1



More information about the Intel-gfx-trybot mailing list