All of 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 v2 2/2] drm/xe: Poll GT for C6 before D3
Date: Thu, 10 Sep 2026 21:41:30 +0000	[thread overview]
Message-ID: <20260910214130.BAA2A1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260910212823.2358362-2-vinay.belgaumkar@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] System suspend cancellation fails to abort the suspend process, overwrites the error code, and incorrectly uses a runtime PM resume function for recovery, leaving the device in an inconsistent state.
--

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

drm/xe: Poll GT for C6 before D3

This commit adds a check to ensure GTs are in C6 before transitioning
to D3 during suspend. If the GTs are not in C6, it attempts to resume
the device and abort the suspend.

> diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
> index 278cfd390364c..04f0884f21c1b 100644
> --- a/drivers/gpu/drm/xe/xe_pci.c
> +++ b/drivers/gpu/drm/xe/xe_pci.c
> @@ -1342,6 +1342,15 @@ static int xe_pci_suspend(struct device *dev)
>  	 */
>  	d3cold_toggle(pdev, D3COLD_ENABLE);
>  
> +	err = xe_pm_check_runtime_idle(xe);
> +	if (err) {
> +		err = xe_pm_runtime_resume(xe);
> +		if (err) {
> +			drm_err(&xe->drm, "Resume failed after suspend was canceled");
> +			return err;
> +		}
> +	}

[Severity: High]
If xe_pm_check_runtime_idle() returns an error to abort the suspend, this
block assigns the result of xe_pm_runtime_resume() to the same 'err'
variable. 

If the resume succeeds and returns 0, the function will continue executing
and return 0. Doesn't this overwrite the abort error code and allow the
system suspend to proceed instead of successfully cancelling it?

Additionally, xe_pci_suspend() is a system PM suspend path. Calling
xe_pm_runtime_resume() here invokes runtime PM semantics which skip certain
initializations based on the xe->d3cold.allowed flag. 

Since system PM paths require full hardware reinitialization unconditionally,
does this unwinding path need to use xe_pm_resume() or an equivalent system
PM recovery function to ensure the device is left in a consistent state?

> +
>  	pci_save_state(pdev);
>  	pci_disable_device(pdev);
>  	pci_set_power_state(pdev, PCI_D3cold);

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

  reply	other threads:[~2026-09-10 21:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10 21:28 [PATCH v2 1/2] drm/xe: Inspect all forcewake bits for runtime idleness Vinay Belgaumkar
2026-09-10 21:28 ` [PATCH v2 2/2] drm/xe: Poll GT for C6 before D3 Vinay Belgaumkar
2026-09-10 21:41   ` sashiko-bot [this message]
2026-09-10 22:23   ` Rodrigo Vivi
2026-09-10 21:41 ` ✓ CI.KUnit: success for series starting with [v2,1/2] drm/xe: Inspect all forcewake bits for runtime idleness Patchwork
2026-09-10 21:45 ` [PATCH v2 1/2] " sashiko-bot
2026-09-10 21:53   ` Belgaumkar, Vinay
2026-09-10 22:17 ` Rodrigo Vivi
2026-09-10 23:00   ` Belgaumkar, Vinay
2026-09-11 21:58     ` Rodrigo Vivi
2026-09-11 23:02       ` Belgaumkar, Vinay
2026-09-10 22:35 ` ✓ Xe.CI.BAT: success for series starting with [v2,1/2] " Patchwork
2026-09-11  7:03 ` ✗ Xe.CI.FULL: failure " 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=20260910214130.BAA2A1F000FF@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 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.