]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/radeon: Don't leak runtime pm ref on driver unload
authorLukas Wunner <lukas@wunner.de>
Wed, 8 Jun 2016 16:47:27 +0000 (18:47 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 20 Nov 2016 01:16:42 +0000 (01:16 +0000)
commit 19de659cb7216eb1c04889bd1a248593f296e19f upstream.

radeon_driver_load_kms() calls pm_runtime_put_autosuspend() if
radeon_is_px(dev), but radeon_driver_unload_kms() calls
pm_runtime_get_sync() unconditionally. We therefore leak a runtime pm
ref whenever radeon is unloaded on a non-PX machine or if runpm=0. The
GPU will subsequently never runtime suspend after loading radeon again.

Fix by taking the runtime pm ref under the same condition that it was
released on driver load.

Fixes: 10ebc0bc0934 ("drm/radeon: add runtime PM support (v2)")
Cc: Dave Airlie <airlied@redhat.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/aaf71106c042126817aeca8b8e54ed468ab61ef7.1465392124.git.lukas@wunner.de
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/gpu/drm/radeon/radeon_kms.c

index b63094746b505c8d0e0243b2bf9961171c68e0f9..907ad15a84857f34522fdc413ba4653f386cc29e 100644 (file)
@@ -61,7 +61,9 @@ int radeon_driver_unload_kms(struct drm_device *dev)
        if (rdev->rmmio == NULL)
                goto done_free;
 
-       pm_runtime_get_sync(dev->dev);
+       if (radeon_is_px(dev)) {
+               pm_runtime_get_sync(dev->dev);
+       }
 
        radeon_acpi_fini(rdev);