drm/amdgpu: add missing pci_disable_device() in amdgpu_pmops_runtime_resume()
authorYang Yingliang <yangyingliang@huawei.com>
Fri, 26 Aug 2022 08:57:54 +0000 (16:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:34:53 +0000 (12:34 +0200)
[ Upstream commit 6b11af6d1c8f5d4135332bb932baaa06e511173d ]

Add missing pci_disable_device() if amdgpu_device_resume() fails.

Fixes: 8e4d5d43cc6c ("drm/amdgpu: Handling of amdgpu_device_resume return value for graceful teardown")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

index f65b4b2..28dea2e 100644 (file)
@@ -2415,8 +2415,11 @@ static int amdgpu_pmops_runtime_resume(struct device *dev)
                amdgpu_device_baco_exit(drm_dev);
        }
        ret = amdgpu_device_resume(drm_dev, false);
-       if (ret)
+       if (ret) {
+               if (amdgpu_device_supports_px(drm_dev))
+                       pci_disable_device(pdev);
                return ret;
+       }
 
        if (amdgpu_device_supports_px(drm_dev))
                drm_dev->switch_power_state = DRM_SWITCH_POWER_ON;