Skip to content

Commit 7e81285

Browse files
tejasuprodrigovivi
authored andcommitted
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: Nirmoy Das <[email protected]> Signed-off-by: Tejas Upadhyay <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Nirmoy Das <[email protected]> (cherry picked from commit 71733b8) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent b196e6f commit 7e81285

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

drivers/gpu/drm/xe/xe_device.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,10 +865,12 @@ void xe_device_l2_flush(struct xe_device *xe)
865865
if (err)
866866
return;
867867

868+
spin_lock(&gt->global_invl_lock);
868869
xe_mmio_write32(gt, XE2_GLOBAL_INVAL, 0x1);
869870

870871
if (xe_mmio_wait32(gt, XE2_GLOBAL_INVAL, 0x1, 0x0, 150, NULL, true))
871872
xe_gt_err_once(gt, "Global invalidation timeout\n");
873+
spin_unlock(&gt->global_invl_lock);
872874

873875
xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
874876
}

drivers/gpu/drm/xe/xe_gt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ int xe_gt_init_early(struct xe_gt *gt)
388388

389389
xe_force_wake_init_gt(gt, gt_to_fw(gt));
390390
xe_pcode_init(gt);
391+
spin_lock_init(&gt->global_invl_lock);
391392

392393
return 0;
393394
}

drivers/gpu/drm/xe/xe_gt_types.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,12 @@ struct xe_gt {
362362
*/
363363
spinlock_t mcr_lock;
364364

365+
/**
366+
* @global_invl_lock: protects the register for the duration
367+
* of a global invalidation of l2 cache
368+
*/
369+
spinlock_t global_invl_lock;
370+
365371
/** @wa_active: keep track of active workarounds */
366372
struct {
367373
/** @wa_active.gt: bitmap with active GT workarounds */

0 commit comments

Comments
 (0)