Skip to contentSkip to conversation

drm/amdgpu: fix the hibernation suspend with s0ix

PATCH In review Prike Liang 3 participants 4 messages Mar 9, 2021

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

PATCH 1/1 drm/amdgpu: fix the hibernation suspend with s0ix

During system hibernation suspend still need un-gate gfx CG/PG firstly to handle HW status check before HW resource destory.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -2
index e247c3a..7079bfc 100644
@@ -2683,7 +2683,7 @@ static int amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev)
 {
 	int i, r;
 
-	if (adev->in_poweroff_reboot_com ||
+	if (adev->in_poweroff_reboot_com || adev->in_hibernate ||
 	    !amdgpu_acpi_is_s0ix_supported(adev) || amdgpu_in_reset(adev)) {
 		amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
 		amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
@@ -3750,7 +3750,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
 
 	amdgpu_fence_driver_suspend(adev);
 
-	if (adev->in_poweroff_reboot_com ||
+	if (adev->in_poweroff_reboot_com || adev->in_hibernate ||
 	    !amdgpu_acpi_is_s0ix_supported(adev) || amdgpu_in_reset(adev))
 		r = amdgpu_device_ip_suspend_phase2(adev);
 	else
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Prike Liang

During system hibernation suspend still need un-gate gfx CG/PG firstly to handle HW status check before HW resource destory.

This is fine for stable, but we should work on cleaning this up. I have a patch set to improve this, but it's more invasive. We really need to sort out what specific parts of amdgpu_device_ip_suspend_phase2() are problematic and special case them. We shouldn't just be skipping that function.

Alex

Quoted 29 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -3
index e247c3a..7079bfc 100644
@@ -2683,7 +2683,7 @@ static int amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev)
 {
        int i, r;
 
-       if (adev->in_poweroff_reboot_com ||
+       if (adev->in_poweroff_reboot_com || adev->in_hibernate ||
            !amdgpu_acpi_is_s0ix_supported(adev) || amdgpu_in_reset(adev)) {
                amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
                amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
@@ -3750,7 +3750,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)
 
        amdgpu_fence_driver_suspend(adev);
 
-       if (adev->in_poweroff_reboot_com ||
+       if (adev->in_poweroff_reboot_com || adev->in_hibernate ||
            !amdgpu_acpi_is_s0ix_supported(adev) || amdgpu_in_reset(adev))
                r = amdgpu_device_ip_suspend_phase2(adev);
        else
--

2.7.4

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

#2 lore raw
Quoted 15 lines

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Tuesday, March 9, 2021 12:07 PM
To: Liang, Prike <[email protected]>
Cc: amd-gfx list <[email protected]>; Deucher, Alexander <[email protected]>; Huang, Ray <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: fix the hibernation suspend with s0ix

Quoted 4 lines · Prike Liang

During system hibernation suspend still need un-gate gfx CG/PG firstly to handle HW status check before HW resource destory.

Quoted 7 lines
Quoted 1 line

This is fine for stable, but we should work on cleaning this up. I have a patch set to improve this, but it's more invasive. We really need to sort out what specific parts of
amdgpu_device_ip_suspend_phase2() are problematic and special case them. We shouldn't just be skipping that function.

[Prike] Yeah in this stage we're just try make the s0ix been functional and stable. The AMDGPU work mode is aligning with windows KMD s0ix sequence and only suspend the DCE and IH for s0i3 entry . Will try figure out the each GNB IP idle off dependency and then improve the AMDGPU suspend/resume sequence for system-wide Sx entry/exit.

Quoted 47 lines

Alex

Quoted 10 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index e247c3a..7079bfc 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int · line 2687

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
@@ -2683,7 +2683,7 @@ static int
 amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev)  {
        int i, r;
 
-       if (adev->in_poweroff_reboot_com ||
+       if (adev->in_poweroff_reboot_com || adev->in_hibernate ||
            !amdgpu_acpi_is_s0ix_supported(adev) || amdgpu_in_reset(adev))

{

Quoted 15 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
                amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
                amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
@@ -3750,7 +3750,7 @@ int amdgpu_device_suspend(struct drm_device
 *dev, bool fbcon)
 
        amdgpu_fence_driver_suspend(adev);
 
-       if (adev->in_poweroff_reboot_com ||
+       if (adev->in_poweroff_reboot_com || adev->in_hibernate ||
            !amdgpu_acpi_is_s0ix_supported(adev) || amdgpu_in_reset(adev))
                r = amdgpu_device_ip_suspend_phase2(adev);

else
--
2.7.4

Quoted 5 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-

gfx&amp;data=04%7C01%7CPr

Quoted 1 line

ike.Liang%40amd.com%7C641ed997755644a7c30a08d8e2b0d7bf%7C3dd896 1fe4884

Quoted 1 line
Quoted 9 lines

e608e11a82d994e183d%7C0%7C0%7C637508596461291719%7CUnknown%7 CTWFpbGZsb

Quoted 1 line

3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0 %3D%

Quoted 1 line

7C1000&amp;sdata=J%2Figj9QUO6Vk74BeE3udM5yVgloUanpXtJUue3pJoFI% 3D&amp;

Quoted 1 line

reserved=0

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

Acked-by
#3 lore raw
Quoted 15 lines · Prike
Quoted 15 lines

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Tuesday, March 9, 2021 12:07 PM
To: Liang, Prike <[email protected]>
Cc: amd-gfx list <[email protected]>; Deucher, Alexander <[email protected]>; Huang, Ray <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: fix the hibernation suspend with s0ix

Quoted 4 lines · Prike Liang

During system hibernation suspend still need un-gate gfx CG/PG firstly to handle HW status check before HW resource destory.

Quoted 9 lines
Quoted 7 lines
Quoted 1 line

This is fine for stable, but we should work on cleaning this up. I have a patch set to improve this, but it's more invasive. We really need to sort out what specific parts of
amdgpu_device_ip_suspend_phase2() are problematic and special case them. We shouldn't just be skipping that function.

[Prike] Yeah in this stage we're just try make the s0ix been functional and stable. The AMDGPU work mode is aligning with windows KMD s0ix sequence and only suspend the DCE and IH for s0i3 entry . Will try figure out the each GNB IP idle off dependency and then improve the AMDGPU suspend/resume sequence for system-wide Sx entry/exit.

Maybe we need a comment before amdgpu_device_ip_suspend_phase2() to mark it as TODO. For this moment, it's ok for me as well.

Quoted 50 lines
Quoted 50 lines

Alex

Quoted 10 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index e247c3a..7079bfc 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int · line 2687

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
@@ -2683,7 +2683,7 @@ static int
 amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev)  {
        int i, r;
 
-       if (adev->in_poweroff_reboot_com ||
+       if (adev->in_poweroff_reboot_com || adev->in_hibernate ||
            !amdgpu_acpi_is_s0ix_supported(adev) || amdgpu_in_reset(adev))

{

Quoted 15 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
                amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
                amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
@@ -3750,7 +3750,7 @@ int amdgpu_device_suspend(struct drm_device
 *dev, bool fbcon)
 
        amdgpu_fence_driver_suspend(adev);
 
-       if (adev->in_poweroff_reboot_com ||
+       if (adev->in_poweroff_reboot_com || adev->in_hibernate ||
            !amdgpu_acpi_is_s0ix_supported(adev) || amdgpu_in_reset(adev))
                r = amdgpu_device_ip_suspend_phase2(adev);

else
--
2.7.4

Quoted 5 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-

gfx&amp;data=04%7C01%7CPr

Quoted 1 line

ike.Liang%40amd.com%7C641ed997755644a7c30a08d8e2b0d7bf%7C3dd896 1fe4884

Quoted 1 line

e608e11a82d994e183d%7C0%7C0%7C637508596461291719%7CUnknown%7 CTWFpbGZsb

Quoted 1 line
Quoted 6 lines
Quoted 6 lines

3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0 %3D%

Quoted 1 line

7C1000&amp;sdata=J%2Figj9QUO6Vk74BeE3udM5yVgloUanpXtJUue3pJoFI% 3D&amp;

Quoted 1 line

reserved=0

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