* [PATCH] ACPI: PM: s2idle: Use LPS0 idle if ACPI_FADT_LOW_POWER_S0 is unset
@ 2022-07-13 18:51 Rafael J. Wysocki
2022-07-13 19:03 ` Limonciello, Mario
0 siblings, 1 reply; 2+ messages in thread
From: Rafael J. Wysocki @ 2022-07-13 18:51 UTC (permalink / raw)
To: Linux ACPI
Cc: LKML, Linux PM, Srinivas Pandruvada, Zhang Rui, Mario Limonciello
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
If the PNP0D80 device is present and its _DSM appears to be valid,
there is no reason to avoid using it even if ACPI_FADT_LOW_POWER_S0
is unset in the FADT, because suspend-to-idle may be the only way to
suspend the system if S3 is not supported by the platform, so do not
return early from lps0_device_attach() in that case.
However, still check ACPI_FADT_LOW_POWER_S0 when deciding whether or
not suspend-to-idle should be the default system suspend method.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/acpi/x86/s2idle.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
Index: linux-pm/drivers/acpi/x86/s2idle.c
===================================================================
--- linux-pm.orig/drivers/acpi/x86/s2idle.c
+++ linux-pm/drivers/acpi/x86/s2idle.c
@@ -369,9 +369,6 @@ static int lps0_device_attach(struct acp
if (lps0_device_handle)
return 0;
- if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0))
- return 0;
-
if (acpi_s2idle_vendor_amd()) {
/* AMD0004, AMD0005, AMDI0005:
* - Should use rev_id 0x0
@@ -421,10 +418,12 @@ static int lps0_device_attach(struct acp
lpi_device_get_constraints();
/*
- * Use suspend-to-idle by default if the default suspend mode was not
- * set from the command line.
+ * Use suspend-to-idle by default if ACPI_FADT_LOW_POWER_S0 is set in
+ * the FADT and the default suspend mode was not set from the command
+ * line.
*/
- if (mem_sleep_default > PM_SUSPEND_MEM && !acpi_sleep_default_s3)
+ if ((acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) &&
+ mem_sleep_default > PM_SUSPEND_MEM && !acpi_sleep_default_s3)
mem_sleep_current = PM_SUSPEND_TO_IDLE;
/*
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH] ACPI: PM: s2idle: Use LPS0 idle if ACPI_FADT_LOW_POWER_S0 is unset
2022-07-13 18:51 [PATCH] ACPI: PM: s2idle: Use LPS0 idle if ACPI_FADT_LOW_POWER_S0 is unset Rafael J. Wysocki
@ 2022-07-13 19:03 ` Limonciello, Mario
0 siblings, 0 replies; 2+ messages in thread
From: Limonciello, Mario @ 2022-07-13 19:03 UTC (permalink / raw)
To: Rafael J. Wysocki, Linux ACPI
Cc: LKML, Linux PM, Srinivas Pandruvada, Zhang Rui
[Public]
> -----Original Message-----
> From: Rafael J. Wysocki <rjw@rjwysocki.net>
> Sent: Wednesday, July 13, 2022 13:51
> To: Linux ACPI <linux-acpi@vger.kernel.org>
> Cc: LKML <linux-kernel@vger.kernel.org>; Linux PM <linux-
> pm@vger.kernel.org>; Srinivas Pandruvada
> <srinivas.pandruvada@linux.intel.com>; Zhang Rui <rui.zhang@intel.com>;
> Limonciello, Mario <Mario.Limonciello@amd.com>
> Subject: [PATCH] ACPI: PM: s2idle: Use LPS0 idle if
> ACPI_FADT_LOW_POWER_S0 is unset
>
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> If the PNP0D80 device is present and its _DSM appears to be valid,
> there is no reason to avoid using it even if ACPI_FADT_LOW_POWER_S0
> is unset in the FADT, because suspend-to-idle may be the only way to
> suspend the system if S3 is not supported by the platform, so do not
> return early from lps0_device_attach() in that case.
>
> However, still check ACPI_FADT_LOW_POWER_S0 when deciding whether or
> not suspend-to-idle should be the default system suspend method.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
> drivers/acpi/x86/s2idle.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> Index: linux-pm/drivers/acpi/x86/s2idle.c
> ==========================================================
> =========
> --- linux-pm.orig/drivers/acpi/x86/s2idle.c
> +++ linux-pm/drivers/acpi/x86/s2idle.c
> @@ -369,9 +369,6 @@ static int lps0_device_attach(struct acp
> if (lps0_device_handle)
> return 0;
>
> - if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0))
> - return 0;
> -
> if (acpi_s2idle_vendor_amd()) {
> /* AMD0004, AMD0005, AMDI0005:
> * - Should use rev_id 0x0
> @@ -421,10 +418,12 @@ static int lps0_device_attach(struct acp
> lpi_device_get_constraints();
>
> /*
> - * Use suspend-to-idle by default if the default suspend mode was
> not
> - * set from the command line.
> + * Use suspend-to-idle by default if ACPI_FADT_LOW_POWER_S0 is
> set in
> + * the FADT and the default suspend mode was not set from the
> command
> + * line.
> */
> - if (mem_sleep_default > PM_SUSPEND_MEM &&
> !acpi_sleep_default_s3)
> + if ((acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) &&
> + mem_sleep_default > PM_SUSPEND_MEM &&
> !acpi_sleep_default_s3)
> mem_sleep_current = PM_SUSPEND_TO_IDLE;
>
> /*
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-13 19:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-13 18:51 [PATCH] ACPI: PM: s2idle: Use LPS0 idle if ACPI_FADT_LOW_POWER_S0 is unset Rafael J. Wysocki
2022-07-13 19:03 ` Limonciello, Mario
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox