All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Check pmops for desired suspend state
@ 2021-07-22  5:27 Pratik Vishwakarma
  2021-07-22 14:42 ` Raul E Rangel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Pratik Vishwakarma @ 2021-07-22  5:27 UTC (permalink / raw)
  To: Alexander.Deucher, amd-gfx

[Why]
User might set mem_sleep as deep and it will result
in amdgpu resume errors.

[How]
Check with pm for default suspend state

Signed-off-by: Pratik Vishwakarma <Pratik.Vishwakarma@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index af1710971ff3..d92196429741 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -1468,7 +1468,8 @@ static int amdgpu_pmops_suspend(struct device *dev)
 	struct amdgpu_device *adev = drm_to_adev(drm_dev);
 	int r;
 
-	if (amdgpu_acpi_is_s0ix_supported(adev))
+	if (amdgpu_acpi_is_s0ix_supported(adev)
+		&& pm_suspend_default_s2idle())
 		adev->in_s0ix = true;
 	adev->in_s3 = true;
 	r = amdgpu_device_suspend(drm_dev, true);
-- 
2.25.1

_______________________________________________
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: drm/amdgpu: Check pmops for desired suspend state
  2021-07-22  5:27 [PATCH] drm/amdgpu: Check pmops for desired suspend state Pratik Vishwakarma
@ 2021-07-22 14:42 ` Raul E Rangel
  2021-07-22 17:12 ` [PATCH] " Deucher, Alexander
  2021-07-23  4:10 ` Lazar, Lijo
  2 siblings, 0 replies; 4+ messages in thread
From: Raul E Rangel @ 2021-07-22 14:42 UTC (permalink / raw)
  To: Pratik Vishwakarma; +Cc: Alexander.Deucher, amd-gfx

On Thu, Jul 22, 2021 at 10:57:14AM +0530, Pratik Vishwakarma wrote:
> [Why]
> User might set mem_sleep as deep and it will result
> in amdgpu resume errors.
> 
> [How]
> Check with pm for default suspend state
> 
> Signed-off-by: Pratik Vishwakarma <Pratik.Vishwakarma@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index af1710971ff3..d92196429741 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -1468,7 +1468,8 @@ static int amdgpu_pmops_suspend(struct device *dev)
>  	struct amdgpu_device *adev = drm_to_adev(drm_dev);
>  	int r;
>  
> -	if (amdgpu_acpi_is_s0ix_supported(adev))
> +	if (amdgpu_acpi_is_s0ix_supported(adev)
> +		&& pm_suspend_default_s2idle())

Why pm_suspend_default_s2idle instead of pm_suspend_via_firmware?
>  		adev->in_s0ix = true;
>  	adev->in_s3 = true;
>  	r = amdgpu_device_suspend(drm_dev, true);
_______________________________________________
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: Check pmops for desired suspend state
  2021-07-22  5:27 [PATCH] drm/amdgpu: Check pmops for desired suspend state Pratik Vishwakarma
  2021-07-22 14:42 ` Raul E Rangel
@ 2021-07-22 17:12 ` Deucher, Alexander
  2021-07-23  4:10 ` Lazar, Lijo
  2 siblings, 0 replies; 4+ messages in thread
From: Deucher, Alexander @ 2021-07-22 17:12 UTC (permalink / raw)
  To: Vishwakarma, Pratik, amd-gfx


[-- Attachment #1.1: Type: text/plain, Size: 1570 bytes --]

[AMD Official Use Only]

I sent a similar patch out a while ago, but never had a chance to follow up on it.  The problem is users might change the default.
https://www.spinics.net/lists/amd-gfx/msg60578.html


Alex

________________________________
From: Vishwakarma, Pratik <Pratik.Vishwakarma@amd.com>
Sent: Thursday, July 22, 2021 1:27 AM
To: Deucher, Alexander <Alexander.Deucher@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Vishwakarma, Pratik <Pratik.Vishwakarma@amd.com>
Subject: [PATCH] drm/amdgpu: Check pmops for desired suspend state

[Why]
User might set mem_sleep as deep and it will result
in amdgpu resume errors.

[How]
Check with pm for default suspend state

Signed-off-by: Pratik Vishwakarma <Pratik.Vishwakarma@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index af1710971ff3..d92196429741 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -1468,7 +1468,8 @@ static int amdgpu_pmops_suspend(struct device *dev)
         struct amdgpu_device *adev = drm_to_adev(drm_dev);
         int r;

-       if (amdgpu_acpi_is_s0ix_supported(adev))
+       if (amdgpu_acpi_is_s0ix_supported(adev)
+               && pm_suspend_default_s2idle())
                 adev->in_s0ix = true;
         adev->in_s3 = true;
         r = amdgpu_device_suspend(drm_dev, true);
--
2.25.1


[-- Attachment #1.2: Type: text/html, Size: 3562 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
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: Check pmops for desired suspend state
  2021-07-22  5:27 [PATCH] drm/amdgpu: Check pmops for desired suspend state Pratik Vishwakarma
  2021-07-22 14:42 ` Raul E Rangel
  2021-07-22 17:12 ` [PATCH] " Deucher, Alexander
@ 2021-07-23  4:10 ` Lazar, Lijo
  2 siblings, 0 replies; 4+ messages in thread
From: Lazar, Lijo @ 2021-07-23  4:10 UTC (permalink / raw)
  To: Pratik Vishwakarma, Alexander.Deucher, amd-gfx



On 7/22/2021 10:57 AM, Pratik Vishwakarma wrote:
> [Why]
> User might set mem_sleep as deep and it will result
> in amdgpu resume errors.
> 
> [How]
> Check with pm for default suspend state
> 
> Signed-off-by: Pratik Vishwakarma <Pratik.Vishwakarma@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index af1710971ff3..d92196429741 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -1468,7 +1468,8 @@ static int amdgpu_pmops_suspend(struct device *dev)
>   	struct amdgpu_device *adev = drm_to_adev(drm_dev);
>   	int r;
>   
> -	if (amdgpu_acpi_is_s0ix_supported(adev))
> +	if (amdgpu_acpi_is_s0ix_supported(adev)
> +		&& pm_suspend_default_s2idle())

A better way would be to use the exported pm_suspend_target_state - 
(pm_suspend_target_state == PM_SUSPEND_TO_IDLE)

Thanks,
Lijo

>   		adev->in_s0ix = true;
>   	adev->in_s3 = true;
>   	r = amdgpu_device_suspend(drm_dev, true);
> 
_______________________________________________
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-07-23  4:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-22  5:27 [PATCH] drm/amdgpu: Check pmops for desired suspend state Pratik Vishwakarma
2021-07-22 14:42 ` Raul E Rangel
2021-07-22 17:12 ` [PATCH] " Deucher, Alexander
2021-07-23  4:10 ` Lazar, Lijo

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.