From patchwork Fri May 13 10:57:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9090361 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5123EBF440 for ; Fri, 13 May 2016 10:57:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 745A32012D for ; Fri, 13 May 2016 10:57:37 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8BFD12021A for ; Fri, 13 May 2016 10:57:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 584776E08A; Fri, 13 May 2016 10:57:34 +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 196666E08A for ; Fri, 13 May 2016 10:57:33 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id n129so2929000wmn.1 for ; Fri, 13 May 2016 03:57:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=p9PW6vHQOx/1WC0vi3epMGAJpdk6zhbEy/6xdhZ5AOg=; b=wL85WsiM37xJy4xqx530FUcggFo6YzJKWwhGkRGoWKujQ9FUFcDlc4VZWKiP/5LEco NTce++hQ1gGY+18jpZv3XEmHbitwTY7Dz4PwDuou/SsfXrQdNRkipf1AqC5NkDjmD37l rCrNbZcSjVqlWy75QoTS44Dp2iNyhvNdPg7/uTmVCvRr0zm/Dn8gnbaWGLLsViOJbGkh 21yCcGgETf9tceDmues7GmPkZydUIdDUZUrb1JuHXjsoWHVBpnokC0BITnWGd3EhxVNo yEUlCKlXp1W6+/LYgYqHoqVkaw2aOMIVLqKMRksQLuLBTYfLn4UA9mCN1/WKbvm9wbuV 492g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=p9PW6vHQOx/1WC0vi3epMGAJpdk6zhbEy/6xdhZ5AOg=; b=fK3D4XvkPBLZEmkQLs+Dr4/Vh0Vzd1bDDKoFe00OpL+GScrcePfImcl33bM7XNIXTV 2zLjcQcxSFiVK9y0W6i81J/4odBWE/JkoDEFBEZOA/IGfKkPDWWv7p5T3WjPGFg7dLAj 3osH+7oX1BGKbsuljf/1fCxYbgmUjeAFo/+nCBUUBTVPo6vdfUmDKljPEWjU8TDCmOoO nPYsMbPfhftFf0pwsDGQjbK+Ye2AgJYPMxRqdK2z7ot8xubpizhO72nsW9zytT0LIivE 8an9/LBkmA/t1tg+iKjDWsCzjC+erl6wfFoonWWsWkWDY40TWnoPWHQ7cwWmjCpCx1Rh fbMw== X-Gm-Message-State: AOPr4FVf0mIrTr0E3c8KXqrEwYCaLSPr4CLN5N0wYSRwKl2mTw1sF7UhwqoP47lBYSWbYw== X-Received: by 10.28.154.2 with SMTP id c2mr3044329wme.9.1463137051660; Fri, 13 May 2016 03:57:31 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id y3sm18020272wji.40.2016.05.13.03.57.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 May 2016 03:57:30 -0700 (PDT) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Fri, 13 May 2016 11:57:22 +0100 Message-Id: <1463137042-9669-4-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1463137042-9669-1-git-send-email-chris@chris-wilson.co.uk> References: <1463137042-9669-1-git-send-email-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [CI 4/4] drm/i915: Stop automatically retiring requests after a GPU hang 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-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 Following a GPU hang, we break out of the request loop in order to unlock the struct_mutex for use by the GPU reset. However, if we retire all the requests at that moment, we cannot identify the guilty request after performing the reset. v2: Not automatically retiring requests forces us to recheck for available ringspace. Fixes: f4457ae71fd6 ("drm/i915: Prevent leaking of -EIO from i915_wait_request()") Testcase: igt/gem_reset_stats/ban-* Signed-off-by: Chris Wilson Cc: Daniel Vetter Cc: Mika Kuoppala Tested-by: Mika Kuoppala Reviewed-by: Mika Kuoppala reset_counter == i915_reset_counter(&dev_priv->gpu_error)) + __i915_gem_request_retire__upto(req); + return 0; } @@ -1519,7 +1522,8 @@ i915_gem_object_retire_request(struct drm_i915_gem_object *obj, else if (obj->last_write_req == req) i915_gem_object_retire__write(obj); - __i915_gem_request_retire__upto(req); + if (req->reset_counter == i915_reset_counter(&req->i915->gpu_error)) + __i915_gem_request_retire__upto(req); } /* A nonblocking variant of the above wait. This is a highly dangerous routine diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 0618dd34c3ec..8d35a3978f9b 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c @@ -2450,6 +2450,8 @@ int intel_ring_begin(struct drm_i915_gem_request *req, int num_dwords) return ret; intel_ring_update_space(ringbuf); + if (unlikely(ringbuf->space < wait_bytes)) + return -EAGAIN; } if (unlikely(need_wrap)) {