Skip to content

Commit ff4eca1

Browse files
committed
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
1 parent a92c68e commit ff4eca1

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

drivers/gpu/drm/xe/xe_lmtt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ void xe_lmtt_invalidate_hw(struct xe_lmtt *lmtt)
289289
ERR_PTR(err));
290290

291291
if (xe_device_has_mert(xe) && xe_tile_is_root(tile)) {
292-
err = xe_mert_invalidate_lmtt(tile);
292+
err = xe_mert_invalidate_lmtt(xe);
293293
if (err)
294294
xe_tile_sriov_err(tile, "MERT LMTT invalidation failed (%pe)",
295295
ERR_PTR(err));

drivers/gpu/drm/xe/xe_mert.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,21 @@
1212
#include "xe_tile.h"
1313

1414
/**
15-
* xe_mert_invalidate_lmtt - Invalidate MERT LMTT
16-
* @tile: the &xe_tile
15+
* xe_mert_invalidate_lmtt() - Invalidate MERT LMTT
16+
* @xe: the &xe_device with MERT
1717
*
1818
* Trigger invalidation of the MERT LMTT and wait for completion.
1919
*
2020
* Return: 0 on success or -ETIMEDOUT in case of a timeout.
2121
*/
22-
int xe_mert_invalidate_lmtt(struct xe_tile *tile)
22+
int xe_mert_invalidate_lmtt(struct xe_device *xe)
2323
{
24-
struct xe_device *xe = tile_to_xe(tile);
24+
struct xe_tile *tile = xe_device_get_root_tile(xe);
2525
struct xe_mert *mert = &tile->mert;
2626
const long timeout = HZ / 4;
2727
unsigned long flags;
2828

2929
xe_assert(xe, xe_device_has_mert(xe));
30-
xe_assert(xe, xe_tile_is_root(tile));
3130

3231
spin_lock_irqsave(&mert->lock, flags);
3332
if (!mert->tlb_inv_triggered) {

drivers/gpu/drm/xe/xe_mert.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <linux/types.h>
1212

1313
struct xe_device;
14-
struct xe_tile;
1514

1615
/**
1716
* struct xe_mert - MERT related data
@@ -26,7 +25,7 @@ struct xe_mert {
2625
};
2726

2827
#ifdef CONFIG_PCI_IOV
29-
int xe_mert_invalidate_lmtt(struct xe_tile *tile);
28+
int xe_mert_invalidate_lmtt(struct xe_device *xe);
3029
void xe_mert_irq_handler(struct xe_device *xe, u32 master_ctl);
3130
#else
3231
static inline void xe_mert_irq_handler(struct xe_device *xe, u32 master_ctl) { }

0 commit comments

Comments
 (0)