From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Guangshuo Li <lgs201920130244@gmail.com>
Cc: "Matthew Brost" <matthew.brost@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] drm/xe: fix autosuspend cleanup during teardown
Date: Mon, 24 Aug 2026 15:36:46 -0400 [thread overview]
Message-ID: <aoydTpq-TKqASiD6@intel.com> (raw)
In-Reply-To: <20260808144907.2918746-1-lgs201920130244@gmail.com>
On Sat, Aug 08, 2026 at 10:49:07PM +0800, Guangshuo Li wrote:
> xe_pm_runtime_init() calls pm_runtime_use_autosuspend(), but
> xe_pm_runtime_fini() does not call the matching
> pm_runtime_dont_use_autosuspend() during teardown.
>
> If the autosuspend delay is set to a negative value while autosuspend
> is enabled, the runtime PM core increments usage_count to prevent
> runtime suspend. Without calling pm_runtime_dont_use_autosuspend()
> during teardown, this reference is not dropped.
>
> The documentation for pm_runtime_use_autosuspend() also notes that it
> is important to undo it with pm_runtime_dont_use_autosuspend() at
> driver exit time, unless runtime PM was initially enabled with
> devm_pm_runtime_enable().
>
> Add the missing pm_runtime_dont_use_autosuspend() call to the runtime
> PM teardown path.
>
> This issue was found by manual code inspection.
Thanks for your contribution, but I believe this needs further explanation.
I only see this function getting used in pair with the _enable and _disable
never paierd with _allowed _forbid pair... Why in this case we would need
this?
>
> Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
> Cc: stable@vger.kernel.org
> Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
> ---
> drivers/gpu/drm/xe/xe_pm.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
> index 99562f691080..301789adaa21 100644
> --- a/drivers/gpu/drm/xe/xe_pm.c
> +++ b/drivers/gpu/drm/xe/xe_pm.c
> @@ -518,6 +518,7 @@ static void xe_pm_runtime_fini(struct xe_device *xe)
> if (IS_SRIOV_VF(xe))
> return;
>
> + pm_runtime_dont_use_autosuspend(dev);
> pm_runtime_get_sync(dev);
> pm_runtime_forbid(dev);
> }
> --
> 2.43.0
>
prev parent reply other threads:[~2026-08-24 19:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-08 14:49 Guangshuo Li
2026-08-24 19:36 ` Rodrigo Vivi [this message]
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=aoydTpq-TKqASiD6@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=lgs201920130244@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.brost@intel.com \
--cc=simona@ffwll.ch \
--cc=stable@vger.kernel.org \
--cc=thomas.hellstrom@linux.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
all inboxes | Powered by JetHome®