Skip to content

Commit

Permalink
drm/i915/guc: Unwind context requests in reverse order
Browse files Browse the repository at this point in the history
When unwinding requests on a reset context, if other requests in the
context are in the priority list the requests could be resubmitted out
of seqno order. Traverse the list of active requests in reverse and
append to the head of the priority list to fix this.

Fixes: eb5e7da ("drm/i915/guc: Reset implementation for new GuC interface")
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210909164744.31249-4-matthew.brost@intel.com
  • Loading branch information
Matthew Brost authored and John Harrison committed Sep 13, 2021
1 parent 669b949 commit c39f51c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,9 +806,9 @@ __unwind_incomplete_requests(struct intel_context *ce)

spin_lock_irqsave(&sched_engine->lock, flags);
spin_lock(&ce->guc_active.lock);
list_for_each_entry_safe(rq, rn,
&ce->guc_active.requests,
sched.link) {
list_for_each_entry_safe_reverse(rq, rn,
&ce->guc_active.requests,
sched.link) {
if (i915_request_completed(rq))
continue;

Expand All @@ -825,7 +825,7 @@ __unwind_incomplete_requests(struct intel_context *ce)
}
GEM_BUG_ON(i915_sched_engine_is_empty(sched_engine));

list_add_tail(&rq->sched.link, pl);
list_add(&rq->sched.link, pl);
set_bit(I915_FENCE_FLAG_PQUEUE, &rq->fence.flags);

spin_lock(&ce->guc_active.lock);
Expand Down

0 comments on commit c39f51c

Please sign in to comment.