aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
diff options
context:
space:
mode:
authorMikita Lipski <[email protected]>2018-03-15 13:37:08 +0000
committerAlex Deucher <[email protected]>2018-03-21 04:44:03 +0000
commit088e7c16170645f1e2298ec6e0029079ef603635 (patch)
treed99fe9c189125a528fbdece5eda5f755402c37b4 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
parentdrm/amdgpu: Use atomic function to disable crtcs with dc enabled (diff)
downloadkernel-088e7c16170645f1e2298ec6e0029079ef603635.tar.gz
kernel-088e7c16170645f1e2298ec6e0029079ef603635.zip
drm/amdgpu: Disable irq on device before destroying it
Disable irq on devices before destroying them. That prevents use-after-free memory access when unloading the driver. Signed-off-by: Mikita Lipski <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index cdf7a6cde603..f59b017e4c61 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1722,6 +1722,9 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
int i, r;
amdgpu_amdkfd_device_fini(adev);
+ /* disable all interrupts */
+ amdgpu_irq_disable_all(adev);
+
/* need to disable SMC first */
for (i = 0; i < adev->num_ip_blocks; i++) {
if (!adev->ip_blocks[i].status.hw)
@@ -1773,8 +1776,6 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
adev->ip_blocks[i].status.hw = false;
}
- /* disable all interrupts */
- amdgpu_irq_disable_all(adev);
for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
if (!adev->ip_blocks[i].status.sw)