From patchwork Thu Feb 2 15:13:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9552255 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 CE3F660236 for ; Thu, 2 Feb 2017 15:13:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD46428304 for ; Thu, 2 Feb 2017 15:13:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C21EE28425; Thu, 2 Feb 2017 15:13:36 +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 830DC28304 for ; Thu, 2 Feb 2017 15:13:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4AF8A6EA53; Thu, 2 Feb 2017 15:13:34 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wj0-x242.google.com (mail-wj0-x242.google.com [IPv6:2a00:1450:400c:c01::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id ABF726EA53 for ; Thu, 2 Feb 2017 15:13:32 +0000 (UTC) Received: by mail-wj0-x242.google.com with SMTP id le4so1336903wjb.0 for ; Thu, 02 Feb 2017 07:13:32 -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=YIjtXRP6lmNfcDnwl076KOvYcZFBg1XG+BtHZp16Osc=; b=ae1rvYJp5obijSSQNou4CQGYOlAD+0j0qAjrFE0EznqreepNoCorPp/bYZFYarQqa5 XChZMEQjWsCdrj500QVGGSUbKFzH8hBrrwJVB/DiOjcgwdMeHiJaY6Y1NLdRE8SUHWzi XPdn/3Ti/1JXk6ecbqa9qmTCuc5uRr+Igv8i9ViS4zp8lFf4/8M5wItO3H8piWKO5Woh Ee9PkPdcxI1zx9HJEjIIW2F6dkKa4JtQDdmBZHhR+5CrlwV1itaDdE+r5+BQjZD/wtHH 1d+JcnEXSzDOyBSCxrtthsxwkrw1/29IfkapPZ8BuqL/EFQbp/pGbVLNZnObwZ6dr5b5 2Wug== 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=YIjtXRP6lmNfcDnwl076KOvYcZFBg1XG+BtHZp16Osc=; b=ZA/9LFFaZiCXroEDkl+KaQrkHMpyCdYiWLV+mHPEL8GC14uNyhWpgZhZo7DqPLbymh sNPn2mwSYio2j7V8YIgBHnruyahRO0SHcmVXr5dW+Wp8CWmCKErmgBU1Cju2ITmZnbh6 jxFgFOYfrfE86wvbAqavJBY6/K6Cimt5QRTB2z215yW79FNGRWijsDtqLcseRI1zb0oX /VveZuBsecRiogR+f+qh1/92s6Y3r1F4nnBFJA12AcUFN+rbLzrrkAz319dDuaogll05 Sa1rv6gEI9ryutmqdq+V9i0M8NlTB/Su+Dkzm6+o9cxnOvb6KnYNoUQMvb5H6tSmsMif 3iSQ== X-Gm-Message-State: AIkVDXLf4oMBSapXBAv+oWojtQVLtofgZ0/YzDcMJUswFs7/aprpOob7/DD6C2D2v46aiw== X-Received: by 10.223.133.4 with SMTP id 4mr8102524wrh.176.1486048411040; Thu, 02 Feb 2017 07:13:31 -0800 (PST) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id o81sm3624020wmb.14.2017.02.02.07.13.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Feb 2017 07:13:30 -0800 (PST) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Thu, 2 Feb 2017 15:13:11 +0000 Message-Id: <20170202151312.31406-13-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170202151312.31406-1-chris@chris-wilson.co.uk> References: <20170202151312.31406-1-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [PATCH 13/14] drm/i915: Immediately process a reset before starting waiting 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 handoff the GPU reset to the waiter, we need to check we don't miss a wakeup if it has already been sent prior to us starting the wait. Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/i915_gem_request.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c index 71ae3dc443d8..bfdb1013da7d 100644 --- a/drivers/gpu/drm/i915/i915_gem_request.c +++ b/drivers/gpu/drm/i915/i915_gem_request.c @@ -1063,8 +1063,10 @@ long i915_wait_request(struct drm_i915_gem_request *req, trace_i915_gem_request_wait_begin(req); add_wait_queue(&req->execute, &exec); - if (flags & I915_WAIT_LOCKED) + if (flags & I915_WAIT_LOCKED) { add_wait_queue(errq, &reset); + __i915_reset_request(req); + } wait.tsk = current; @@ -1099,7 +1101,8 @@ long i915_wait_request(struct drm_i915_gem_request *req, goto complete; set_current_state(state); - if (intel_engine_add_wait(req->engine, &wait)) + if (intel_engine_add_wait(req->engine, &wait) || + flags & I915_WAIT_LOCKED) /* In order to check that we haven't missed the interrupt * as we enabled it, we need to kick ourselves to do a * coherent check on the seqno before we sleep.