From patchwork Tue Oct 4 20:11:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9362249 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 F3A96607D8 for ; Tue, 4 Oct 2016 20:11:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5B3F28861 for ; Tue, 4 Oct 2016 20:11:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA40C28B57; Tue, 4 Oct 2016 20:11:48 +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 983C828861 for ; Tue, 4 Oct 2016 20:11:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 243B1890BD; Tue, 4 Oct 2016 20:11:45 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id B23466E741 for ; Tue, 4 Oct 2016 20:11:42 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id b184so21347232wma.3 for ; Tue, 04 Oct 2016 13:11:42 -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=IP9CUs/XBrSK+5wCuihAx8QLPDiIabAYGtPaf7hPhlM=; b=CFYYY5P1sLNQtwosyDIzde6mWwUkEoExAnwbfqiAiJcxPrdDTVSgUD7kpBIjynh+Gc av2zql7YTIsasOFG+tqztW8xa/oRK2vX3nLXKaW97WB7+0AAK2j+7vuJ7WMx5g6ibl5a RQKBNPkh73fuvtCFbkSYLhftqoXjVwsE4oPw1S3jwoTqhU+hMAdYfb3qGbjfDJoG0PMj m8GnwbX/3k/zU25AJ8ho4NimXslYvzcnhwiqyeDvE8gi4ifA8XBTdRrMW+lSc5CYml1T l05hXlGQzRv7EDZzhpUV7SehwXT66b0YM5z8f783NdPYMPptf425DnAFxy+F0BHgMAx4 rhQg== 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=IP9CUs/XBrSK+5wCuihAx8QLPDiIabAYGtPaf7hPhlM=; b=LcJKje4NY3EbS/SCzCrBhs0s3Hz1rRt25oLw5GQAXoxakxcv205nh8vhJi9G49w2KW OYlNez/Rk46grvo7KaAlZaBz9L/jJOD5njpiRvd0VRMO9dCvoG4tMy1IGPAo81+Hb+CR vA0+INCbORyjP30CV/AUrPD1mHNFM2XXZxAw9C9lHc7TDTOt9SMIIyXdCEH095fzkz2M uOCHNlZIjiuRQoO3r0yInTf9KPAJxeb61mwNB2USBugtFJzH/jLhjq7E4bfshl8QH662 Ppe/JiJEGLydPKnQGsK0+GRN0FWTrC08vULP6gxVIOt8vAThZxyLLGKsFvlxhZKvWjE8 UzhQ== X-Gm-Message-State: AA6/9RmFlvxirBPu/jZc2d9fv8DVQysgTt4vrOToQ4gDfNPchMNTWUcUIs8CFDUlqn0xKQ== X-Received: by 10.28.87.16 with SMTP id l16mr5156721wmb.75.1475611901085; Tue, 04 Oct 2016 13:11:41 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id b8sm5173969wjq.40.2016.10.04.13.11.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Oct 2016 13:11:40 -0700 (PDT) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Tue, 4 Oct 2016 21:11:27 +0100 Message-Id: <20161004201132.21801-3-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161004201132.21801-1-chris@chris-wilson.co.uk> References: <20161004201132.21801-1-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [CI 3/8] drm/i915/execlists: Move clearing submission count from reset to init 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 After a GPU reset, we want to replay our queue of requests. However, the GPU reset clobbered the state and we only fixup the state for the guilty request - and engines deemed innocent we try to leave untouched so that we recover as completely as possible. However, we need to clear the sw tracking of the ELSP ports even for innocent requests, so move the clear to the common path of init_hw (from reset_hw). Reported-by: Mika Kuoppala Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala --- drivers/gpu/drm/i915/intel_lrc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 0ea992ba2723..936f6f63f626 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -1242,8 +1242,12 @@ static int gen8_init_common_ring(struct intel_engine_cs *engine) intel_engine_init_hangcheck(engine); - if (!execlists_elsp_idle(engine)) + /* After a GPU reset, we may have requests to replay */ + if (!execlists_elsp_idle(engine)) { + engine->execlist_port[0].count = 0; + engine->execlist_port[1].count = 0; execlists_submit_ports(engine); + } return 0; } @@ -1318,10 +1322,7 @@ static void reset_common_ring(struct intel_engine_cs *engine, memset(&port[1], 0, sizeof(port[1])); } - /* CS is stopped, and we will resubmit both ports on resume */ GEM_BUG_ON(request->ctx != port[0].request->ctx); - port[0].count = 0; - port[1].count = 0; /* Reset WaIdleLiteRestore:bdw,skl as well */ request->tail = request->wa_tail - WA_TAIL_DWORDS * sizeof(u32);