]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/mert: Always refer to MERT using xe_device
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Sun, 11 Jan 2026 21:38:47 +0000 (22:38 +0100)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Mon, 12 Jan 2026 13:38:41 +0000 (14:38 +0100)
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
drivers/gpu/drm/xe/xe_lmtt.c
drivers/gpu/drm/xe/xe_mert.c
drivers/gpu/drm/xe/xe_mert.h

index 3059ea6525bc9228305121fd5be4a687a86ca0e6..2077e1ef8b43401f6b0fdc69ae8d986e8d6bfa2f 100644 (file)
@@ -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));
index f7689e92295362f74c1c1a5778568a051db1ec1a..598b039dfe25ee04b65106f320c60f6846f1414c 100644 (file)
 #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) {
index 0e27f9fa24bb4c427728103d2b732b0bc17aeed0..44daeca094bddc172cbdc7e3440a9411356510b5 100644 (file)
@@ -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) { }