Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Vinay Belgaumkar" <vinay.belgaumkar@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v4] drm/xe: Poll GT for C6 before D3
Date: Tue, 15 Sep 2026 07:31:29 +0000	[thread overview]
Message-ID: <20260915073130.67A171F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260915071145.2866414-1-vinay.belgaumkar@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/xe: unconditional GT C6 polling breaks runtime PM on platforms without C6
--

commit d22fb27a8cdb2d7146e1b7f558dcb233890faf71
Author: Vinay Belgaumkar <vinay.belgaumkar@intel.com>

drm/xe: Poll GT for C6 before D3

This commit ensures the GT is in the C6 state before transitioning to D3
during runtime suspend. It polls the GT idle status and forces a resume
if the C6 check fails, preventing the device from being stuck in an
intermediate state.

> diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
> --- a/drivers/gpu/drm/xe/xe_pci.c
> +++ b/drivers/gpu/drm/xe/xe_pci.c
[ ... ]
> @@ -1394,6 +1394,17 @@ static int xe_pci_runtime_suspend(struct device *dev)
>  	if (err)
>  		return err;
>  
> +	err = xe_pm_check_device_idle(xe);
> +	if (err) {
> +		drm_dbg(&xe->drm, "Resuming - Device idle check failed!");
> +		ret = xe_pm_runtime_resume(xe);
> +		if (ret) {
> +			drm_err(&xe->drm, "Resume failed after suspend was canceled");
> +			return ret;
> +		}
> +		return err;
> +	}
> +

[ ... ]
> diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
> --- a/drivers/gpu/drm/xe/xe_pm.c
> +++ b/drivers/gpu/drm/xe/xe_pm.c
[ ... ]
> @@ -1030,6 +1030,27 @@ void xe_pm_d3cold_allowed_toggle(struct xe_device *xe)
>  	mutex_unlock(&xe->d3cold.lock);
>  }
>  
> +/**
> + * xe_pm_check_device_idle() - Check if all GTs are idle.
> + * @xe: xe device instance
> + *
> + * One of the ways to do this is to check for GT C6 state. This check
> + * will fail if some component is holding a forcewake, for example.
> + *
> + * Return: 0 on success, -EAGAIN on failure
> + */
> +int xe_pm_check_device_idle(struct xe_device *xe)
> +{
> +	struct xe_gt *gt;
> +	u8 id;
> +
> +	for_each_gt(gt, xe, id)
> +		if (xe_gt_idle_wait_for_c6(gt, 200))
> +			return -EAGAIN;

[Severity: High]
Does this unconditional polling for C6 break runtime PM on platforms
that don't support GT C6 (like PVC)?

If a platform disables or does not support C6, xe_gt_idle_wait_for_c6()
will unconditionally time out after 200ms. Since this function is called 
by xe_pci_runtime_suspend() during the idle transition, the device will 
repeatedly abort the suspend sequence.

Because the runtime autosuspend timer usually fires every second, would
this waste 200ms out of every second busy-waiting for a hardware state 
that can never be reached, leading to a CPU hog and preventing the device
from ever suspending?

> +
> +	return 0;
> +}
> +

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260915071145.2866414-1-vinay.belgaumkar@intel.com?part=1

  reply	other threads:[~2026-09-15  7:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15  7:11 [PATCH v4] drm/xe: Poll GT for C6 before D3 Vinay Belgaumkar
2026-09-15  7:31 ` sashiko-bot [this message]
2026-09-15  8:00 ` ✓ CI.KUnit: success for " Patchwork
2026-09-15  8:38 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-15  8:59 ` [PATCH v4] " Raag Jadav
2026-09-15 15:30   ` Belgaumkar, Vinay
2026-09-15 10:30 ` ✗ Xe.CI.FULL: failure 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=20260915073130.67A171F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vinay.belgaumkar@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