drm/amdgpu: don't do resets on APUs which don't support it
Subsystems (3)
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: don't do resets on APUs which don't support it
It can cause a hang. This is normally not enabled for GPU hangs on these asics, but was recently enabled for handling aborted suspends. This causes hangs on some platforms on suspend.
--- drivers/gpu/drm/amd/amdgpu/cik.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/vi.c | 4 ++++ 2 files changed, 8 insertions(+)
drivers/gpu/drm/amd/amdgpu/cik.c +4 -0
@@ -1428,6 +1428,10 @@ static int cik_asic_reset(struct amdgpu_device *adev) {int r; +/* APUs don't have full asic reset */ +if (adev->flags &AMD_IS_APU ) +return 0 ; +if (cik_asic_reset_method (adev) ==AMD_RESET_METHOD_BACO ) {dev_info (adev->dev,"BACO reset\n" ); r =amdgpu_dpm_baco_reset (adev);
drivers/gpu/drm/amd/amdgpu/vi.c +4 -0
@@ -956,6 +956,10 @@ static int vi_asic_reset(struct amdgpu_device *adev) {int r; +/* APUs don't have full asic reset */ +if (adev->flags &AMD_IS_APU ) +return 0 ; +if (vi_asic_reset_method (adev) ==AMD_RESET_METHOD_BACO ) {dev_info (adev->dev,"BACO reset\n" ); r =amdgpu_dpm_baco_reset (adev);
Signature · 1 line
2.34.1
Regards,
Guchun
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Thursday, January 13, 2022 12:01 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; [email protected]
Subject: [PATCH] drm/amdgpu: don't do resets on APUs which don't support it
It can cause a hang. This is normally not enabled for GPU hangs on these asics, but was recently enabled for handling aborted suspends. This causes hangs on some platforms on suspend.
--- drivers/gpu/drm/amd/amdgpu/cik.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/vi.c | 4 ++++ 2 files changed, 8 insertions(+)
drivers/gpu/drm/amd/amdgpu/cik.c +4 -0
@@ -1428,6 +1428,10 @@ static int cik_asic_reset(struct amdgpu_device *adev) {int r; +/* APUs don't have full asic reset */ +if (adev->flags &AMD_IS_APU ) +return 0 ; +if (cik_asic_reset_method (adev) ==AMD_RESET_METHOD_BACO ) {dev_info (adev->dev,"BACO reset\n" ); r =amdgpu_dpm_baco_reset (adev);
drivers/gpu/drm/amd/amdgpu/vi.c +4 -1
@@ -956,6 +956,10 @@ static int vi_asic_reset(struct amdgpu_device *adev) {int r; +/* APUs don't have full asic reset */ +if (adev->flags &AMD_IS_APU ) +return 0 ; +if (vi_asic_reset_method (adev) ==AMD_RESET_METHOD_BACO ) {dev_info (adev->dev,"BACO reset\n" ); r =amdgpu_dpm_baco_reset (adev); --
2.34.1
Hi Alex,
What about something like this?
bool amdgpu_device_reset_on_suspend(struct amdgpu_device *adev)
{
if (adev->in_s0ix || adev->gmc.xgmi.num_physical_nodes > 1)
return false;
switch (amdgpu_asic_reset_method(adev)) {
case AMD_RESET_METHOD_BACO:
case AMD_RESET_METHOD_MODE1:
case AMD_RESET_METHOD_MODE2:
return true;
}
return false;
}Thanks,
Lijo
Quoted 45 lines · Alex Deucher
It can cause a hang. This is normally not enabled for GPU hangs on these asics, but was recently enabled for handling aborted suspends. This causes hangs on some platforms on suspend.
Fixes daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)")Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/cik.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/vi.c | 4 ++++ 2 files changed, 8 insertions(+)drivers/gpu/drm/amd/amdgpu/cik.c +4
-0@@ -1428,6 +1428,10 @@ static int cik_asic_reset(struct amdgpu_device *adev) {int r; +/* APUs don't have full asic reset */ +if (adev->flags &AMD_IS_APU ) +return 0 ; +if (cik_asic_reset_method (adev) ==AMD_RESET_METHOD_BACO ) {dev_info (adev->dev,"BACO reset\n" ); r =amdgpu_dpm_baco_reset (adev);drivers/gpu/drm/amd/amdgpu/vi.c +4
-0@@ -956,6 +956,10 @@ static int vi_asic_reset(struct amdgpu_device *adev) {int r; +/* APUs don't have full asic reset */ +if (adev->flags &AMD_IS_APU ) +return 0 ; +if (vi_asic_reset_method (adev) ==AMD_RESET_METHOD_BACO ) {dev_info (adev->dev,"BACO reset\n" ); r =amdgpu_dpm_baco_reset (adev);
Quoted 16 lines · Lijo
Hi Alex,
What about something like this?
bool
amdgpu_device_reset_on_suspend(struct amdgpu_device *adev){
if (adev->in_s0ix||adev->gmc.xgmi.num_physical_nodes> 1) return false;switch (
amdgpu_asic_reset_method(adev)) { caseAMD_RESET_METHOD_BACO:
caseAMD_RESET_METHOD_MODE1:
caseAMD_RESET_METHOD_MODE2:
return true;
}
Quoted 3 lines
return false;
}
I think the approach that Alex shared *might* be more flexible to also be used in the aborted suspend case too on s0ix. There is some discussions going on for that right now.
Quoted 49 lines
Thanks,
LijoQuoted 44 lines · Alex Deucher
It can cause a hang. This is normally not enabled for GPU hangs on these asics, but was recently enabled for handling aborted suspends. This causes hangs on some platforms on suspend.
Fixes daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)")Signed-off-by Alex Deucher <[email protected]>---
drivers/gpu/drm/amd/amdgpu/cik.c| 4 ++++
drivers/gpu/drm/amd/amdgpu/vi.c | 4 ++++2 files changed, 8 insertions(+)drivers/gpu/drm/amd/amdgpu/cik.c +4
-0@@ -1428,6 +1428,10 @@ static int cik_asic_reset(struct amdgpu_device *adev) { int r; + /* APUs don't have full asic reset */ + if (adev->flags & AMD_IS_APU) + return 0; + if (cik_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) { dev_info(adev->dev, "BACO reset\n"); r = amdgpu_dpm_baco_reset(adev);drivers/gpu/drm/amd/amdgpu/vi.c +4
-0@@ -956,6 +956,10 @@ static int vi_asic_reset(struct amdgpu_device *adev) { int r; + /* APUs don't have full asic reset */ + if (adev->flags & AMD_IS_APU) + return 0; + if (vi_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) { dev_info(adev->dev, "BACO reset\n"); r = amdgpu_dpm_baco_reset(adev);
Quoted 6 lines · Lijo
Hi Alex,
What about something like this?
bool
amdgpu_device_reset_on_suspend(struct amdgpu_device *adev)
Quoted 8 lines
{
if (adev->in_s0ix || adev->gmc.xgmi.num_physical_nodes > 1)
return false;
switch (amdgpu_asic_reset_method(adev)) {
case AMD_RESET_METHOD_BACO:
case AMD_RESET_METHOD_MODE1:
case AMD_RESET_METHOD_MODE2:This should also work on AMD_RESET_METHOD_LEGACY, at least for dGPUs. I think the current approach is probably better since I don't think GPU resets work reliably on these chips anyway (it's not enabled by default on them gor hangs), so better to just not do it as it may make the problem worse.
Alex
Quoted 55 lines
return true; } return false; }Thanks,
LijoQuoted 45 lines · Alex Deucher
It can cause a hang. This is normally not enabled for GPU hangs on these asics, but was recently enabled for handling aborted suspends. This causes hangs on some platforms on suspend.
Fixes daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)")Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/cik.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/vi.c | 4 ++++ 2 files changed, 8 insertions(+)drivers/gpu/drm/amd/amdgpu/cik.c +4
-0@@ -1428,6 +1428,10 @@ static int cik_asic_reset(struct amdgpu_device *adev) {int r; +/* APUs don't have full asic reset */ +if (adev->flags &AMD_IS_APU ) +return 0 ; +if (cik_asic_reset_method (adev) ==AMD_RESET_METHOD_BACO ) {dev_info (adev->dev,"BACO reset\n" ); r =amdgpu_dpm_baco_reset (adev);drivers/gpu/drm/amd/amdgpu/vi.c +4
-0@@ -956,6 +956,10 @@ static int vi_asic_reset(struct amdgpu_device *adev) {int r; +/* APUs don't have full asic reset */ +if (adev->flags &AMD_IS_APU ) +return 0 ; +if (vi_asic_reset_method (adev) ==AMD_RESET_METHOD_BACO ) {dev_info (adev->dev,"BACO reset\n" ); r =amdgpu_dpm_baco_reset (adev);