Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Stuart Summers" <stuart.summers@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 05/11] drm/xe: Stop assuming the root tile has a primary GT
Date: Wed, 11 Nov 2026 02:59:36 +0000	[thread overview]
Message-ID: <sashiko-outbox-208142@kernel.org> (raw)
In-Reply-To: <20261110231442.218721-18-stuart.summers@intel.com>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Medium] drm/xe/oa: incorrect GRAPHICS_VER check in
  xe_oa_enable_metric_set() [1]
--

commit 60c4b3494beccd5ac07590503398e4dda529a384
Author: Stuart Summers <stuart.summers@intel.com>

drm/xe: Stop assuming the root tile has a primary GT

This commit introduces xe_device_any_gt() and xe_oa_first_unit() so that
device-level consumers and OA stream open do not assume the root tile has
a primary GT.

> diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
> index 838802482adaf..05beb156c941a 100644
> --- a/drivers/gpu/drm/xe/xe_oa.c
> +++ b/drivers/gpu/drm/xe/xe_oa.c
> @@ -2041,6 +2041,23 @@ static int xe_oa_assign_hwe(struct xe_oa *oa, struct xe_oa_open_param *param)
>  	return ret;
>  }
>  
> +/*
> + * OA unit IDs are handed out in GT iteration order, so the first unit of the
> + * first GT that has one is OA unit 0. The primary GT may be absent, in which
> + * case unit 0 lives on the media GT.
> + */
> +static struct xe_oa_unit *xe_oa_first_unit(struct xe_device *xe)
> +{
> +	struct xe_gt *gt;
> +	u8 id;
> +
> +	for_each_gt(gt, xe, id)
> +		if (gt->oa.num_oa_units)
> +			return &gt->oa.oa_unit[0];
> +
> +	return NULL;
> +}
> +
>  /**
>   * xe_oa_stream_open_ioctl - Opens an OA stream
>   * @dev: @drm_device
> @@ -2073,8 +2090,11 @@ int xe_oa_stream_open_ioctl(struct drm_device *dev, u64 data, struct drm_file *f
>  		return ret;
>  
>  	/* If not provided, OA unit defaults to OA unit 0 as per uapi */
> -	if (!param.oa_unit)
> -		param.oa_unit = &xe_root_mmio_gt(oa->xe)->oa.oa_unit[0];
> +	if (!param.oa_unit) {
> +		param.oa_unit = xe_oa_first_unit(oa->xe);
> +		if (XE_IOCTL_DBG(xe, !param.oa_unit))
> +			return -ENODEV;
> +	}

[Severity: Medium]
This problem wasn't introduced by this patch, but should
xe_oa_enable_metric_set() and xe_oa_disable_metric_set() check MEDIA_VER()
instead of GRAPHICS_VER() [1] when programming
OAM_COMPRESSION_T3_CONTROL?

drivers/gpu/drm/xe/xe_oa.c:xe_oa_enable_metric_set() {
    ...
	if ((stream->oa_unit->type == DRM_XE_OA_UNIT_TYPE_OAM ||
	     stream->oa_unit->type == DRM_XE_OA_UNIT_TYPE_OAM_SAG) &&
	    GRAPHICS_VER(stream->oa->xe) >= 30)
		xe_mmio_rmw32(mmio, OAM_COMPRESSION_T3_CONTROL, 0, OAM_LAT_MEASURE_ENABLE);
    ...
}

OAM units belong to the media IP block, so checking GRAPHICS_VER() skips
enabling latency measurement when the graphics IP is absent or older than
version 30 while media IP is >= 30, and issues unsupported MMIO writes to
OAM_COMPRESSION_T3_CONTROL when graphics IP is >= 30 but media IP is < 30.

[1] https://sashiko.dev/#/bug/linux-23224ef1-a940-4408-9697-0c35c66f6046

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261110231442.218721-13-stuart.summers@intel.com?part=5

  reply	other threads:[~2026-11-11  2:59 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 23:14 [PATCH 00/11] Allow boot with only media GT Stuart Summers
2026-11-10 23:14 ` [PATCH 01/11] drm/xe: Detect each GMD_ID IP in a loop Stuart Summers
2026-11-10 23:14 ` [PATCH 02/11] drm/xe: Tolerate a missing graphics IP in xe_info_init() Stuart Summers
2026-11-10 23:14 ` [PATCH 03/11] drm/xe: Verify IP presence against GU_CNTL Stuart Summers
2026-11-10 23:14 ` [PATCH 04/11] drm/xe: Guard per-tile primary GT accesses Stuart Summers
2026-11-10 23:14 ` [PATCH 05/11] drm/xe: Stop assuming the root tile has a primary GT Stuart Summers
2026-11-11  2:59   ` sashiko-bot [this message]
2026-11-10 23:14 ` [PATCH 06/11] drm/xe: Do not claim flat CCS without a graphics IP Stuart Summers
2026-11-11  3:21   ` sashiko-bot
2026-11-10 23:14 ` [PATCH 07/11] drm/xe: Run page table updates on the media GT when there is no primary Stuart Summers
2026-11-11  3:53   ` sashiko-bot
2026-11-10 23:14 ` [PATCH 08/11] drm/xe: Document that gt_types_allowed=media now probes Stuart Summers
2026-11-10 23:14 ` [PATCH 09/11] drm/xe: Fall back to CPU copies when the tile cannot blit Stuart Summers
2026-11-11  4:25   ` sashiko-bot
2026-11-10 23:14 ` [PATCH 10/11] drm/xe: Require a fully visible VRAM BAR without a primary GT Stuart Summers
2026-11-11  4:38   ` sashiko-bot
2026-11-10 23:14 ` [PATCH 11/11] drm/xe: Allow probe " Stuart Summers
2026-11-11  4:57   ` sashiko-bot
2026-11-10 23:39 ` ✓ CI.KUnit: success for Allow boot with only media GT Patchwork
2026-11-11  0:14 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-11  4:17 ` ✓ Xe.CI.FULL: " Patchwork
2026-11-12 12:21 ` [PATCH 00/11] " Piotr Piórkowski

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=sashiko-outbox-208142@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=stuart.summers@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