Skip to contentSkip to conversation

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

PATCH New Rob Clark 1 participant 1 message Sep 30, 2014

Subsystems (2)
lore
Share & tools
lore

Rob Clark

author
#0 lore raw

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

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.

---
 drivers/gpu/drm/i915/intel_pm.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_pm.c +3 -0
index 45f71e6..bba8901 100644
@@ -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);
 }
Signature · 1 line
1.9.3