From patchwork Tue Sep 30 18:55:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 5006531 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 65DB79F327 for ; Tue, 30 Sep 2014 18:55:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9A0C82015A for ; Tue, 30 Sep 2014 18:55:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id CD23E20155 for ; Tue, 30 Sep 2014 18:55:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 42FC26E711; Tue, 30 Sep 2014 11:55:53 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=RRFNlWkIs/Uss5NacHar2iC9egxcSAHUjAq1AkBkQV8=; b=oBprt7Ru+7XwPNHrINv9tORl6/HKCps+fM0kRYzACMXuy2yPHAiYb5+GLvj1MfBIzV 8dQdI8mpjhZVKcHVwLtdwbwT9dHi+0ju8UA04IGINZOB+0lZKHPLm9TfxNbMs/NJ9i+c qUAfj2s5YP7cxXzuW6fY2ygMovV/NW6na5+NdTOl0Vjt/tEnAN71PnINn8OhGD8WV2gX /Q1B+dZ7nOIZfGW8Ic5pd+o0hxgipQdqND2amMUZrp2Gazvk8uW2KIUct959tNxqOch1 zzQ+jMo7qAjUKS/sEupqix45z9jZORe14K06YhmeiP0aeJGOtSHbXyGyEW1n4iHwEqDb KPUA== X-Received: by 10.140.23.177 with SMTP id 46mr75881322qgp.64.1412103346619; Tue, 30 Sep 2014 11:55:46 -0700 (PDT) Received: from localhost (nat-pool-bos-t.redhat.com. [66.187.233.206]) by mx.google.com with ESMTPSA id q20sm1473247qay.37.2014.09.30.11.55.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Sep 2014 11:55:45 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org, Daniel Vetter 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> X-Mailer: git-send-email 1.9.3 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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); }