Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Laguna, Lukasz" <lukasz.laguna@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
	<intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 3/5] drm/xe/mert: Always refer to MERT using xe_device
Date: Fri, 9 Jan 2026 18:04:31 +0100	[thread overview]
Message-ID: <56c6f0f3-1777-40af-a2da-431805b2c634@intel.com> (raw)
In-Reply-To: <20260109151219.26206-4-michal.wajdeczko@intel.com>


On 1/9/2026 16:12, Michal Wajdeczko wrote:
> 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>
> ---
>   drivers/gpu/drm/xe/xe_lmtt.c | 2 +-
>   drivers/gpu/drm/xe/xe_mert.c | 8 ++++----
>   drivers/gpu/drm/xe/xe_mert.h | 3 +--
>   3 files changed, 6 insertions(+), 7 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..5aea6f082bc0 100644
> --- a/drivers/gpu/drm/xe/xe_mert.c
> +++ b/drivers/gpu/drm/xe/xe_mert.c
> @@ -12,16 +12,16 @@
>   #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);

As tile is always the root tile now, the xe_tile_is_root() assertion 
doesn't seem to be needed anymore.
But you can remove it before merge:

Reviewed-by: Lukasz Laguna <lukasz.laguna@intel.com>

>   	struct xe_mert *mert = &tile->mert;
>   	const long timeout = HZ / 4;
>   	unsigned long flags;
> 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) { }

  reply	other threads:[~2026-01-09 17:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-09 15:12 [PATCH 0/5] drm/xe/mert: Minor improvements to MERT code Michal Wajdeczko
2026-01-09 15:12 ` [PATCH 1/5] drm/xe/mert: Normalize xe_mert.h include guards Michal Wajdeczko
2026-01-09 15:59   ` Laguna, Lukasz
2026-01-09 15:12 ` [PATCH 2/5] drm/xe/mert: Fix kernel-doc for struct xe_mert Michal Wajdeczko
2026-01-09 16:00   ` Laguna, Lukasz
2026-01-09 15:12 ` [PATCH 3/5] drm/xe/mert: Always refer to MERT using xe_device Michal Wajdeczko
2026-01-09 17:04   ` Laguna, Lukasz [this message]
2026-01-11 21:38   ` [PATCH v2 " Michal Wajdeczko
2026-01-09 15:12 ` [PATCH 4/5] drm/xe/mert: Use local mert variable to simplify the code Michal Wajdeczko
2026-01-09 16:21   ` Laguna, Lukasz
2026-01-09 15:12 ` [PATCH 5/5] drm/xe/mert: Move MERT initialization to xe_mert.c Michal Wajdeczko
2026-01-09 17:07   ` Laguna, Lukasz
2026-01-09 15:19 ` ✓ CI.KUnit: success for drm/xe/mert: Minor improvements to MERT code Patchwork
2026-01-09 16:01 ` ✓ Xe.CI.BAT: " Patchwork
2026-01-09 16:49 ` [PATCH 0/5] " Laguna, Lukasz
2026-01-09 20:02 ` ✓ Xe.CI.Full: success for " Patchwork
2026-01-11 21:50 ` ✓ CI.KUnit: success for drm/xe/mert: Minor improvements to MERT code (rev2) Patchwork
2026-01-11 22:25 ` ✓ Xe.CI.BAT: " Patchwork
2026-01-11 23:18 ` ✗ Xe.CI.Full: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56c6f0f3-1777-40af-a2da-431805b2c634@intel.com \
    --to=lukasz.laguna@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=michal.wajdeczko@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox