Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH v1] ACPI: PM: s2idle: Add missing checks to acpi_s2idle_begin_lps0()
@ 2026-01-07 15:14 Rafael J. Wysocki
  2026-01-08  3:28 ` Mario Limonciello (AMD) (kernel.org)
  0 siblings, 1 reply; 2+ messages in thread
From: Rafael J. Wysocki @ 2026-01-07 15:14 UTC (permalink / raw)
  To: Linux ACPI; +Cc: LKML, Linux PM, Mario Limonciello

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Commit 32ece31db4df ("ACPI: PM: s2idle: Only retrieve constraints
when needed"), that attempted to avoid useless evaluation of LPS0 _DSM
Function 1 in lps0_device_attach(), forgot to add checks for
lps0_device_handle and sleep_no_lps0 to acpi_s2idle_begin_lps0()
where they should be done before calling lpi_device_get_constraints()
or lpi_device_get_constraints_amd().

Add the missing checks.

Fixes: 32ece31db4df ("ACPI: PM: s2idle: Only retrieve constraints when needed")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/x86/s2idle.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/acpi/x86/s2idle.c
+++ b/drivers/acpi/x86/s2idle.c
@@ -515,7 +515,8 @@ static struct acpi_scan_handler lps0_han
 
 static int acpi_s2idle_begin_lps0(void)
 {
-	if (pm_debug_messages_on && !lpi_constraints_table) {
+	if (lps0_device_handle && !sleep_no_lps0 && pm_debug_messages_on &&
+	    !lpi_constraints_table) {
 		if (acpi_s2idle_vendor_amd())
 			lpi_device_get_constraints_amd();
 		else




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

* Re: [PATCH v1] ACPI: PM: s2idle: Add missing checks to acpi_s2idle_begin_lps0()
  2026-01-07 15:14 [PATCH v1] ACPI: PM: s2idle: Add missing checks to acpi_s2idle_begin_lps0() Rafael J. Wysocki
@ 2026-01-08  3:28 ` Mario Limonciello (AMD) (kernel.org)
  0 siblings, 0 replies; 2+ messages in thread
From: Mario Limonciello (AMD) (kernel.org) @ 2026-01-08  3:28 UTC (permalink / raw)
  To: Rafael J. Wysocki, Linux ACPI; +Cc: LKML, Linux PM



On 1/7/2026 9:14 AM, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Commit 32ece31db4df ("ACPI: PM: s2idle: Only retrieve constraints
> when needed"), that attempted to avoid useless evaluation of LPS0 _DSM
> Function 1 in lps0_device_attach(), forgot to add checks for
> lps0_device_handle and sleep_no_lps0 to acpi_s2idle_begin_lps0()
> where they should be done before calling lpi_device_get_constraints()
> or lpi_device_get_constraints_amd().
> 
> Add the missing checks.
> 
> Fixes: 32ece31db4df ("ACPI: PM: s2idle: Only retrieve constraints when needed")
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> ---
>   drivers/acpi/x86/s2idle.c |    3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> --- a/drivers/acpi/x86/s2idle.c
> +++ b/drivers/acpi/x86/s2idle.c
> @@ -515,7 +515,8 @@ static struct acpi_scan_handler lps0_han
>   
>   static int acpi_s2idle_begin_lps0(void)
>   {
> -	if (pm_debug_messages_on && !lpi_constraints_table) {
> +	if (lps0_device_handle && !sleep_no_lps0 && pm_debug_messages_on &&
> +	    !lpi_constraints_table) {
>   		if (acpi_s2idle_vendor_amd())
>   			lpi_device_get_constraints_amd();
>   		else
> 
> 
> 


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

end of thread, other threads:[~2026-01-08  3:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-07 15:14 [PATCH v1] ACPI: PM: s2idle: Add missing checks to acpi_s2idle_begin_lps0() Rafael J. Wysocki
2026-01-08  3:28 ` Mario Limonciello (AMD) (kernel.org)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox