amdgpu_device_init() calls vga_switcheroo_init_domain_pm_ops() either if the device has the PowerXpress flag set or if the user has set the "runpm" module param to 1. However amdgpu_device_fini() calls vga_switcheroo_fini_domain_pm_ops() only under the first of those two conditions. (Note this issue isn't present in radeon. It was introduced when the driver was forked.) Cc: stable at vger.kernel.org Cc: Alex Deucher <alexander.deucher at amd.com> Signed-off-by: Lukas Wunner <lukas at wunner.de> --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index d09c4ee9f7e1..f07eedc53761 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -2083,7 +2083,7 @@ void amdgpu_device_fini(struct amdgpu_device *adev) adev->bios = NULL; if (!pci_is_thunderbolt_attached(adev->pdev)) vga_switcheroo_unregister_client(adev->pdev); - if (adev->flags & AMD_IS_PX) + if (adev->flags & AMD_IS_PX || amdgpu_runtime_pm == 1) vga_switcheroo_fini_domain_pm_ops(adev->dev); vga_client_register(adev->pdev, NULL, NULL, NULL); if (adev->rio_mem) -- 2.15.1