All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: fix the hibernation suspend with s0ix
@ 2021-03-09  3:51 Prike Liang
  2021-03-09  4:07 ` Alex Deucher
  0 siblings, 1 reply; 4+ messages in thread
From: Prike Liang @ 2021-03-09  3:51 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alexander.Deucher, Prike Liang, ray.huang

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

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index e247c3a..7079bfc 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -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

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amdgpu: fix the hibernation suspend with s0ix
  2021-03-09  3:51 [PATCH] drm/amdgpu: fix the hibernation suspend with s0ix Prike Liang
@ 2021-03-09  4:07 ` Alex Deucher
  2021-03-09  4:45   ` Liang, Prike
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Deucher @ 2021-03-09  4:07 UTC (permalink / raw)
  To: Prike Liang; +Cc: Deucher, Alexander, Huang Rui, amd-gfx list

On Mon, Mar 8, 2021 at 10:52 PM Prike Liang <Prike.Liang@amd.com> wrote:
>
> During system hibernation suspend still need un-gate gfx CG/PG firstly to handle HW
> status check before HW resource destory.
>
> Signed-off-by: Prike Liang <Prike.Liang@amd.com>

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.

Acked-by: Alex Deucher <alexander.deucher@amd.com>

Alex


> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index e247c3a..7079bfc 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -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
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] drm/amdgpu: fix the hibernation suspend with s0ix
  2021-03-09  4:07 ` Alex Deucher
@ 2021-03-09  4:45   ` Liang, Prike
  2021-03-09  6:16     ` Huang Rui
  0 siblings, 1 reply; 4+ messages in thread
From: Liang, Prike @ 2021-03-09  4:45 UTC (permalink / raw)
  To: Alex Deucher; +Cc: Deucher, Alexander, Huang, Ray, amd-gfx list



> -----Original Message-----
> From: Alex Deucher <alexdeucher@gmail.com>
> Sent: Tuesday, March 9, 2021 12:07 PM
> To: Liang, Prike <Prike.Liang@amd.com>
> Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>; Deucher, Alexander
> <Alexander.Deucher@amd.com>; Huang, Ray <Ray.Huang@amd.com>
> Subject: Re: [PATCH] drm/amdgpu: fix the hibernation suspend with s0ix
> 
> On Mon, Mar 8, 2021 at 10:52 PM Prike Liang <Prike.Liang@amd.com> wrote:
> >
> > During system hibernation suspend still need un-gate gfx CG/PG firstly
> > to handle HW status check before HW resource destory.
> >
> > Signed-off-by: Prike Liang <Prike.Liang@amd.com>
> 
> 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.  

> Acked-by: Alex Deucher <alexander.deucher@amd.com>
> 
> Alex
> 
> 
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > index e247c3a..7079bfc 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > @@ -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
> >
> > _______________________________________________
> > amd-gfx mailing list
> > amd-gfx@lists.freedesktop.org
> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
> > s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-
> gfx&amp;data=04%7C01%7CPr
> >
> ike.Liang%40amd.com%7C641ed997755644a7c30a08d8e2b0d7bf%7C3dd896
> 1fe4884
> >
> e608e11a82d994e183d%7C0%7C0%7C637508596461291719%7CUnknown%7
> CTWFpbGZsb
> >
> 3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0
> %3D%
> >
> 7C1000&amp;sdata=J%2Figj9QUO6Vk74BeE3udM5yVgloUanpXtJUue3pJoFI%
> 3D&amp;
> > reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amdgpu: fix the hibernation suspend with s0ix
  2021-03-09  4:45   ` Liang, Prike
@ 2021-03-09  6:16     ` Huang Rui
  0 siblings, 0 replies; 4+ messages in thread
From: Huang Rui @ 2021-03-09  6:16 UTC (permalink / raw)
  To: Liang, Prike; +Cc: Alex Deucher, Deucher, Alexander, amd-gfx list

On Tue, Mar 09, 2021 at 12:45:44PM +0800, Liang, Prike wrote:
> 
> 
> > -----Original Message-----
> > From: Alex Deucher <alexdeucher@gmail.com>
> > Sent: Tuesday, March 9, 2021 12:07 PM
> > To: Liang, Prike <Prike.Liang@amd.com>
> > Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>; Deucher, Alexander
> > <Alexander.Deucher@amd.com>; Huang, Ray <Ray.Huang@amd.com>
> > Subject: Re: [PATCH] drm/amdgpu: fix the hibernation suspend with s0ix
> > 
> > On Mon, Mar 8, 2021 at 10:52 PM Prike Liang <Prike.Liang@amd.com> wrote:
> > >
> > > During system hibernation suspend still need un-gate gfx CG/PG firstly
> > > to handle HW status check before HW resource destory.
> > >
> > > Signed-off-by: Prike Liang <Prike.Liang@amd.com>
> > 
> > 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.

Acked-by: Huang Rui <ray.huang@amd.com>

> > Acked-by: Alex Deucher <alexander.deucher@amd.com>
> > 
> > Alex
> > 
> > 
> > > ---
> > >  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > > index e247c3a..7079bfc 100644
> > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> > > @@ -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
> > >
> > > _______________________________________________
> > > amd-gfx mailing list
> > > amd-gfx@lists.freedesktop.org
> > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
> > > s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-
> > gfx&amp;data=04%7C01%7CPr
> > >
> > ike.Liang%40amd.com%7C641ed997755644a7c30a08d8e2b0d7bf%7C3dd896
> > 1fe4884
> > >
> > e608e11a82d994e183d%7C0%7C0%7C637508596461291719%7CUnknown%7
> > CTWFpbGZsb
> > >
> > 3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0
> > %3D%
> > >
> > 7C1000&amp;sdata=J%2Figj9QUO6Vk74BeE3udM5yVgloUanpXtJUue3pJoFI%
> > 3D&amp;
> > > reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-09  6:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-09  3:51 [PATCH] drm/amdgpu: fix the hibernation suspend with s0ix Prike Liang
2021-03-09  4:07 ` Alex Deucher
2021-03-09  4:45   ` Liang, Prike
2021-03-09  6:16     ` Huang Rui

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.