All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Deucher, Alexander" <Alexander.Deucher@amd.com>
To: "Limonciello, Mario" <Mario.Limonciello@amd.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Cc: "Liang, Prike" <Prike.Liang@amd.com>
Subject: Re: [PATCH v6 4/4] drm/amd: Only run s3 or s0ix if system is configured properly
Date: Thu, 27 Jan 2022 14:50:10 +0000	[thread overview]
Message-ID: <BL1PR12MB514433E3F8179EA8B8A69A4DF7219@BL1PR12MB5144.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20220126225831.16732-4-mario.limonciello@amd.com>

[-- Attachment #1: Type: text/plain, Size: 2354 bytes --]

[Public]

Series is:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Mario Limonciello <mario.limonciello@amd.com>
Sent: Wednesday, January 26, 2022 5:58 PM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Liang, Prike <Prike.Liang@amd.com>; Limonciello, Mario <Mario.Limonciello@amd.com>
Subject: [PATCH v6 4/4] drm/amd: Only run s3 or s0ix if system is configured properly

This will cause misconfigured systems to not run the GPU suspend
routines.

* In APUs that are properly configured system will go into s2idle.
* In APUs that are intended to be S3 but user selects
  s2idle the GPU will stay fully powered for the suspend.
* In APUs that are intended to be s2idle and system misconfigured
  the GPU will stay fully powered for the suspend.
* In systems that are intended to be s2idle, but AMD dGPU is also
  present, the dGPU will go through S3

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v5->v6:
 * Move code into prepare vfunc and use DPM_FLAG_SMART_SUSPEND to skip
   suspend code in incorrectly configured systems.
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 922accdd4246..3e581f35f19d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -2289,6 +2289,7 @@ static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work)
 static int amdgpu_pmops_prepare(struct device *dev)
 {
         struct drm_device *drm_dev = dev_get_drvdata(dev);
+       struct amdgpu_device *adev = drm_to_adev(drm_dev);

         /* Return a positive number here so
          * DPM_FLAG_SMART_SUSPEND works properly
@@ -2296,6 +2297,13 @@ static int amdgpu_pmops_prepare(struct device *dev)
         if (amdgpu_device_supports_boco(drm_dev))
                 return pm_runtime_suspended(dev);

+       /* if we will not support s3 or s2i for the device
+        *  then skip suspend
+        */
+       if (!amdgpu_acpi_is_s0ix_active(adev) &&
+           !amdgpu_acpi_is_s3_active(adev))
+               return 1;
+
         return 0;
 }

--
2.25.1


[-- Attachment #2: Type: text/html, Size: 4180 bytes --]

  reply	other threads:[~2022-01-27 14:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26 22:58 [PATCH v6 1/4] drm/amd: avoid suspend on dGPUs w/ s2idle support when runtime PM enabled Mario Limonciello
2022-01-26 22:58 ` [PATCH v6 2/4] drm/amd: Warn users about potential s0ix problems Mario Limonciello
2022-01-26 22:58 ` [PATCH v6 3/4] drm/amd: add support to check whether the system is set to s3 Mario Limonciello
2022-01-26 22:58 ` [PATCH v6 4/4] drm/amd: Only run s3 or s0ix if system is configured properly Mario Limonciello
2022-01-27 14:50   ` Deucher, Alexander [this message]
2022-01-27 19:31     ` Limonciello, Mario

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BL1PR12MB514433E3F8179EA8B8A69A4DF7219@BL1PR12MB5144.namprd12.prod.outlook.com \
    --to=alexander.deucher@amd.com \
    --cc=Mario.Limonciello@amd.com \
    --cc=Prike.Liang@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.