From patchwork Sun Sep 13 14:50:57 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Gamari X-Patchwork-Id: 47150 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 n8DEwk4d032434 for ; Sun, 13 Sep 2009 14:58:46 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7734D9E8CC; Sun, 13 Sep 2009 07:58:46 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qy0-f200.google.com (mail-qy0-f200.google.com [209.85.221.200]) by gabe.freedesktop.org (Postfix) with ESMTP id 6F94A9E765 for ; Sun, 13 Sep 2009 07:58:43 -0700 (PDT) Received: by mail-qy0-f200.google.com with SMTP id 38so1884003qyk.27 for ; Sun, 13 Sep 2009 07:58:43 -0700 (PDT) Received: by 10.224.74.146 with SMTP id u18mr4411216qaj.67.1252853477544; Sun, 13 Sep 2009 07:51:17 -0700 (PDT) Received: from localhost.localdomain (c-24-63-135-98.hsd1.ma.comcast.net [24.63.135.98]) by mx.google.com with ESMTPS id 2sm4219036qwi.36.2009.09.13.07.51.15 (version=SSLv3 cipher=RC4-MD5); Sun, 13 Sep 2009 07:51:16 -0700 (PDT) From: Ben Gamari To: Jesse Barnes , Chris Wilson , Eric Anholt Date: Sun, 13 Sep 2009 10:50:57 -0400 Message-Id: <1252853462-9236-2-git-send-email-bgamari.foss@gmail.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1252853462-9236-1-git-send-email-bgamari.foss@gmail.com> References: <1252853462-9236-1-git-send-email-bgamari.foss@gmail.com> Cc: intel-gfx@lists.freedesktop.org Subject: [Intel-gfx] [PATCH 1/6] 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);