From patchwork Tue Jan 3 11:05:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9494725 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 AF47160405 for ; Tue, 3 Jan 2017 11:06:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D461268AE for ; Tue, 3 Jan 2017 11:06:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9066F26BE9; Tue, 3 Jan 2017 11:06:04 +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=unavailable 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 3354C268AE for ; Tue, 3 Jan 2017 11:06:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 559716E565; Tue, 3 Jan 2017 11:05:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@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 BFCCD6E0B9; Tue, 3 Jan 2017 11:05:39 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id m203so85983910wma.3; Tue, 03 Jan 2017 03:05:39 -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=NUhUyOn9ceNfyxVqz9howAioGxVRxlSZhiXyfmPuez0=; b=hADIG1JsKtZTeZVokPYpxnmYwEQHx7DQR8FON/49/ajbv3Aie2H3Fr7lg2Vwe3um7V INb8r8ECq92EA2enC+x13bLk2dgDyPMkiLoSPe/J6AD7gn2BIOjczIeoc55WGRdjAEik 1yMitnkkHtzUJQIusIBVu9hB98NvVrBN/PDwZPkFe9q2awrq7q78BwmrQuN6cIe47sgF r8bvZzlDdG8NCBVGPtAh//0bFb2T0HFAJaQJ6XgAzCPwwSwLUvppA/V7jbhbfjjkV5ma x2cUsOJs/ZIoUryWSo9NNTTf5mPxcF0Be0pFtoX3rw0GRrEHiAUDKnmwEhxC9uYRGaIt G63Q== 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=NUhUyOn9ceNfyxVqz9howAioGxVRxlSZhiXyfmPuez0=; b=uB4j02w8tbcBdX63raq97fM2nsS91Q8B33sL6uZoPV6fyNSvYw6FnzQr9g10nvFuVI /aLWdy6VT1VwwSzd+ttLtwILxwxQ0yRT9MlyaMWpsMlIVSHm1UprSJKqWIAzsNes6ypT 1CtLAZpC43IULAd4jH+Bx/es8wkoUGsCYK5Mu53Gnu9VvfnzXyKG+wpzt7z54VJQqofj ya6VRDyP6TXTqAyS1yHJZAGS/FlS+w0Vj2GJe/qRfqTNhy2HkPKmR9CQ0Y1E1ekfNrR/ 4qFQDXtcX7pH4xxG/kZoXkraYsXBMH+zVexiDxFgz3DVyrVcmspUlgoemPbNmBeEdAxN UMEQ== X-Gm-Message-State: AIkVDXJhT7E57fYGe2jMt93RYqzZM16KRHIvyIAbe0lV+l45M+EJTdiMo5mmfe/Mzcsxig== X-Received: by 10.28.54.145 with SMTP id y17mr49565738wmh.12.1483441537932; Tue, 03 Jan 2017 03:05:37 -0800 (PST) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id o132sm88999068wmo.17.2017.01.03.03.05.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jan 2017 03:05:37 -0800 (PST) From: Chris Wilson To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/i915: Set guilty-flag on fence after detecting a hang Date: Tue, 3 Jan 2017 11:05:33 +0000 Message-Id: <20170103110533.31880-2-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170103110533.31880-1-chris@chris-wilson.co.uk> References: <20170103110533.31880-1-chris@chris-wilson.co.uk> Cc: Mika Kuoppala , intel-gfx@lists.freedesktop.org, Tvrtko Ursulin X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The struct dma_fence carries a status field exposed to userspace by sync_file. This is inspected after the fence is signaled and can convey whether or not the request completed successfully, or in our case if we detected a hang during the request (signaled via -EIO in SYNC_IOC_FILE_INFO). Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Mika Kuoppala --- drivers/gpu/drm/i915/i915_gem.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 204c4a673bf3..bc99c0e292d8 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2757,10 +2757,12 @@ static void i915_gem_reset_engine(struct intel_engine_cs *engine) ring_hung = false; } - if (ring_hung) + if (ring_hung) { i915_gem_context_mark_guilty(request->ctx); - else + request->fence.status = -EIO; + } else { i915_gem_context_mark_innocent(request->ctx); + } if (!ring_hung) return;