From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE6B6606A32F for ; Thu, 3 Dec 2026 19:34:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jJlb8lIs Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B6D74112B48; Thu, 3 Dec 2026 19:34:29 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id B6402112B48 for ; Thu, 3 Dec 2026 19:34:23 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 5C93741F95; Thu, 3 Dec 2026 19:34:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FCAF1F000C2; Thu, 3 Dec 2026 19:34:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796326463; bh=B1WIjI37fRK/p5otJA5rG8+GWFTpw06Dw0T1mkDbDmI=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=jJlb8lIsa12B6HtqDvzjJ93ne46KIQeFWpZDQQpgyxeNXET55qKbLTch6VrYQoCEn 8xjBOqZC2gdIojwxonmrqWMv1jv9+wZGZTsBl4FG7Tz87QbkCSBY5JUdfkL8DbKsLl hAGf5txMIlvkKL4ZemvM2dlxNx0eTg87dcD259yiANf8IMT8mfFQ76wE67JHlgdeEo 3XtyB3F17XORJdq9MrlxKSbNOXuYPsbN6FQzQoVBdXyJbr/8+nC7wjgs7hAOUAMkGm ZAkPeqOLZt5OOkpFT9I3ZUz4FhUhyxfZfhx+VfObiQ9dWCNhkXCbUjmzjJpC5vDG9d XbjLsc6i56zZQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 1/2] drm/xe: Add enable_media module parameter To: "Stuart Summers" Cc: intel-xe@lists.freedesktop.org In-Reply-To: <20261203190926.249488-5-stuart.summers@intel.com> References: <20261203190926.249488-4-stuart.summers@intel.com> <20261203190926.249488-5-stuart.summers@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 19:34:22 +0000 X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "Intel-xe" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: 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 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_devic= e.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 > =20 > +/** > + * 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_modul= e.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, m= ust be power of 2 " > "[default=3D" __stringify(XE_DEFAULT_SVM_NOTIFIER_SIZE) "]"); > =20 > +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=3D= auto, 0=3Ddisable, 1=3Denable). " > + "Disabling overrides any media GT selected via the gt_types_allowed " > + "configfs attribute " > + "[default=3D" __stringify(XE_DEFAULT_ENABLE_MEDIA) "])"); [Severity: Low] There is a stray unmatched closing parenthesis after [default=3D-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 *t= ile, > struct xe_device *xe =3D tile_to_xe(tile); > struct xe_gt *gt; > =20 > - 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=3D0 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. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203190926.2494= 88-4-stuart.summers@intel.com?part=3D1