Skip to contentSkip to conversation

Handling of amdgpu_device_resume return value for graceful teardown

PATCH Applied [email protected] 2 participants 3 messages Apr 27, 2021 – Apr 28, 2021

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

PATCH 1/1 Handling of amdgpu_device_resume return value for graceful teardown

From: Pavan Kumar Ramayanam <[email protected]>

The runtime resume PM op disregards the return value from amdgpu_device_resume(), masking errors for failed resumes at the PM layer.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +3 -0
index 0369d3532bf0..03f3cf194300 100644
@@ -1574,6 +1574,9 @@ static int amdgpu_pmops_runtime_resume(struct device *dev)
 		amdgpu_device_baco_exit(drm_dev);
 	}
 	ret = amdgpu_device_resume(drm_dev, false);
+	if (ret)
+		return ret;
+
 	if (amdgpu_device_supports_px(drm_dev))
 		drm_dev->switch_power_state = DRM_SWITCH_POWER_ON;
 	adev->in_runpm = false;
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · On Tue, Apr 27, 2021 at 12:51 AM <[email protected]> wrote:

From: Pavan Kumar Ramayanam <[email protected]>

The runtime resume PM op disregards the return value from amdgpu_device_resume(), masking errors for failed resumes at the PM layer.

Subject should be prefixed with drm/amdgpu:, with that fixed,

Do you need me to commit this for you?

Alex

Quoted 21 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +3 -1
index 0369d3532bf0..03f3cf194300 100644
@@ -1574,6 +1574,9 @@ static int amdgpu_pmops_runtime_resume(struct device *dev)
                amdgpu_device_baco_exit(drm_dev);
        }
        ret = amdgpu_device_resume(drm_dev, false);
+       if (ret)
+               return ret;
+
        if (amdgpu_device_supports_px(drm_dev))
                drm_dev->switch_power_state = DRM_SWITCH_POWER_ON;
        adev->in_runpm = false;
--

2.17.1

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Applied
#2 lore raw

Applied. Thanks!

Alex

Quoted 40 lines · Alex Deucher
Quoted 8 lines · On Tue, Apr 27, 2021 at 12:51 AM <[email protected]> wrote:

From: Pavan Kumar Ramayanam <[email protected]>

The runtime resume PM op disregards the return value from amdgpu_device_resume(), masking errors for failed resumes at the PM layer.

Subject should be prefixed with drm/amdgpu:, with that fixed,

Do you need me to commit this for you?

Alex

Quoted 21 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +3 -1
index 0369d3532bf0..03f3cf194300 100644
@@ -1574,6 +1574,9 @@ static int amdgpu_pmops_runtime_resume(struct device *dev)
                amdgpu_device_baco_exit(drm_dev);
        }
        ret = amdgpu_device_resume(drm_dev, false);
+       if (ret)
+               return ret;
+
        if (amdgpu_device_supports_px(drm_dev))
                drm_dev->switch_power_state = DRM_SWITCH_POWER_ON;
        adev->in_runpm = false;
--

2.17.1

Quoted 4 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx