[PATCH] drm/i915: don't crash if unable to setup stolen

Rob Clark robdclark at gmail.com
Tue Sep 30 11:55:41 PDT 2014


On this baytrail NUC I would see:

  *ERROR* conflict detected with stolen region: [0xbb000000 - 0xbf000000]

Since stolen region is not setup, dev_priv->mm.stolen would not be
initialized, which results that vlv_pctx is not allocated in
valleyview_setup_pctx() which results in things going BOOM in
valleyview_check_pctx().

Things seem to work out much better if we check for NULL ptr first.

Signed-off-by: Rob Clark <robdclark at gmail.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 45f71e6..bba8901 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -4185,6 +4185,9 @@ static void valleyview_check_pctx(struct drm_i915_private *dev_priv)
 {
 	unsigned long pctx_addr = I915_READ(VLV_PCBR) & ~4095;
 
+	if (!dev_priv->vlv_pctx)
+		return;
+
 	WARN_ON(pctx_addr != dev_priv->mm.stolen_base +
 			     dev_priv->vlv_pctx->stolen->start);
 }
-- 
1.9.3



More information about the dri-devel mailing list