[PATCH v3 05/11] drm/xe: Taint TLB invalidation seqno lock with GFP_KERNEL

Matthew Brost
2026-01-12T23:27:41Z

Taint TLB invalidation seqno lock with GFP_KERNEL as TLB invalidations
can be in the path of reclaim (e.g., MMU notifiers).

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matt Atwood <matthew.s.atwood@intel.com>
---
drivers/gpu/drm/xe/xe_tlb_inval.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_tlb_inval.c b/drivers/gpu/drm/xe/xe_tlb_inval.c
index dec042248164..014a78502fe5 100644
--- a/drivers/gpu/drm/xe/xe_tlb_inval.c
+++ b/drivers/gpu/drm/xe/xe_tlb_inval.c
@@ -114,6 +114,16 @@ static void tlb_inval_fini(struct drm_device *drm, void *arg)
xe_tlb_inval_reset(tlb_inval);
}

+static void primelockdep(struct xe_tlb_inval *tlb_inval)
+{
+ if (!IS_ENABLED(CONFIG_LOCKDEP))
+ return;
+
+ fs_reclaim_acquire(GFP_KERNEL);
+ might_lock(&tlb_inval->seqno_lock);
+ fs_reclaim_release(GFP_KERNEL);
+}
+
/**
* xe_gt_tlb_inval_init - Initialize TLB invalidation state
* @gt: GT structure
@@ -140,6 +150,8 @@ int xe_gt_tlb_inval_init_early(struct xe_gt *gt)
if (err)
return err;

+ primelockdep(tlb_inval);
+
tlb_inval->job_wq = drmm_alloc_ordered_workqueue(&xe->drm,
"gt-tbl-inval-job-wq",
WQ_MEM_RECLAIM);
--
2.34.1