aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Ceraolo Spurio <[email protected]>2023-07-26 15:25:28 -0700
committerRodrigo Vivi <[email protected]>2023-12-21 11:38:53 -0500
commit43b5d81e04773d08df1ed3ff8a40936dca726fda (patch)
tree60c74f0774bac97f00b22cd42a434b6ab7faaf2f
parent0e34fdb4a01a3e615c109694b5adc53590ccda19 (diff)
drm/xe: fix mcr semaphore locking for MTL
in commit 81593af6c88d ("drm/xe: Convert xe_mmio_wait32 to us so we can stop using wait_for_us.") the mcr semaphore register read was accidentally switched from waiting for the register to go to 1 to waiting for the register to go to 0, so we need to flip it back. Signed-off-by: Daniele Ceraolo Spurio <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: Matthew Brost <[email protected]> Reviewed-by: Matt Roper <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]>
-rw-r--r--drivers/gpu/drm/xe/xe_gt_mcr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/xe/xe_gt_mcr.c b/drivers/gpu/drm/xe/xe_gt_mcr.c
index c56815af0686..9eb7a6a1348d 100644
--- a/drivers/gpu/drm/xe/xe_gt_mcr.c
+++ b/drivers/gpu/drm/xe/xe_gt_mcr.c
@@ -420,10 +420,11 @@ static void mcr_lock(struct xe_gt *gt)
/*
* Starting with MTL we also need to grab a semaphore register
* to synchronize with external agents (e.g., firmware) that now
- * shares the same steering control register.
+ * shares the same steering control register. The semaphore is obtained
+ * when a read to the relevant register returns 1.
*/
if (GRAPHICS_VERx100(xe) >= 1270)
- ret = xe_mmio_wait32(gt, STEER_SEMAPHORE, 0, 0x1, 10, NULL,
+ ret = xe_mmio_wait32(gt, STEER_SEMAPHORE, 0x1, 0x1, 10, NULL,
true);
drm_WARN_ON_ONCE(&xe->drm, ret == -ETIMEDOUT);
@@ -431,7 +432,7 @@ static void mcr_lock(struct xe_gt *gt)
static void mcr_unlock(struct xe_gt *gt)
{
- /* Release hardware semaphore */
+ /* Release hardware semaphore - this is done by writing 1 to the register */
if (GRAPHICS_VERx100(gt_to_xe(gt)) >= 1270)
xe_mmio_write32(gt, STEER_SEMAPHORE, 0x1);