Commit bd1328b4 authored by Alex Deucher's avatar Alex Deucher Committed by Greg Kroah-Hartman

drm/radeon/px: fix module unload

commit 2e97140d upstream.

Use the new vga_switcheroo_fini_domain_pm_ops function
to unregister the pm ops.

Based on a patch from:
Pali Rohár <pali.rohar@gmail.com>

bug:
https://bugzilla.kernel.org/show_bug.cgi?id=84431Reviewed-by: default avatarBen Skeggs <bskeggs@redhat.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarPali Rohár <pali.rohar@gmail.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 97d30fa3
...@@ -1350,7 +1350,7 @@ int radeon_device_init(struct radeon_device *rdev, ...@@ -1350,7 +1350,7 @@ int radeon_device_init(struct radeon_device *rdev,
r = radeon_init(rdev); r = radeon_init(rdev);
if (r) if (r)
return r; goto failed;
r = radeon_ib_ring_tests(rdev); r = radeon_ib_ring_tests(rdev);
if (r) if (r)
...@@ -1370,7 +1370,7 @@ int radeon_device_init(struct radeon_device *rdev, ...@@ -1370,7 +1370,7 @@ int radeon_device_init(struct radeon_device *rdev,
radeon_agp_disable(rdev); radeon_agp_disable(rdev);
r = radeon_init(rdev); r = radeon_init(rdev);
if (r) if (r)
return r; goto failed;
} }
if ((radeon_testing & 1)) { if ((radeon_testing & 1)) {
...@@ -1392,6 +1392,11 @@ int radeon_device_init(struct radeon_device *rdev, ...@@ -1392,6 +1392,11 @@ int radeon_device_init(struct radeon_device *rdev,
DRM_INFO("radeon: acceleration disabled, skipping benchmarks\n"); DRM_INFO("radeon: acceleration disabled, skipping benchmarks\n");
} }
return 0; return 0;
failed:
if (runtime)
vga_switcheroo_fini_domain_pm_ops(rdev->dev);
return r;
} }
static void radeon_debugfs_remove_files(struct radeon_device *rdev); static void radeon_debugfs_remove_files(struct radeon_device *rdev);
...@@ -1412,6 +1417,8 @@ void radeon_device_fini(struct radeon_device *rdev) ...@@ -1412,6 +1417,8 @@ void radeon_device_fini(struct radeon_device *rdev)
radeon_bo_evict_vram(rdev); radeon_bo_evict_vram(rdev);
radeon_fini(rdev); radeon_fini(rdev);
vga_switcheroo_unregister_client(rdev->pdev); vga_switcheroo_unregister_client(rdev->pdev);
if (rdev->flags & RADEON_IS_PX)
vga_switcheroo_fini_domain_pm_ops(rdev->dev);
vga_client_register(rdev->pdev, NULL, NULL, NULL); vga_client_register(rdev->pdev, NULL, NULL, NULL);
if (rdev->rio_mem) if (rdev->rio_mem)
pci_iounmap(rdev->pdev, rdev->rio_mem); pci_iounmap(rdev->pdev, rdev->rio_mem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment