Skip to content

Commit d8f5053

Browse files
committed
drm/i915/icl: Forcibly evict stale csb entries
Gen11 fails to deliver wrt global observation point on tail/entry updates and we sometimes see old entry. Use clflush to forcibly evict our possibly stale copy of the cacheline in hopes that we get fresh one from gpu. Obviously there is something amiss in the coherency protocol so this can be consired as a workaround until real cause is found. The working hardware will do the evict without our cue anyways, so the cost in there should be ameliorated by that fact. v2: for next pass, s/flush/evict, add reset (Chris) References: https://bugzilla.freedesktop.org/show_bug.cgi?id=108315 Cc: Chris Wilson <[email protected]> Signed-off-by: Mika Kuoppala <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 490b8c6 commit d8f5053

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

drivers/gpu/drm/i915/intel_lrc.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,13 @@ execlists_cancel_port_requests(struct intel_engine_execlists * const execlists)
770770
execlists_clear_all_active(execlists);
771771
}
772772

773+
static inline void
774+
invalidate_csb_entries(const u32 *first, const u32 *last)
775+
{
776+
clflush((void *)first);
777+
clflush((void *)last);
778+
}
779+
773780
static void reset_csb_pointers(struct intel_engine_execlists *execlists)
774781
{
775782
const unsigned int reset_value = GEN8_CSB_ENTRIES - 1;
@@ -785,6 +792,9 @@ static void reset_csb_pointers(struct intel_engine_execlists *execlists)
785792
*/
786793
execlists->csb_head = reset_value;
787794
WRITE_ONCE(*execlists->csb_write, reset_value);
795+
796+
invalidate_csb_entries(&execlists->csb_status[0],
797+
&execlists->csb_status[GEN8_CSB_ENTRIES - 1]);
788798
}
789799

790800
static void nop_submission_tasklet(unsigned long data)
@@ -1020,6 +1030,19 @@ static void process_csb(struct intel_engine_cs *engine)
10201030
} while (head != tail);
10211031

10221032
execlists->csb_head = head;
1033+
1034+
/*
1035+
* Gen11 has proven to fail wrt global observation point between
1036+
* entry and tail update, failing on the ordering and thus
1037+
* we see an old entry in the context status buffer.
1038+
*
1039+
* Forcibly evict out entries for the next gpu csb update,
1040+
* to increase the odds that we get a fresh entries with non
1041+
* working hardware. The cost for doing so comes out mostly with
1042+
* the wash as hardware, working or not, will need to do the
1043+
* invalidation before.
1044+
*/
1045+
invalidate_csb_entries(&buf[0], &buf[GEN8_CSB_ENTRIES - 1]);
10231046
}
10241047

10251048
static void __execlists_submission_tasklet(struct intel_engine_cs *const engine)

0 commit comments

Comments
 (0)