From: John Harrison Subject: Re: [PATCH 1/1] drm/i915: Fix for nested_enable_signaling BUG_ON Date: Tue, 28 Nov 2017 07:38:28 -0800 Message-ID: References: <20171128091059.33709-1-John.C.Harrison@Intel.com> <20171128091059.33709-2-John.C.Harrison@Intel.com> <151186200602.6046.15157037625800016943@mail.alporthouse.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0907263302==" Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id B17F86E668 for ; Tue, 28 Nov 2017 15:38:29 +0000 (UTC) In-Reply-To: <151186200602.6046.15157037625800016943@mail.alporthouse.com> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson , Intel-GFX@Lists.FreeDesktop.Org List-Id: intel-gfx@lists.freedesktop.org This is a multi-part message in MIME format. --===============0907263302== Content-Type: multipart/alternative; boundary="------------6D107C4626552C25EFB68D8B" Content-Language: en-US This is a multi-part message in MIME format. --------------6D107C4626552C25EFB68D8B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 11/28/2017 1:40 AM, Chris Wilson wrote: > Quoting John.C.Harrison@Intel.com (2017-11-28 09:10:59) >> From: John Harrison >> >> The call to enable signaling was occuring after the request had been >> sent to the GuC for execution on the hardware. That means that it is >> possible for the request to actually complete before the code to >> enable signaling has executed. > No, it wasn't, unless you had modified the code. Note also we switched > to a different scheme in upstream > -Chris It was as of: commit d99c1a7aff71536e909f54709023dcc5d6b559c0 Author: Chris Wilson Date:   Thu Mar 16 12:56:18 2017 +0000 drm/i915/scheduler: emulate a scheduler for guc The code introduced was: +               ... +               if (last && rq->ctx != last->ctx) { +                       ... *+                       nested_enable_signaling(last);** * +                       port++; +               } +               ... *+               i915_guc_submit(rq);** *+               last = rq; +               submit = true; +       } +       if (submit) { +               i915_gem_request_assign(&port->request, last); *+               nested_enable_signaling(last);** *+               engine->execlist_first = rb; +       } +       ... That quite definitely calls nested_enable_signaling() after calling i915_guc_submit(). It is either called on the last request submitted for a given context or on the last request submitted overall. But in either case it is only called after the actual submission occurs. Maybe that was not exactly 4.11, there might have been a few more recent patches pulled in to this tree. It is definitely not latest upstream though. And as I noted in the cover letter, moving to latest upstream is not an option for them at this point. John. --------------6D107C4626552C25EFB68D8B Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 11/28/2017 1:40 AM, Chris Wilson wrote:
Quoting John.C.Harrison@Intel.com (2017-11-28 09:10:59)
From: John Harrison <John.C.Harrison@Intel.com>

The call to enable signaling was occuring after the request had been
sent to the GuC for execution on the hardware. That means that it is
possible for the request to actually complete before the code to
enable signaling has executed.
No, it wasn't, unless you had modified the code. Note also we switched
to a different scheme in upstream
-Chris

It was as of:
commit d99c1a7aff71536e909f54709023dcc5d6b559c0
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Mar 16 12:56:18 2017 +0000

drm/i915/scheduler: emulate a scheduler for guc

The code introduced was:
+               ...
+               if (last && rq->ctx != last->ctx) {
+                       ...
+                       nested_enable_signaling(last);
+                       port++;
+               }
+               ...
+               i915_guc_submit(rq);
+               last = rq;
+               submit = true;
+       }
+       if (submit) {
+               i915_gem_request_assign(&port->request, last);
+               nested_enable_signaling(last);
+               engine->execlist_first = rb;
+       }
+       ...

That quite definitely calls nested_enable_signaling() after calling i915_guc_submit(). It is either called on the last request submitted for a given context or on the last request submitted overall. But in either case it is only called after the actual submission occurs.

Maybe that was not exactly 4.11, there might have been a few more recent patches pulled in to this tree. It is definitely not latest upstream though. And as I noted in the cover letter, moving to latest upstream is not an option for them at this point.

John.

--------------6D107C4626552C25EFB68D8B-- --===============0907263302== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============0907263302==--