Commit da0ef77e authored by Chris Wilson's avatar Chris Wilson

drm/i915/execlists: Fixup cancel_port_requests()

I rushed a last minute correction to cancel_port_requests() to prevent
the snooping of *execlists->active as the inflight array was being
updated, without noticing we iterated the inflight array starting from
active! Oops.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=112387
Fixes: 331bf905 ("drm/i915/gt: Mark the execlists->active as the primary volatile access")
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarAndi Shyti <andi.shyti@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191125112520.1760492-1-chris@chris-wilson.co.uk
parent 331bf905
...@@ -2007,19 +2007,17 @@ static void execlists_dequeue(struct intel_engine_cs *engine) ...@@ -2007,19 +2007,17 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
static void static void
cancel_port_requests(struct intel_engine_execlists * const execlists) cancel_port_requests(struct intel_engine_execlists * const execlists)
{ {
struct i915_request * const *port, *rq; struct i915_request * const *port;
for (port = execlists->pending; (rq = *port); port++) for (port = execlists->pending; *port; port++)
execlists_schedule_out(rq); execlists_schedule_out(*port);
memset(execlists->pending, 0, sizeof(execlists->pending)); memset(execlists->pending, 0, sizeof(execlists->pending));
/* Mark the end of active before we overwrite *active */ /* Mark the end of active before we overwrite *active */
WRITE_ONCE(execlists->active, execlists->pending); for (port = xchg(&execlists->active, execlists->pending); *port; port++)
execlists_schedule_out(*port);
for (port = execlists->active; (rq = *port); port++) WRITE_ONCE(execlists->active,
execlists_schedule_out(rq); memset(execlists->inflight, 0, sizeof(execlists->inflight)));
execlists->active =
memset(execlists->inflight, 0, sizeof(execlists->inflight));
} }
static inline void static inline void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment