Re: [PATCH] drm/radeon: fix autosuspend cleanup during teardown

Alex Deucher <[email protected]>
Newsgroups org.freedesktop.lists.amd-gfx,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel,org.kernel.vger.stable
Message-ID <CADnq5_MTp9ZJw6f0Pu52kS-sP4xrntBj4kBvZtkbmcd1LC6ewA@mail.gmail.com>
Applied.  Thanks!

On Sat, Aug 8, 2026 at 10:20 AM Guangshuo Li <[email protected]> wrote:
>
> radeon_driver_load_kms() calls pm_runtime_use_autosuspend() for PX
> devices, but radeon_driver_unload_kms() 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 driver
> unload path.
>
> This issue was found by manual code inspection.
>
> Fixes: 10ebc0bc0934 ("drm/radeon: add runtime PM support (v2)")
> Cc: [email protected]
> Signed-off-by: Guangshuo Li <[email protected]>
> ---
>  drivers/gpu/drm/radeon/radeon_kms.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
> index dc43fd790a9c..4a99c09f4164 100644
> --- a/drivers/gpu/drm/radeon/radeon_kms.c
> +++ b/drivers/gpu/drm/radeon/radeon_kms.c
> @@ -71,6 +71,7 @@ void radeon_driver_unload_kms(struct drm_device *dev)
>         if (radeon_is_px(dev)) {
>                 pm_runtime_get_sync(dev->dev);
>                 pm_runtime_forbid(dev->dev);
> +               pm_runtime_dont_use_autosuspend(dev->dev);
>         }
>
>         radeon_acpi_fini(rdev);
> --
> 2.43.0
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.