drm/amdgpu: don't use BACO for reset in S3
Subsystems (3)
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: don't use BACO for reset in S3
Seems to cause a reboots or hangs on some systems.
--- drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +3 -0
@@ -173,6 +173,9 @@ bool amdgpu_dpm_is_baco_supported(struct amdgpu_device *adev)if (!pp_funcs || !pp_funcs->get_asic_baco_capability)return false; +/* don't use baco for reset in S3 */ +if (adev->in_s3) +return false;mutex_lock (&adev->pm.mutex);
Signature · 1 line
2.35.1
Dear Alex,
Thank you for your patch.
Am 31.03.22 um 16:56 schrieb Alex Deucher:
Quoted 1 line
Seems to cause a reboots or hangs on some systems.
It’d be great if you listed the systems from the bug reports.
Quoted 13 lines
Fixes daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)")Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/amd/pm/amdgpu_dpm.c +0
-0
drivers/gpu/drm/amd/pm/amdgpu_dpm.c bool amdgpu_dpm_is_baco_supported(struct amdgpu_device *adev) · line 176
Quoted 4 lines
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +1
-0@@ -173,6 +173,9 @@ bool amdgpu_dpm_is_baco_supported(struct amdgpu_device *adev)if (!pp_funcs || !pp_funcs->get_asic_baco_capability)return false; +/* don't use baco for reset in S3 */
In issue #1924, I think you also write, it’s a workaround. Maybe make that clear in the comment?
drivers/gpu/drm/amd/pm/amdgpu_dpm.c bool amdgpu_dpm_is_baco_supported(struct amdgpu_device *adev) · line 181
Quoted 5 lines
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +2
-0+if (adev->in_s3) +return false;mutex_lock (&adev->pm.mutex);
Kind regards,
Paul
Quoted 15 lines · Alex Deucher
Seems to cause a reboots or hangs on some systems.
Fixes daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)")Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/amd/pm/amdgpu_dpm.c +0
-0
drivers/gpu/drm/amd/pm/amdgpu_dpm.c bool amdgpu_dpm_is_baco_supported(struct amdgpu_device *adev) · line 179
Quoted 7 lines
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +3
-0@@ -173,6 +173,9 @@ bool amdgpu_dpm_is_baco_supported(struct amdgpu_device *adev)if (!pp_funcs || !pp_funcs->get_asic_baco_capability)return false; +/* don't use baco for reset in S3 */ +if (adev->in_s3) +return false;
Suggest to add && !adev->runpm to the workaround. For runpm supported devices, most likely it should work.
Thanks,
Lijo
Quoted 3 lines
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +0
-0mutex_lock (&adev->pm.mutex);
Quoted 20 lines · Lijo
Quoted 16 lines · Alex Deucher
Seems to cause a reboots or hangs on some systems.
Fixes daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)")Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/amd/pm/amdgpu_dpm.c +0
-0@@ -173,6 +173,9 @@ bool amdgpu_dpm_is_baco_supported(struct amdgpu_device *adev)
Quoted 9 lines
drivers/gpu/drm/amd/pm/amdgpu_dpm.c bool amdgpu_dpm_is_baco_supported(struct amdgpu_device *adev) · line 179
Quoted 6 lines
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +3
-0if (!pp_funcs || !pp_funcs->get_asic_baco_capability)return false; +/* don't use baco for reset in S3 */ +if (adev->in_s3) +return false;Suggest to add && !adev->runpm to the workaround. For runpm supported devices, most likely it should work.
hmm. I've kind of gone back and forth with this. BACO works fine for runtime suspend on all of the GPUs that reported problems in the bugs. I think it's probably something timing related with the state of the system during suspend. Actually, thinking about it more, I think it may be related to the fact that BACO also controls the power to other devices on the GPU (e.g., audio or USB). For runtime suspend, that is handled via device dependencies, but at system suspend time, perhaps the BACO sequence causes havoc with the other devices.
Alex
Quoted 7 lines
Thanks,
LijoQuoted 3 lines
drivers/gpu/drm/amd/pm/amdgpu_dpm.c +0
-0mutex_lock (&adev->pm.mutex);