Commit 7e812853 authored by Tejas Upadhyay's avatar Tejas Upadhyay Committed by Rodrigo Vivi

drm/xe/xe2: Make subsequent L2 flush sequential

Issuing the flush on top of an ongoing flush is not desirable.
Lets use lock to make it sequential.
Reviewed-by: default avatarNirmoy Das <nirmoy.das@intel.com>
Signed-off-by: default avatarTejas Upadhyay <tejas.upadhyay@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240710052750.3031586-1-tejas.upadhyay@intel.comSigned-off-by: default avatarNirmoy Das <nirmoy.das@intel.com>
(cherry picked from commit 71733b8d)
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent b196e6fc
...@@ -865,10 +865,12 @@ void xe_device_l2_flush(struct xe_device *xe) ...@@ -865,10 +865,12 @@ void xe_device_l2_flush(struct xe_device *xe)
if (err) if (err)
return; return;
spin_lock(&gt->global_invl_lock);
xe_mmio_write32(gt, XE2_GLOBAL_INVAL, 0x1); xe_mmio_write32(gt, XE2_GLOBAL_INVAL, 0x1);
if (xe_mmio_wait32(gt, XE2_GLOBAL_INVAL, 0x1, 0x0, 150, NULL, true)) if (xe_mmio_wait32(gt, XE2_GLOBAL_INVAL, 0x1, 0x0, 150, NULL, true))
xe_gt_err_once(gt, "Global invalidation timeout\n"); 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); xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
} }
......
...@@ -388,6 +388,7 @@ int xe_gt_init_early(struct xe_gt *gt) ...@@ -388,6 +388,7 @@ int xe_gt_init_early(struct xe_gt *gt)
xe_force_wake_init_gt(gt, gt_to_fw(gt)); xe_force_wake_init_gt(gt, gt_to_fw(gt));
xe_pcode_init(gt); xe_pcode_init(gt);
spin_lock_init(&gt->global_invl_lock);
return 0; return 0;
} }
......
...@@ -362,6 +362,12 @@ struct xe_gt { ...@@ -362,6 +362,12 @@ struct xe_gt {
*/ */
spinlock_t mcr_lock; 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 */ /** @wa_active: keep track of active workarounds */
struct { struct {
/** @wa_active.gt: bitmap with active GT workarounds */ /** @wa_active.gt: bitmap with active GT workarounds */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment