]> www.infradead.org Git - users/hch/configfs.git/commitdiff
drm/xe/xe2: Make subsequent L2 flush sequential
authorTejas Upadhyay <tejas.upadhyay@intel.com>
Wed, 10 Jul 2024 05:27:50 +0000 (10:57 +0530)
committerNirmoy Das <nirmoy.das@intel.com>
Thu, 11 Jul 2024 10:36:55 +0000 (12:36 +0200)
Issuing the flush on top of an ongoing flush is not desirable.
Lets use lock to make it sequential.

Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240710052750.3031586-1-tejas.upadhyay@intel.com
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
drivers/gpu/drm/xe/xe_device.c
drivers/gpu/drm/xe/xe_gt.c
drivers/gpu/drm/xe/xe_gt_types.h

index 64aea962afd5ff18d6b48541c96683b8a067c448..06cebaffb45134dd46852ea1d093cde09c8d434d 100644 (file)
@@ -833,10 +833,12 @@ void xe_device_l2_flush(struct xe_device *xe)
        if (err)
                return;
 
+       spin_lock(&gt->global_invl_lock);
        xe_mmio_write32(gt, XE2_GLOBAL_INVAL, 0x1);
 
        if (xe_mmio_wait32(gt, XE2_GLOBAL_INVAL, 0x1, 0x0, 150, NULL, true))
                xe_gt_err_once(gt, "Global invalidation timeout\n");
+       spin_unlock(&gt->global_invl_lock);
 
        xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
 }
index b04e47186f5b73b9530d736a660cfa6cc2148882..85f974441d50472f689837757dfd226dcdd1c6a9 100644 (file)
@@ -387,6 +387,7 @@ int xe_gt_init_early(struct xe_gt *gt)
 
        xe_force_wake_init_gt(gt, gt_to_fw(gt));
        xe_pcode_init(gt);
+       spin_lock_init(&gt->global_invl_lock);
 
        return 0;
 }
index 6b5e0b45efb0c929218f988146983630c252fbc9..38a0d0e178c8f77a322c3f2aec9b3232e886afd3 100644 (file)
@@ -362,6 +362,12 @@ struct xe_gt {
         */
        spinlock_t mcr_lock;
 
+       /**
+        * @global_invl_lock: protects the register for the duration
+        *    of a global invalidation of l2 cache
+        */
+       spinlock_t global_invl_lock;
+
        /** @wa_active: keep track of active workarounds */
        struct {
                /** @wa_active.gt: bitmap with active GT workarounds */