From patchwork Tue Jan 22 11:53:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 2018171 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 984C33FCDE for ; Tue, 22 Jan 2013 11:56:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 23506E6222 for ; Tue, 22 Jan 2013 03:56:09 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (smtp.fireflyinternet.com [109.228.6.236]) by gabe.freedesktop.org (Postfix) with ESMTP id BE69DE5C1E for ; Tue, 22 Jan 2013 03:56:01 -0800 (PST) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.73.22; Received: from arrandale.alporthouse.com (unverified [78.156.73.22]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 128188054-1500050 for multiple; Tue, 22 Jan 2013 11:55:51 +0000 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Tue, 22 Jan 2013 11:53:30 +0000 Message-Id: <1358855610-12937-1-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 1.7.10.4 X-Originating-IP: 78.156.73.22 Subject: [Intel-gfx] [PATCH] drm/i915: Run hangcheck if we timeout whilst waiting for a seqno X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 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+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org As a precaution against the driver fouling up and missing a hang leaving the caller in an indefinite wait, manually inspect for a GPU hang if we timeout whilst waiting for a seqno. Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/i915_gem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 0d878c1..54bb921 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1129,6 +1129,9 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno, else end = wait_event_timeout(ring->irq_queue, EXIT_COND, timeout_jiffies); + /* Be paranoid and check that we haven't missed a GPU hang */ + if (end == 0) + i915_hangcheck_elapsed((unsigned long)dev_priv->dev); /* We need to check whether any gpu reset happened in between * the caller grabbing the seqno and now ... */