All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: "Lazar, Lijo" <Lijo.Lazar@amd.com>
Cc: "Liang, Prike" <Prike.Liang@amd.com>,
	"Limonciello, Mario" <Mario.Limonciello@amd.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH v5 2/4] drm/amd: add support to check whether the system is set to s3
Date: Wed, 26 Jan 2022 10:40:48 -0500	[thread overview]
Message-ID: <CADnq5_POyZpODYcpD6WyyUYE6y+RCzX0L=N9hU4Y7b7qTHVKxg@mail.gmail.com> (raw)
In-Reply-To: <BYAPR12MB4614586B64F8A716DE4D987597209@BYAPR12MB4614.namprd12.prod.outlook.com>

I don't think smart suspend works as expected.  I asked Raphael about
it several times, but he never got around to following up with me.  I
think that is probably the preferred way to go, but the tricky part is
that the dGPUs have integrated bridges and audio and usb and all of
that probably needs proper smart suspend support for this to work
properly.  Alternatively, the OS needs to properly use the ACPI _PR3
methods to power down all of the devices on suspend if the system
doesn't automatically take down the power rails when the system enters
suspend.  I'm not sure Linux does this today.

Alex

On Wed, Jan 26, 2022 at 10:32 AM Lazar, Lijo <Lijo.Lazar@amd.com> wrote:
>
> I remember Alex adding a patch for smart suspend such that it skips the suspend call if runtime pm suspended.
>
> In summary, the resume doesn't work with/without reset?
>
> Thanks,
> Lijo
> ________________________________
> From: Limonciello, Mario <Mario.Limonciello@amd.com>
> Sent: Wednesday, January 26, 2022 8:47:05 PM
> To: Lazar, Lijo <Lijo.Lazar@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
> Cc: Liang, Prike <Prike.Liang@amd.com>
> Subject: RE: [PATCH v5 2/4] drm/amd: add support to check whether the system is set to s3
>
>
> [Public]
>
>
>
> Right -from an API perspective both amdgpu_acpi_is_s0ix_active and amdgpu_acpi_is_s3_active are only in suspend ops.
>
>
>
> But so coming back to the 4th patch (and the associated bug), what is supposed to happen with a dGPU on an Intel system that does s2i?
>
> For AMD APU w/ dGPU in the system doing s2i I would expect that power rails have been cut off for the dGPU so putting it into S3 and doing a reset makes sense, but I don’t know about on an Intel system if that is logical.
>
> It seems like Intel expects more that the card is going to be in runtime pm and putting it into S3 and doing reset might not be the right move.
>
>
>
> From: Lazar, Lijo <Lijo.Lazar@amd.com>
> Sent: Wednesday, January 26, 2022 09:11
> To: Limonciello, Mario <Mario.Limonciello@amd.com>; amd-gfx@lists.freedesktop.org
> Cc: Liang, Prike <Prike.Liang@amd.com>
> Subject: Re: [PATCH v5 2/4] drm/amd: add support to check whether the system is set to s3
>
>
>
> Talking from generic API perspective - S3 is considered active for dGPU only if it's going to non-S0 state. If called from anywhere else than suspend op, this should return false.
>
>
>
> Thanks,
> Lijo
>
> ________________________________
>
> From: Limonciello, Mario <Mario.Limonciello@amd.com>
> Sent: Wednesday, January 26, 2022 8:37:28 PM
> To: Lazar, Lijo <Lijo.Lazar@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
> Cc: Liang, Prike <Prike.Liang@amd.com>
> Subject: RE: [PATCH v5 2/4] drm/amd: add support to check whether the system is set to s3
>
>
>
> [Public]
>
>
>
> That was intentional – shouldn’t dGPU always be going through S3 path currently?
>
>
>
> From: Lazar, Lijo <Lijo.Lazar@amd.com>
> Sent: Wednesday, January 26, 2022 09:06
> To: Limonciello, Mario <Mario.Limonciello@amd.com>; amd-gfx@lists.freedesktop.org
> Cc: Liang, Prike <Prike.Liang@amd.com>; Limonciello, Mario <Mario.Limonciello@amd.com>
> Subject: Re: [PATCH v5 2/4] drm/amd: add support to check whether the system is set to s3
>
>
>
> [Public]
>
>
>
> Returns true for dGPU always. Better to keep the whole check under something like this.
>
>
>
> if (pm_suspend_target_state != PM_SUSPEND_ON)
>
>
>
> Thanks,
> Lijo
>
> ________________________________
>
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Mario Limonciello <mario.limonciello@amd.com>
> Sent: Wednesday, January 26, 2022 9:39:42 AM
> 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 v5 2/4] drm/amd: add support to check whether the system is set to s3
>
>
>
> This will be used to help make decisions on what to do in
> misconfigured systems.
>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu.h      |  2 ++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 17 +++++++++++++++++
>  2 files changed, 19 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 3bc76759c143..f184c88d3d4f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -1409,11 +1409,13 @@ int amdgpu_acpi_smart_shift_update(struct drm_device *dev, enum amdgpu_ss ss_sta
>  int amdgpu_acpi_pcie_notify_device_ready(struct amdgpu_device *adev);
>
>  void amdgpu_acpi_get_backlight_caps(struct amdgpu_dm_backlight_caps *caps);
> +bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev);
>  bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev);
>  void amdgpu_acpi_detect(void);
>  #else
>  static inline int amdgpu_acpi_init(struct amdgpu_device *adev) { return 0; }
>  static inline void amdgpu_acpi_fini(struct amdgpu_device *adev) { }
> +static inline bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev) { return false };
>  static inline bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { return false; }
>  static inline void amdgpu_acpi_detect(void) { }
>  static inline bool amdgpu_acpi_is_power_shift_control_supported(void) { return false; }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> index 2531da6cbec3..df673062bc03 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> @@ -1031,6 +1031,23 @@ void amdgpu_acpi_detect(void)
>          }
>  }
>
> +/**
> + * amdgpu_acpi_is_s3_active
> + *
> + * @adev: amdgpu_device_pointer
> + *
> + * returns true if supported, false if not.
> + */
> +bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev)
> +{
> +#if IS_ENABLED(CONFIG_SUSPEND)
> +       return !(adev->flags & AMD_IS_APU) ||
> +               pm_suspend_target_state == PM_SUSPEND_MEM;
> +#else
> +       return false;
> +#endif
> +}
> +
>  /**
>   * amdgpu_acpi_is_s0ix_active
>   *
> --
> 2.25.1

  reply	other threads:[~2022-01-26 15:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-26  4:09 [PATCH v5 1/4] drm/amd: Warn users about potential s0ix problems Mario Limonciello
2022-01-26  4:09 ` [PATCH v5 2/4] drm/amd: add support to check whether the system is set to s3 Mario Limonciello
2022-01-26 15:06   ` Lazar, Lijo
2022-01-26 15:07     ` Limonciello, Mario
2022-01-26 15:11       ` Lazar, Lijo
2022-01-26 15:17         ` Limonciello, Mario
2022-01-26 15:32           ` Lazar, Lijo
2022-01-26 15:40             ` Alex Deucher [this message]
2022-01-26 16:31               ` Limonciello, Mario
2022-01-26  4:09 ` [PATCH v5 3/4] drm/amd: Only run s3 or s0ix if system is configured properly Mario Limonciello
2022-01-26  4:09 ` [PATCH v5 4/4] drm/amd: don't reset dGPUs that don't go through system S3 Mario Limonciello
2022-01-26 14:57   ` 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='CADnq5_POyZpODYcpD6WyyUYE6y+RCzX0L=N9hU4Y7b7qTHVKxg@mail.gmail.com' \
    --to=alexdeucher@gmail.com \
    --cc=Lijo.Lazar@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.