From: Rob Clark Subject: [PATCH] drm/i915: don't crash if unable to setup stolen Date: Tue, 30 Sep 2014 14:55:41 -0400 Message-ID: <1412103341-19578-1-git-send-email-robdclark@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-qg0-f49.google.com (mail-qg0-f49.google.com [209.85.192.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 3903E6E711 for ; Tue, 30 Sep 2014 11:55:52 -0700 (PDT) Received: by mail-qg0-f49.google.com with SMTP id q107so14148887qgd.36 for ; Tue, 30 Sep 2014 11:55:48 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org, Daniel Vetter List-Id: dri-devel@lists.freedesktop.org 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 --- 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