]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe: Taint TLB invalidation seqno lock with GFP_KERNEL
authorMatthew Brost <matthew.brost@intel.com>
Fri, 16 Jan 2026 22:17:26 +0000 (14:17 -0800)
committerMatthew Brost <matthew.brost@intel.com>
Sat, 17 Jan 2026 02:24:51 +0000 (18:24 -0800)
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>
Tested-by: Stuart Summers <stuart.summers@intel.com>
Link: https://patch.msgid.link/20260116221731.868657-7-matthew.brost@intel.com
drivers/gpu/drm/xe/xe_tlb_inval.c

index e837888367c4d1ac83e08921cd4ab81e8e33290b..21fef337f29c474cc2125fb265698f86c957f22e 100644 (file)
@@ -111,6 +111,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
@@ -137,6 +147,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);