summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
diff options
context:
space:
mode:
authorLukas Wunner <lukas@wunner.de>2016-06-08 18:47:27 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-06-24 08:49:32 +0200
commit6ce62d8b6f5683375d71a0bb51d60bf71615af27 (patch)
tree60d98e604c3da34fdc95e99a84b7923cd6f6edad /drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
parentc9c9bbd754e5f342977b32a328849cc0d9c15c93 (diff)
drm/amdgpu: Forbid runtime pm on driver unload
The PCI core calls pm_runtime_forbid() on device probe in pci_pm_init(), making this the default state when amdgpu is loaded. amdgpu_driver_load_kms() therefore calls pm_runtime_allow(), but there's no pm_runtime_forbid() in amdgpu_driver_unload_kms() to balance it. Add it so that we leave the device in the same state that we found it. This isn't a bug, it's just good housekeeping. When amdgpu is first loaded with runpm=1, then unloaded and loaded again with runpm=0, pm_runtime_forbid() will be called from amdgpu_pmops_runtime_idle() or amdgpu_pmops_runtime_suspend(), so the behaviour is correct. If there ever is a third party driver for AMD cards, this commit avoids that it has to clean up behind amdgpu. 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/ccd4f7208acbd7761364418fc34f7849acbb4597.1465392124.git.lukas@wunner.de
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 0db692ef3d25..38a28d137f1d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -62,6 +62,7 @@ int amdgpu_driver_unload_kms(struct drm_device *dev)
if (amdgpu_device_is_px(dev)) {
pm_runtime_get_sync(dev->dev);
+ pm_runtime_forbid(dev->dev);
}
amdgpu_amdkfd_device_fini(adev);