From: Michal Wajdeczko Date: Sun, 11 Jan 2026 21:38:47 +0000 (+0100) Subject: drm/xe/mert: Always refer to MERT using xe_device X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff4eca1f46f3c2c485055e2c31432ab1ec5dbb96;p=thirdparty%2Fkernel%2Flinux.git drm/xe/mert: Always refer to MERT using xe_device There is only one MERT instance and while it is located on the root tile, it is safer to refer to it using xe_device rather than xe_tile. This will also allow to align signature with other MERT function. Signed-off-by: Michal Wajdeczko Cc: Lukasz Laguna Reviewed-by: Lukasz Laguna Link: https://patch.msgid.link/20260111213847.27869-1-michal.wajdeczko@intel.com --- diff --git a/drivers/gpu/drm/xe/xe_lmtt.c b/drivers/gpu/drm/xe/xe_lmtt.c index 3059ea6525bc..2077e1ef8b43 100644 --- a/drivers/gpu/drm/xe/xe_lmtt.c +++ b/drivers/gpu/drm/xe/xe_lmtt.c @@ -289,7 +289,7 @@ void xe_lmtt_invalidate_hw(struct xe_lmtt *lmtt) ERR_PTR(err)); if (xe_device_has_mert(xe) && xe_tile_is_root(tile)) { - err = xe_mert_invalidate_lmtt(tile); + err = xe_mert_invalidate_lmtt(xe); if (err) xe_tile_sriov_err(tile, "MERT LMTT invalidation failed (%pe)", ERR_PTR(err)); diff --git a/drivers/gpu/drm/xe/xe_mert.c b/drivers/gpu/drm/xe/xe_mert.c index f7689e922953..598b039dfe25 100644 --- a/drivers/gpu/drm/xe/xe_mert.c +++ b/drivers/gpu/drm/xe/xe_mert.c @@ -12,22 +12,21 @@ #include "xe_tile.h" /** - * xe_mert_invalidate_lmtt - Invalidate MERT LMTT - * @tile: the &xe_tile + * xe_mert_invalidate_lmtt() - Invalidate MERT LMTT + * @xe: the &xe_device with MERT * * Trigger invalidation of the MERT LMTT and wait for completion. * * Return: 0 on success or -ETIMEDOUT in case of a timeout. */ -int xe_mert_invalidate_lmtt(struct xe_tile *tile) +int xe_mert_invalidate_lmtt(struct xe_device *xe) { - struct xe_device *xe = tile_to_xe(tile); + struct xe_tile *tile = xe_device_get_root_tile(xe); struct xe_mert *mert = &tile->mert; const long timeout = HZ / 4; unsigned long flags; xe_assert(xe, xe_device_has_mert(xe)); - xe_assert(xe, xe_tile_is_root(tile)); spin_lock_irqsave(&mert->lock, flags); if (!mert->tlb_inv_triggered) { diff --git a/drivers/gpu/drm/xe/xe_mert.h b/drivers/gpu/drm/xe/xe_mert.h index 0e27f9fa24bb..44daeca094bd 100644 --- a/drivers/gpu/drm/xe/xe_mert.h +++ b/drivers/gpu/drm/xe/xe_mert.h @@ -11,7 +11,6 @@ #include struct xe_device; -struct xe_tile; /** * struct xe_mert - MERT related data @@ -26,7 +25,7 @@ struct xe_mert { }; #ifdef CONFIG_PCI_IOV -int xe_mert_invalidate_lmtt(struct xe_tile *tile); +int xe_mert_invalidate_lmtt(struct xe_device *xe); void xe_mert_irq_handler(struct xe_device *xe, u32 master_ctl); #else static inline void xe_mert_irq_handler(struct xe_device *xe, u32 master_ctl) { }