drm/xe: fix tlb_invalidation_seqno_past()
authorMatthew Auld <matthew.auld@intel.com>
Fri, 5 May 2023 14:49:10 +0000 (15:49 +0100)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 19 Dec 2023 23:33:50 +0000 (18:33 -0500)
commita2db3192115d8cafa3dcae024873957929a4eae0
treecfd67f9ba69a4ddf64241e1c2a9718c72457979f
parent50f1f0591638ec43eb041e27ab5e4eae47882cbc
drm/xe: fix tlb_invalidation_seqno_past()

Checking seqno_recv >= seqno looks like it will incorrectly report true
when the seqno has wrapped (not unlikely given
TLB_INVALIDATION_SEQNO_MAX). Calling xe_gt_tlb_invalidation_wait() might
then return before the flush has been completed by the GuC.

Fix this by treating a large negative delta as an indication that the
seqno has wrapped around. Similar to how we treat a large positive delta
as an indication that the seqno_recv must have wrapped around, but in
that case the seqno has likely also signalled.

It looks like we could also potentially make the seqno use the full
32bits as supported by the GuC.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c