From patchwork Sat Dec 31 12:06:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9492717 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AB12E62ABB for ; Sat, 31 Dec 2016 12:12:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EF93252D5 for ; Sat, 31 Dec 2016 12:12:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71DFE25D9E; Sat, 31 Dec 2016 12:12:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AD2FA252D5 for ; Sat, 31 Dec 2016 12:12:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DDB546E2FF; Sat, 31 Dec 2016 12:12:39 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id ABDEB6E2F5 for ; Sat, 31 Dec 2016 12:07:27 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id l2so49523402wml.2 for ; Sat, 31 Dec 2016 04:07:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=dsmNTjSTeUvSb+tXi6lvPhCSL7fKpCzgxlirbvjkgb4=; b=IKwrx5oRr9Q3qxq5HpPCXJDCtbPOpfbud6v34Pm3ErfrrdQhx0E21G550tsrPzLmX6 RPsE1OKPV5oNCvHqbIsYf9C6SivgI5n1ojBVSKyEKL4r64y43kQ5UDfLKS608sjLrfvM A58hVdFTqNf9mu30KwprHHigTSdhEixTf5ZSCWqyQhvtyIcuPkVCEN2aq4QdYgyUVoMy pJ4tT693L0qkC8m2z1C8vObNppSiXKqsOvjPxccC89acuQPGOdY/uSnA8E2JpBMpQpI/ IrZLEsdKPCrP5KvUmfw4PUjKA0r5ZbdEhS31Dar+L8MeQP4uFAlLMxguOHI6/mv3Tvpi TRfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=dsmNTjSTeUvSb+tXi6lvPhCSL7fKpCzgxlirbvjkgb4=; b=lWqZdwzemvcJs2fsDsO67CnO7jnUns8fMeW3Zjoi/iFV5XjrHxblb6D0xGlnj4IJUO zYZv4xjlEFcp5o9hrVLDnEGOCNvrlM2K+VfVrZ8aOqHygsos/rcpdoHQV5RPhs9ASy+A 6u1D6Z+c/jFpna/61Pfuc006RHRisg/6EDRY9Cd2+kCgmmk6pJ65nKz/ZR+UE4QXC81E WGTnzJltzNFRvqBMLdSmu5yoAeRCpzK6ypf9ocwbvbaYSSBDa2kCktslbgvjdxZcuqRQ g7iXf/wQpjMjtkK10/x14wflIgt/NHlbNa8gzCwOxtXtv6exb90RqbG0KPwQl9pqr9ST id4w== X-Gm-Message-State: AIkVDXLQaiTjvMvxgeXVB9emMv+DHE2coGTtoH3CTeZu4qE+afB1+U5n1Bh66Fd1zwwDjw== X-Received: by 10.28.225.138 with SMTP id y132mr43336816wmg.52.1483186045503; Sat, 31 Dec 2016 04:07:25 -0800 (PST) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id c81sm74411987wmf.22.2016.12.31.04.07.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 31 Dec 2016 04:07:24 -0800 (PST) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Sat, 31 Dec 2016 12:06:59 +0000 Message-Id: <20161231120702.21204-24-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161231120702.21204-1-chris@chris-wilson.co.uk> References: <20161231120702.21204-1-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [PATCH 23/26] drm/i915: Construct a request even if the GPU is currently hung X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP As we now have the ability to directly reset the GPU from the waiter (and so do not need to drop the lock in order to let the reset proceed) and also do not lose requests over a reset, we can now simply queue the request to occur after the reset rather than roundtripping to userspace (or worse failing with EIO). Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/i915_gem_request.c | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c index 99056b948eda..ed76e7ecf9e2 100644 --- a/drivers/gpu/drm/i915/i915_gem_request.c +++ b/drivers/gpu/drm/i915/i915_gem_request.c @@ -307,26 +307,6 @@ void i915_gem_request_retire_upto(struct drm_i915_gem_request *req) } while (tmp != req); } -static int i915_gem_check_wedge(struct drm_i915_private *dev_priv) -{ - struct i915_gpu_error *error = &dev_priv->gpu_error; - - if (i915_terminally_wedged(error)) - return -EIO; - - if (i915_reset_in_progress(error)) { - /* Non-interruptible callers can't handle -EAGAIN, hence return - * -EIO unconditionally for these. - */ - if (!dev_priv->mm.interruptible) - return -EIO; - - return -EAGAIN; - } - - return 0; -} - static int i915_gem_init_global_seqno(struct drm_i915_private *i915, u32 seqno) { struct i915_gem_timeline *timeline = &i915->gt.global_timeline; @@ -521,12 +501,10 @@ i915_gem_request_alloc(struct intel_engine_cs *engine, lockdep_assert_held(&dev_priv->drm.struct_mutex); /* ABI: Before userspace accesses the GPU (e.g. execbuffer), report - * EIO if the GPU is already wedged, or EAGAIN to drop the struct_mutex - * and restart. + * EIO if the GPU is already wedged. */ - ret = i915_gem_check_wedge(dev_priv); - if (ret) - return ERR_PTR(ret); + if (i915_terminally_wedged(&dev_priv->gpu_error)) + return ERR_PTR(-EIO); /* Pinning the contexts may generate requests in order to acquire * GGTT space, so do this first before we reserve a seqno for