From patchwork Mon Sep 14 21:48:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Gamari X-Patchwork-Id: 47475 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8ELmwqn032266 for ; Mon, 14 Sep 2009 21:48:58 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 88C809F3C5; Mon, 14 Sep 2009 14:48:58 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from qw-out-1920.google.com (qw-out-1920.google.com [74.125.92.147]) by gabe.freedesktop.org (Postfix) with ESMTP id 1554A9F390 for ; Mon, 14 Sep 2009 14:48:55 -0700 (PDT) Received: by qw-out-1920.google.com with SMTP id 4so1001610qwk.12 for ; Mon, 14 Sep 2009 14:48:55 -0700 (PDT) Received: by 10.224.113.210 with SMTP id b18mr5697017qaq.354.1252964935314; Mon, 14 Sep 2009 14:48:55 -0700 (PDT) Received: from localhost.localdomain ([128.119.194.104]) by mx.google.com with ESMTPS id 20sm2140955qyk.9.2009.09.14.14.48.52 (version=SSLv3 cipher=RC4-MD5); Mon, 14 Sep 2009 14:48:53 -0700 (PDT) From: Ben Gamari To: Jesse Barnes , Chris Wilson Date: Mon, 14 Sep 2009 17:48:41 -0400 Message-Id: <1252964927-28043-2-git-send-email-bgamari.foss@gmail.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1252964927-28043-1-git-send-email-bgamari.foss@gmail.com> References: <1252964927-28043-1-git-send-email-bgamari.foss@gmail.com> Cc: intel-gfx@lists.freedesktop.org Subject: [Intel-gfx] [PATCH 1/8] drm/i915: Check whether chip is wedged in i915_wait_request() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org i915_wait_request() only checks mm.wedged after it interacts with the hardware, generally causing the driver to lock up waiting for a wedged chip. Make sure we check mm.wedged as the first thing we do. Signed-off-by: Ben Gamari --- drivers/gpu/drm/i915/i915_gem.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index e0da986..9100513 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1751,6 +1751,9 @@ i915_wait_request(struct drm_device *dev, uint32_t seqno) BUG_ON(seqno == 0); + if (dev_priv->mm.wedged) + return -EIO; + if (!i915_seqno_passed(i915_get_gem_seqno(dev), seqno)) { if (IS_IGDNG(dev)) ier = I915_READ(DEIER) | I915_READ(GTIER);