From: John Harrison <[email protected]>

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.

Potentially that means the request could be signalled before anyone is
ready to receive the signal and thus lead to a deadlock where the
driver is now waiting for a signal that will never arrive because it
has already missed it. Certainly it will lead to the BUG in
nested_enable_signaling() firing complaining that the request has
already been signaled.

This patch reverses the order. Signaling is now enabled before sending
the request to the GuC.

Signed-off-by: John Harrison <[email protected]>
---
 drivers/gpu/drm/i915/i915_guc_submission.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c 
b/drivers/gpu/drm/i915/i915_guc_submission.c
index ff82f0561ec1..edf29758f35a 100644
--- a/drivers/gpu/drm/i915/i915_guc_submission.c
+++ b/drivers/gpu/drm/i915/i915_guc_submission.c
@@ -721,7 +721,6 @@ static bool i915_guc_dequeue(struct intel_engine_cs *engine)
                        }
 
                        i915_gem_request_assign(&port->request, last);
-                       nested_enable_signaling(last);
                        port++;
                }
 
@@ -749,6 +748,7 @@ static bool i915_guc_dequeue(struct intel_engine_cs *engine)
                        }
 #endif
                }
+               nested_enable_signaling(rq);
                i915_guc_submit(rq);
                trace_i915_gem_request_in(rq, port - engine->execlist_port);
                last = rq;
@@ -758,7 +758,6 @@ static bool i915_guc_dequeue(struct intel_engine_cs *engine)
        }
        if (submit) {
                i915_gem_request_assign(&port->request, last);
-               nested_enable_signaling(last);
                engine->execlist_first = rb;
        }
 out:
-- 
2.13.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to