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

Submitted by Chris Wilson on Aug. 21, 2017, 10:10 a.m.

Details

Message ID 20170821101038.20757-1-chris@chris-wilson.co.uk
State New
Headers show
Series "drm/i915: Check that we disable RPS interrupts prior to suspending" ( rev: 2 ) in Intel GFX - Try Bot

Browsing this patch as part of:
"drm/i915: Check that we disable RPS interrupts prior to suspending" rev 2 in Intel GFX - Try Bot
<< prev patch [1/1] next patch >>

Commit Message

Chris Wilson Aug. 21, 2017, 10:10 a.m.
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@chris-wilson.co.uk>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Katarzyna Dec <katarzyna.dec@intel.com>
---
 drivers/gpu/drm/i915/i915_irq.c  |  2 ++
 drivers/gpu/drm/i915/intel_drv.h |  1 +
 drivers/gpu/drm/i915/intel_pm.c  | 11 +++++++++++
 3 files changed, 14 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index e21ce9c18b6e..01b5a37b4aab 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -4324,6 +4324,8 @@  void intel_irq_uninstall(struct drm_i915_private *dev_priv)
  */
 void intel_runtime_pm_disable_interrupts(struct drm_i915_private *dev_priv)
 {
+	intel_check_gt_powersave(dev_priv);
+
 	dev_priv->drm.driver->irq_uninstall(&dev_priv->drm);
 	dev_priv->pm.irqs_enabled = false;
 	synchronize_irq(dev_priv->drm.irq);
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..dca3d523103d 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -7805,6 +7805,17 @@  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;
+
+	WARN_ON(I915_READ(GEN6_PMINTRMSK) !=
+		gen6_sanitize_rps_pm_mask(dev_priv, ~0));
+}
+
 void intel_sanitize_gt_powersave(struct drm_i915_private *dev_priv)
 {
 	dev_priv->rps.enabled = true; /* force disabling */