All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Avoid leaking PM domain on driver unbind
@ 2018-01-21 12:46 Lukas Wunner
       [not found] ` <8cbcbe7f57f72bc1d4e36c9cfaf670140e311da9.1516538481.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Lukas Wunner @ 2018-01-21 12:46 UTC (permalink / raw)
  To: Alex Deucher, Christian Koenig, David (ChunMing) Zhou
  Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

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@vger.kernel.org
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Lukas Wunner <lukas@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

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-23 14:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-21 12:46 [PATCH] drm/amdgpu: Avoid leaking PM domain on driver unbind Lukas Wunner
     [not found] ` <8cbcbe7f57f72bc1d4e36c9cfaf670140e311da9.1516538481.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2018-01-23  4:22   ` Alex Deucher
     [not found]     ` <CADnq5_PrAtz=rO1E_Tkg0+n880FwOAyowMW2WampSpVx+69CLA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-23 14:53       ` Lukas Wunner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.