From patchwork Fri Apr 6 12:25:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 10325949 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 5738A6053F for ; Fri, 6 Apr 2018 12:26:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47E952930F for ; Fri, 6 Apr 2018 12:26:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BF7D2931C; Fri, 6 Apr 2018 12:26:07 +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=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 0FBFC2930F for ; Fri, 6 Apr 2018 12:26:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F1F506E460; Fri, 6 Apr 2018 12:26:04 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (mail.fireflyinternet.com [109.228.58.192]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1FDAC6E460 for ; Fri, 6 Apr 2018 12:26:02 +0000 (UTC) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from localhost (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP (TLS) id 11284038-1500050 for multiple; Fri, 06 Apr 2018 13:25:50 +0100 MIME-Version: 1.0 To: Sagar Arun Kamble , intel-gfx@lists.freedesktop.org From: Chris Wilson In-Reply-To: <614c0337-2979-12cb-0c62-ea7f66835952@intel.com> References: <20180405110220.27008-1-chris@chris-wilson.co.uk> <20180405110220.27008-4-chris@chris-wilson.co.uk> <614c0337-2979-12cb-0c62-ea7f66835952@intel.com> Message-ID: <152301754847.28413.2797600546019323260@mail.alporthouse.com> User-Agent: alot/0.3.6 Date: Fri, 06 Apr 2018 13:25:48 +0100 Subject: Re: [Intel-gfx] [PATCH 4/4] drm/i915: Park before resetting the submission backend X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Quoting Sagar Arun Kamble (2018-04-05 12:54:38) > > > On 4/5/2018 4:32 PM, Chris Wilson wrote: > > As different backends may have different park/unpark callbacks, we > > should only ever switch backends (reset_default_submission on wedge > > recovery, or on enabling the guc) while parked. > > > > Signed-off-by: Chris Wilson > > Cc: Michal Wajdeczko > > Cc: Sagar Arun Kamble > > Cc: Tvrtko Ursulin > > Cc: Mika Kuoppala > > --- > > drivers/gpu/drm/i915/i915_gem.c | 11 +++++++++++ > > drivers/gpu/drm/i915/intel_engine_cs.c | 3 +++ > > drivers/gpu/drm/i915/intel_guc_submission.c | 1 + > > 3 files changed, 15 insertions(+) > > > > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c > > index e148db310ea6..e2880de2fc7e 100644 > > --- a/drivers/gpu/drm/i915/i915_gem.c > > +++ b/drivers/gpu/drm/i915/i915_gem.c > > @@ -3380,6 +3380,17 @@ bool i915_gem_unset_wedged(struct drm_i915_private *i915) > > i915_retire_requests(i915); > > GEM_BUG_ON(i915->gt.active_requests); > > > > + /* > > + * Park before disengaging the old submit mechanism as different > > + * backends may have different park/unpack callbacks. > > + * > > + * We are idle; the idle-worker will be queued, but we need to run > > + * it now. As we already hold the struct mutex, we can get park > > + * the GPU right away, letting the lazy worker see that we are > > + * already active again by the time it acquires the mutex. > > + */ > > + i915_gem_park(i915); > I think we should be calling this before gem_unset_wedged in i915_reset. > With GuC, hitting the GEM_BUG_ON(awake) in guc_submission_enable. Right, we really do need to restore guc submission before restarting. So how can we fit in something like ? -Chris diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 9650a7b10c5f..95fa30d9aec6 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -3132,6 +3132,9 @@ void i915_gem_reset(struct drm_i915_private *dev_priv) i915_retire_requests(dev_priv); + if (USES_GUC_SUBMISSION(dev_priv)) + (void)intel_guc_submission_enable(guc); + for_each_engine(engine, dev_priv, id) { struct i915_gem_context *ctx;