All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Michael J. Ruhl" <michael.j.ruhl@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v2 10/10] drm/xe/vsec: Update PMT internal access for CRI
Date: Wed, 12 Aug 2026 20:04:50 +0000	[thread overview]
Message-ID: <20260812200450.9D1861F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260812193742.2170188-22-michael.j.ruhl@intel.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The function `xe_pmt_write_reg` executes a double put on the runtime PM usage counter on its success path.
- [Low] Unused `mmio` parameter in `read_residency_counter`.
--

--- Patch [10]: [PATCH v2 10/10] drm/xe/vsec: Update PMT internal access for CRI ---
commit dad9ae19b6a680a51c5ad534968234e3d02be8a6
Author: Michael J. Ruhl <michael.j.ruhl@intel.com>
Subject: drm/xe/vsec: Update PMT internal access for CRI

This commit adds a new API to access the PMT telemetry GUID based on the
platform. It updates the debugfs, hwmon, and pcode components to use this
new xe_vsec_get_guid() function instead of reading the GUID directly.

> diff --git a/drivers/gpu/drm/xe/xe_debugfs.c b/drivers/gpu/drm/xe/xe_debugfs.c
> index 8de78cd0aa03b..0ef62b1e0e91f 100644
> --- a/drivers/gpu/drm/xe/xe_debugfs.c
> +++ b/drivers/gpu/drm/xe/xe_debugfs.c
> @@ -96,11 +96,16 @@ static void read_residency_counter(struct xe_device *xe, struct xe_mmio *mmio,
>  				   u32 offset, const char *name, struct drm_printer *p)
>  {
>  	u64 residency = 0;
> +	u32 guid;
>  	int ret;
>  
> -	ret = xe_pmt_telem_read(xe->drm.dev,
> -				xe_mmio_read32(mmio, PUNIT_TELEMETRY_GUID),
> -				&residency, offset, sizeof(residency));
> +	guid = xe_vsec_get_guid(xe);

[Severity: Low]
Is the mmio parameter still needed in read_residency_counter()?

With the switch to xe_vsec_get_guid(), it looks like the mmio argument is no
longer accessed in the function body and can probably be removed from the
signature.

> +	if (!guid) {
> +		drm_warn(&xe->drm, "PMT device is not powered\n");
> +		return;
> +	}
> +
> +	ret = xe_pmt_telem_read(xe->drm.dev, guid, &residency, offset, sizeof(residency));

[ ... ]

While reviewing this, I also noticed a pre-existing issue in xe_pmt_write_reg():

drivers/gpu/drm/xe/xe_vsec.c:xe_pmt_write_reg() {
    ...
	memcpy_toio(disc_addr, &reg, sizeof(reg));

	mutex_unlock(&xe->pmt.lock);
	xe_pm_runtime_put(xe);

runtime_exit:
	xe_pm_runtime_put(xe);
    ...
}

[Severity: High]
This is a pre-existing issue, but does xe_pmt_write_reg() execute a double put
on the runtime PM usage counter on its success path?

When the register write completes successfully, it unlocks the mutex and calls
xe_pm_runtime_put(xe), but then falls through to the runtime_exit label which
calls xe_pm_runtime_put(xe) a second time. Can this lead to an underflow and
cause the device to enter runtime suspend prematurely while still in use?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260812193742.2170188-12-michael.j.ruhl@intel.com?part=10

  reply	other threads:[~2026-08-12 22:17 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 19:37 [PATCH v2 00/10] Crescent Island PMT support Michael J. Ruhl
2026-08-12 19:37 ` [PATCH v2 01/10] platform/x86/intel/pmt: complete pcidev to device update Michael J. Ruhl
2026-08-12 19:37 ` [PATCH v2 02/10] platform/x86/intel/pmt: Add register access callbacks Michael J. Ruhl
2026-08-12 19:49   ` sashiko-bot
2026-08-12 19:37 ` [PATCH v2 03/10] drm/xe/vsec: Protect against missing config Michael J. Ruhl
2026-08-12 19:37 ` [PATCH v2 04/10] drm/xe/vsec: Use correct pm state get Michael J. Ruhl
2026-08-12 19:37 ` [PATCH v2 05/10] drm/xe/vsec: Support possible hotplug exit Michael J. Ruhl
2026-08-12 19:51   ` sashiko-bot
2026-08-12 19:37 ` [PATCH v2 06/10] drm/xe/vsec: Support Crescent Island PMT Michael J. Ruhl
2026-08-12 19:49   ` sashiko-bot
2026-08-12 19:37 ` [PATCH v2 07/10] drm/xe/vsec: Crescent Island PMT decode Michael J. Ruhl
2026-08-12 19:51   ` sashiko-bot
2026-08-12 19:37 ` [PATCH v2 08/10] drm/xe/vsec: Crescent Island PMT callbacks Michael J. Ruhl
2026-08-12 19:57   ` sashiko-bot
2026-08-12 19:37 ` [PATCH v2 09/10] drm/xe/vsec: Support late bind fw information Michael J. Ruhl
2026-08-12 19:54   ` sashiko-bot
2026-08-12 20:12   ` Ruhl, Michael J
2026-08-12 19:37 ` [PATCH v2 10/10] drm/xe/vsec: Update PMT internal access for CRI Michael J. Ruhl
2026-08-12 20:04   ` sashiko-bot [this message]
2026-08-12 20:24 ` ✓ CI.KUnit: success for Crescent Island PMT support (rev4) Patchwork
2026-08-12 21:16 ` ✓ Xe.CI.BAT: " 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=20260812200450.9D1861F00A3A@smtp.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.