[PATCH 2/2] drm/amgpu: Check return value of amdgpu_device_baco_enter/exit

Ma Jun Jun.Ma2 at amd.com
Wed Feb 28 11:44:40 UTC 2024


Check return value of amdgpu_device_baco_enter/exit and print
warning message because these errors may cause runtime resume failure

Signed-off-by: Ma Jun <Jun.Ma2 at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 8b83c26dc018..11e089cfb465 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -2705,7 +2705,9 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev)
 	} else if (adev->pm.rpm_mode == AMDGPU_RUNPM_BOCO) {
 		/* nothing to do */
 	} else if (adev->pm.rpm_mode == AMDGPU_RUNPM_BACO) {
-		amdgpu_device_baco_enter(drm_dev);
+		ret = amdgpu_device_baco_enter(drm_dev);
+		if (ret)
+			dev_warn(&pdev->dev, "warning: device fails to enter baco. ret=%d\n", ret);
 	}
 
 	dev_dbg(&pdev->dev, "asic/device is runtime suspended\n");
@@ -2745,7 +2747,9 @@ static int amdgpu_pmops_runtime_resume(struct device *dev)
 		 */
 		pci_set_master(pdev);
 	} else if (adev->pm.rpm_mode == AMDGPU_RUNPM_BACO) {
-		amdgpu_device_baco_exit(drm_dev);
+		ret = amdgpu_device_baco_exit(drm_dev);
+		if (ret)
+			dev_warn(&pdev->dev, "warning: device fails to exit from baco. ret=%d\n", ret);
 	}
 	ret = amdgpu_device_resume(drm_dev, false);
 	if (ret) {
-- 
2.34.1



More information about the amd-gfx mailing list