浏览代码

drm/i915: Arm the unclaimed mmio debugs on suspend path

If we go into suspend with unclaimed access detected,
it would be nice to catch that access on a next suspend path.
So instead of just notifying about it, arm the unclaimed
mmio checks on suspend side.

We want to keep the asymmetry on resume, as if it was
on resume path, it was not driver that is responsible so
no point in arming mmio debugs.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1452261080-6979-2-git-send-email-mika.kuoppala@intel.com
Mika Kuoppala 9 年之前
父节点
当前提交
bc3b9346cd
共有 3 个文件被更改,包括 7 次插入4 次删除
  1. 1 1
      drivers/gpu/drm/i915/i915_drv.c
  2. 1 1
      drivers/gpu/drm/i915/i915_drv.h
  3. 5 2
      drivers/gpu/drm/i915/intel_uncore.c

+ 1 - 1
drivers/gpu/drm/i915/i915_drv.c

@@ -1502,7 +1502,7 @@ static int intel_runtime_suspend(struct device *device)
 	enable_rpm_wakeref_asserts(dev_priv);
 	enable_rpm_wakeref_asserts(dev_priv);
 	WARN_ON_ONCE(atomic_read(&dev_priv->pm.wakeref_count));
 	WARN_ON_ONCE(atomic_read(&dev_priv->pm.wakeref_count));
 
 
-	if (intel_uncore_unclaimed_mmio(dev_priv))
+	if (intel_uncore_arm_unclaimed_mmio_detection(dev_priv))
 		DRM_ERROR("Unclaimed access detected prior to suspending\n");
 		DRM_ERROR("Unclaimed access detected prior to suspending\n");
 
 
 	dev_priv->pm.suspended = true;
 	dev_priv->pm.suspended = true;

+ 1 - 1
drivers/gpu/drm/i915/i915_drv.h

@@ -2720,7 +2720,7 @@ extern void intel_uncore_early_sanitize(struct drm_device *dev,
 					bool restore_forcewake);
 					bool restore_forcewake);
 extern void intel_uncore_init(struct drm_device *dev);
 extern void intel_uncore_init(struct drm_device *dev);
 extern bool intel_uncore_unclaimed_mmio(struct drm_i915_private *dev_priv);
 extern bool intel_uncore_unclaimed_mmio(struct drm_i915_private *dev_priv);
-extern void intel_uncore_arm_unclaimed_mmio_detection(struct drm_i915_private *dev_priv);
+extern bool intel_uncore_arm_unclaimed_mmio_detection(struct drm_i915_private *dev_priv);
 extern void intel_uncore_fini(struct drm_device *dev);
 extern void intel_uncore_fini(struct drm_device *dev);
 extern void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore);
 extern void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore);
 const char *intel_uncore_forcewake_domain_to_str(const enum forcewake_domain_id id);
 const char *intel_uncore_forcewake_domain_to_str(const enum forcewake_domain_id id);

+ 5 - 2
drivers/gpu/drm/i915/intel_uncore.c

@@ -1610,12 +1610,12 @@ bool intel_uncore_unclaimed_mmio(struct drm_i915_private *dev_priv)
 	return check_for_unclaimed_mmio(dev_priv);
 	return check_for_unclaimed_mmio(dev_priv);
 }
 }
 
 
-void
+bool
 intel_uncore_arm_unclaimed_mmio_detection(struct drm_i915_private *dev_priv)
 intel_uncore_arm_unclaimed_mmio_detection(struct drm_i915_private *dev_priv)
 {
 {
 	if (unlikely(i915.mmio_debug ||
 	if (unlikely(i915.mmio_debug ||
 		     dev_priv->uncore.unclaimed_mmio_check <= 0))
 		     dev_priv->uncore.unclaimed_mmio_check <= 0))
-		return;
+		return false;
 
 
 	if (unlikely(intel_uncore_unclaimed_mmio(dev_priv))) {
 	if (unlikely(intel_uncore_unclaimed_mmio(dev_priv))) {
 		DRM_DEBUG("Unclaimed register detected, "
 		DRM_DEBUG("Unclaimed register detected, "
@@ -1623,5 +1623,8 @@ intel_uncore_arm_unclaimed_mmio_detection(struct drm_i915_private *dev_priv)
 			  "Please use i915.mmio_debug=N for more information.\n");
 			  "Please use i915.mmio_debug=N for more information.\n");
 		i915.mmio_debug++;
 		i915.mmio_debug++;
 		dev_priv->uncore.unclaimed_mmio_check--;
 		dev_priv->uncore.unclaimed_mmio_check--;
+		return true;
 	}
 	}
+
+	return false;
 }
 }