Skip to contentSkip to conversation

drm/amdgpu: add missing pci_disable_device() in amdgpu_pmops_runtime_resume()

PATCH Applied Yang Yingliang 2 participants 2 messages Aug 26, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: add missing pci_disable_device() in amdgpu_pmops_runtime_resume()

Add missing pci_disable_device() if amdgpu_device_resume() fails.

Fixes 8e4d5d43cc6c ("drm/amdgpu: Handling of amdgpu_device_resume return value for graceful teardown")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -1
index 429fcdf28836..de7144b06e93 100644
@@ -2563,8 +2563,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;
Signature · 1 line
2.25.1
Applied
#1 lore raw

Applied. Thanks!

Alex

Quoted 29 lines · Yang Yingliang

Add missing pci_disable_device() if amdgpu_device_resume() fails.

Fixes 8e4d5d43cc6c ("drm/amdgpu: Handling of amdgpu_device_resume return value for graceful teardown")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 -2
index 429fcdf28836..de7144b06e93 100644
@@ -2563,8 +2563,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;
--

2.25.1