]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/radeon: fix autosuspend cleanup during teardown
authorGuangshuo Li <lgs201920130244@gmail.com>
Sat, 8 Aug 2026 13:59:42 +0000 (21:59 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 12 Aug 2026 14:21:23 +0000 (10:21 -0400)
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)")
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 0fdc1ff82ea14844c22795e9e0813c3ca03235e1)
Cc: stable@vger.kernel.org
drivers/gpu/drm/radeon/radeon_kms.c

index dc43fd790a9c10a8ae02f782052d93b2166bb594..4a99c09f41648391b0a0acf11a477e24c58f9e10 100644 (file)
@@ -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);