diff options
| author | Michal Wajdeczko <michal.wajdeczko@intel.com> | 2026-01-11 22:38:47 +0100 |
|---|---|---|
| committer | Michal Wajdeczko <michal.wajdeczko@intel.com> | 2026-01-12 14:38:41 +0100 |
| commit | ff4eca1f46f3c2c485055e2c31432ab1ec5dbb96 (patch) | |
| tree | b1d65b5a09c40aa645654e42b3307822f99632bd | |
| parent | a92c68eb1e19de9ea8de6c7d3bcfff6c3fcb3c10 (diff) | |
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 <michal.wajdeczko@intel.com>
Cc: Lukasz Laguna <lukasz.laguna@intel.com>
Reviewed-by: Lukasz Laguna <lukasz.laguna@intel.com>
Link: https://patch.msgid.link/20260111213847.27869-1-michal.wajdeczko@intel.com
| -rw-r--r-- | drivers/gpu/drm/xe/xe_lmtt.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/xe/xe_mert.c | 9 | ||||
| -rw-r--r-- | drivers/gpu/drm/xe/xe_mert.h | 3 |
3 files changed, 6 insertions, 8 deletions
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 <linux/types.h> 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) { } |
