From: sashiko-bot@kernel.org
To: "Michael J. Ruhl" <michael.j.ruhl@intel.com>,
intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v13 15/16] drm/xe/vsec: Refactor platform check
Date: Mon, 02 Nov 2026 22:46:36 +0000 [thread overview]
Message-ID: <sashiko-outbox-194301@kernel.org> (raw)
In-Reply-To: <20261102221314.119028-33-michael.j.ruhl@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] drm/xe/vsec: missing wait_for_fw() and GUID validation in xe_vsec_get_guid()
--
commit fd76168b193bc56ba83b5c95e6f8be66f5597b26
Author: Michael J. Ruhl <michael.j.ruhl@intel.com>
drm/xe/vsec: Refactor platform check
This commit combines the platform checks in xe_debugfs_register() so that
both debugfs_residencies and pcode_info_debugfs are registered on Battlemage
and Crescent Island PF devices.
> diff --git a/drivers/gpu/drm/xe/xe_debugfs.c b/drivers/gpu/drm/xe/xe_debugfs.c
> index b56e4aad40696..5a82f8eab2c66 100644
> --- a/drivers/gpu/drm/xe/xe_debugfs.c
> +++ b/drivers/gpu/drm/xe/xe_debugfs.c
> @@ -702,23 +702,22 @@ void xe_debugfs_register(struct xe_device *xe)
> ARRAY_SIZE(debugfs_list),
> root, minor);
>
> - if (xe->info.platform == XE_BATTLEMAGE && !IS_SRIOV_VF(xe)) {
> - drm_debugfs_create_files(debugfs_residencies,
> - ARRAY_SIZE(debugfs_residencies),
> - root, minor);
> - }
> -
> /*
> - * Pcode version read from PMT is currently only supported on CRI and BMG platforms in PF
> - * mode, as both platforms support the necessary telemetry read mechanism and have a fixed
> - * PUNIT_VERSION_OFFSET.
> + * Residencies and Pcode version read from PMT is currently only supported on CRI and BMG
> + * platforms in PF mode. Both platforms support the necessary telemetry read mechanism
> + * and have a fixed offsets for the required data.
> * Attempting this access on other platforms must be verified before enabling support.
> */
> if (!IS_SRIOV_VF(xe) &&
> - (xe->info.platform == XE_CRESCENTISLAND || xe->info.platform == XE_BATTLEMAGE))
> + (xe->info.platform == XE_CRESCENTISLAND || xe->info.platform == XE_BATTLEMAGE)) {
> + drm_debugfs_create_files(debugfs_residencies,
> + ARRAY_SIZE(debugfs_residencies),
> + root, minor);
> +
> drm_debugfs_create_files(pcode_info_debugfs,
> ARRAY_SIZE(pcode_info_debugfs),
> root, minor);
> + }
[Severity: Medium]
With debugfs_residencies now exposed on XE_CRESCENTISLAND alongside
pcode_info_debugfs, what happens if userspace reads dgfx_pkg_residencies,
dgfx_pcie_link_residencies, or pcode_info while OOBMSM firmware
initialization (cri_late_bind_probe_work) is still pending after
xe_vsec_init()?
In read_residency_counter() (and xe_get_pcode_version()), xe_vsec_get_guid()
is called before xe_pmt_telem_read():
drivers/gpu/drm/xe/xe_debugfs.c:read_residency_counter() {
ret = xe_vsec_get_guid(xe, &guid);
if (ret) {
drm_warn(&xe->drm, "PMT device is not available: %d\n", ret);
return;
}
ret = xe_pmt_telem_read(xe->drm.dev, guid, &residency, offset, sizeof(residency));
}
Unlike xe_pmt_telem_read(), xe_pmt_read_reg(), and xe_pmt_write_reg(), which
all call wait_for_fw(xe) before setting the SoC remapper index and reading
the PMT window, xe_vsec_get_guid() accesses CRI_PUNIT_TELEMETRY_GUID without
waiting for firmware readiness or validating the returned GUID:
drivers/gpu/drm/xe/xe_vsec.c:xe_vsec_get_guid() {
...
case XE_CRESCENTISLAND:
xe->soc_remapper.set_telem_region(xe, CRI_IDX_TELEM_DISCOVERY);
*guid = xe_mmio_read32(mmio, CRI_PUNIT_TELEMETRY_GUID);
break;
...
/* the GUID is static, read once and cache for all requests */
if (*guid)
xe->pmt.punit_guid_cache = *guid;
}
If CRI_PUNIT_TELEMETRY_GUID reads as 0 before firmware is ready,
xe_vsec_get_guid() returns 0 with *guid == 0, and xe_pmt_telem_read() then
fails xe_guid_decode() with -ENODEV before reaching wait_for_fw(xe). If the
unready register returns a non-zero bogus value (such as 0xffffffff),
xe_vsec_get_guid() caches it in xe->pmt.punit_guid_cache, permanently
breaking subsequent telemetry reads for the lifetime of the device.
Should xe_vsec_get_guid() call wait_for_fw(xe) and validate the GUID before
caching it in xe->pmt.punit_guid_cache?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261102221314.119028-18-michael.j.ruhl@intel.com?part=15
next prev parent reply other threads:[~2026-11-02 22:46 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 22:13 [PATCH v13 00/16] Crescent Island PMT support Michael J. Ruhl
2026-11-02 22:13 ` [PATCH v13 01/16] drm/xe/vsec: Do not register BMG PMT for VF Michael J. Ruhl
2026-11-02 22:23 ` sashiko-bot
2026-11-04 22:27 ` Ruhl, Michael J
2026-11-02 22:13 ` [PATCH v13 02/16] drm/xe/vsec: Correct locking order Michael J. Ruhl
2026-11-02 22:13 ` [PATCH v13 03/16] drm/xe/vsec: Use correct pm state get Michael J. Ruhl
2026-11-02 22:13 ` [PATCH v13 04/16] drm/xe/vsec: Add DOC text for VSEC Michael J. Ruhl
2026-11-02 22:13 ` [PATCH v13 05/16] drm/xe/vsec: Support possible hotplug exit Michael J. Ruhl
2026-11-02 22:13 ` [PATCH v13 06/16] drm/xe/vsec: Refactor BattleMage PMT defines Michael J. Ruhl
2026-11-02 22:13 ` [PATCH v13 07/16] drm/xe/vsec: Update VSEC probe order Michael J. Ruhl
2026-11-02 22:13 ` [PATCH v13 08/16] drm/xe/vsec: Add base_offset to allow for more flexibilty Michael J. Ruhl
2026-11-02 22:13 ` [PATCH v13 09/16] drm/xe/vsec: Support Crescent Island PMT Michael J. Ruhl
2026-11-02 22:13 ` [PATCH v13 10/16] drm/xe/vsec: Crescent Island PMT decode Michael J. Ruhl
2026-11-02 22:13 ` [PATCH v13 11/16] drm/xe/vsec: Crescent Island PMT callbacks Michael J. Ruhl
2026-11-02 22:38 ` sashiko-bot
2026-11-02 22:13 ` [PATCH v13 12/16] drm/xe/vsec: Support late bind fw information Michael J. Ruhl
2026-11-02 22:46 ` sashiko-bot
2026-11-02 22:13 ` [PATCH v13 13/16] drm/xe/vsec: Add PMT GUID internal access Michael J. Ruhl
2026-11-02 22:39 ` sashiko-bot
2026-11-02 22:13 ` [PATCH v13 14/16] drm/xe/vsec: Update PMT " Michael J. Ruhl
2026-11-02 22:35 ` sashiko-bot
2026-11-02 22:13 ` [PATCH v13 15/16] drm/xe/vsec: Refactor platform check Michael J. Ruhl
2026-11-02 22:46 ` sashiko-bot [this message]
2026-11-02 22:13 ` [PATCH v13 16/16] drm/xe/vsec: Support survivability mode for CRI Michael J. Ruhl
2026-11-02 22:39 ` sashiko-bot
2026-11-02 22:49 ` ✗ CI.checkpatch: warning for Crescent Island PMT support (rev15) Patchwork
2026-11-02 22:51 ` ✓ CI.KUnit: success " Patchwork
2026-11-02 23:23 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-03 1:00 ` ✓ Xe.CI.FULL: " 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-194301@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=michael.j.ruhl@intel.com \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.