From: sashiko-bot@kernel.org
To: "Stuart Summers" <stuart.summers@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/xe: Add enable_media module parameter
Date: Thu, 03 Dec 2026 19:34:22 +0000 [thread overview]
Message-ID: <sashiko-outbox-248519@kernel.org> (raw)
In-Reply-To: <20261203190926.249488-5-stuart.summers@intel.com>
Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [Low] drm/xe: bad kernel-doc xref and missing const in
xe_device_media_allowed()
- [Low] drm/xe: enable_media 0444 permission contradicts writable commit
claim
- [Low] drm/xe: unmatched closing parenthesis in enable_media
MODULE_PARM_DESC
- [Low] drm/xe: alloc_media_gt() logs Media GT disabled on platforms
without media GT
--
commit 9563da05b68af4398b300645f203417f22f81ae8
Author: Stuart Summers <stuart.summers@intel.com>
drm/xe: Add enable_media module parameter
This commit adds a tri-state enable_media module parameter to control
whether the media GT is enabled, latches the combined module parameter
and configfs decision into xe->info.media_allowed during early probe,
and exposes it via xe_device_media_allowed().
> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index 86de5f183c0a0..de1b29071bb80 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -379,6 +379,20 @@ bool xe_device_is_admin_only(const struct xe_device *xe)
> }
> #endif
>
> +/**
> + * xe_device_media_allowed() - Check whether the media IP may be used.
> + * @xe: the &xe_device to check
> + *
> + * Returns the decision latched during early probe, see
> + * @xe_device.info.media_allowed.
> + *
> + * Return: true if media may be used, false otherwise.
> + */
> +bool xe_device_media_allowed(struct xe_device *xe)
> +{
> + return xe->info.media_allowed;
> +}
[Severity: Low]
Should @xe_device.info.media_allowed use & instead of @ so kernel-doc
generates a struct member cross-reference? Also, since
xe_device_media_allowed() only reads xe->info.media_allowed, should its
parameter be const struct xe_device *xe (here and in xe_device.h) to
match xe_device_is_admin_only() right above it?
[ ... ]
> diff --git a/drivers/gpu/drm/xe/xe_module.c b/drivers/gpu/drm/xe/xe_module.c
> index 897724cb5cfb8..d6f3dd54613e4 100644
> --- a/drivers/gpu/drm/xe/xe_module.c
> +++ b/drivers/gpu/drm/xe/xe_module.c
> @@ -38,6 +39,12 @@ module_param_named(svm_notifier_size, xe_modparam.svm_notifier_size, uint, 0600)
> MODULE_PARM_DESC(svm_notifier_size, "Set the svm notifier size in MiB, must be power of 2 "
> "[default=" __stringify(XE_DEFAULT_SVM_NOTIFIER_SIZE) "]");
>
> +module_param_named(enable_media, xe_modparam.enable_media, int, 0444);
[Severity: Low]
Should enable_media be writable (0600) or is the commit message inaccurate?
The commit message states that both inputs are writable while the driver
runs, which is why the decision is latched into xe->info.media_allowed.
However, 0444 makes /sys/module/xe/parameters/enable_media read-only, and
gt_types_allowed_store() in xe_configfs.c already rejects writes with
-EBUSY once the device is bound.
If enable_media is meant to be runtime-writable, media_wanted() in
xe_pci.c also reads xe_modparam.enable_media twice without READ_ONCE()
into a local variable, which would create a data race against concurrent
sysfs writes.
> +MODULE_PARM_DESC(enable_media, "Enable the media GT, when present (-1=auto, 0=disable, 1=enable). "
> + "Disabling overrides any media GT selected via the gt_types_allowed "
> + "configfs attribute "
> + "[default=" __stringify(XE_DEFAULT_ENABLE_MEDIA) "])");
[Severity: Low]
There is a stray unmatched closing parenthesis after [default=-1] at the
end of this description string.
[ ... ]
> diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
> index 3f61d3eec2e2c..7afd20d1d2983 100644
> --- a/drivers/gpu/drm/xe/xe_pci.c
> +++ b/drivers/gpu/drm/xe/xe_pci.c
> @@ -962,8 +977,8 @@ static struct xe_gt *alloc_media_gt(struct xe_tile *tile,
> struct xe_device *xe = tile_to_xe(tile);
> struct xe_gt *gt;
>
> - if (!xe_configfs_media_gt_allowed(to_pci_dev(xe->drm.dev))) {
> - xe_tile_info(tile, "Media GT disabled via configfs\n");
> + if (!xe_device_media_allowed(xe)) {
> + xe_tile_info(tile, "Media GT disabled\n");
> return NULL;
> }
[Severity: Low]
Should the MEDIA_VER(xe) < 13 || !media_desc check right below this run
before logging "Media GT disabled"?
When xe.enable_media=0 is set on a pre-Media-13 device such as DG2,
alloc_primary_gt() still adds media_desc->hw_engine_mask to primary_gt
without checking xe_device_media_allowed(), and alloc_media_gt() then
logs "Media GT disabled" anyway; on media-less devices it logs that
message even though no media GT exists. The comments on
info.media_allowed and xe_device_media_allowed() also describe the flag
as governing media IP rather than standalone media GTs.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203190926.249488-4-stuart.summers@intel.com?part=1
next prev parent reply other threads:[~2026-12-03 19:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 19:09 [PATCH 0/2] Work around 52-bit limitation in CRI media Stuart Summers
2026-12-03 19:09 ` [PATCH 1/2] drm/xe: Add enable_media module parameter Stuart Summers
2026-12-03 19:34 ` sashiko-bot [this message]
2026-12-03 19:09 ` [PATCH 2/2] drm/xe: Work around media 52-bit limitation on CRI Stuart Summers
2026-12-03 19:31 ` sashiko-bot
2026-12-03 19:14 ` [PATCH 0/2] Work around 52-bit limitation in CRI media Summers, Stuart
2026-12-03 19:18 ` ✓ CI.KUnit: success for " 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=sashiko-outbox-248519@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