Skip to contentSkip to conversation

ACPI: PM: s2idle: Evaluate all Low-Power S0 Idle _DSM functions

PATCH In review Rafael J. Wysocki 4 participants 4 messages Apr 23, 2024 – Apr 24, 2024 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI: PM: s2idle: Evaluate all Low-Power S0 Idle _DSM functions

From: Rafael J. Wysocki <[email protected]>

Commit 073237281a50 ("ACPI: PM: s2idle: Enable Low-Power S0 Idle MSFT UUID for non-AMD systems") attempted to avoid evaluating the same Low- Power S0 Idle _DSM functions for different UUIDs, but that turns out to be a mistake, because some systems in the field are adversely affected by it.

Address this by allowing all Low-Power S0 Idle _DSM functions to be evaluated, but still print the message regarding duplication of Low- Power S0 Idle _DSM function sets for different UUIDs.

Fixes 073237281a50 ("ACPI: PM: s2idle: Enable Low-Power S0 Idle MSFT UUID for non-AMD systems")
Reported-and-tested-by Mark Pearson <[email protected]>
---
 drivers/acpi/x86/s2idle.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/acpi/x86/s2idle.c +3 -5
Index: linux-pm/drivers/acpi/x86/s2idle.c
===================================================================
@@ -492,16 +492,14 @@ static int lps0_device_attach(struct acp
 			unsigned int func_mask;
 
 			/*
-			 * Avoid evaluating the same _DSM function for two
-			 * different UUIDs and prioritize the MSFT one.
+			 * Log a message if the _DSM function sets for two
+			 * different UUIDs overlap.
 			 */
 			func_mask = lps0_dsm_func_mask & lps0_dsm_func_mask_microsoft;
-			if (func_mask) {
+			if (func_mask)
 				acpi_handle_info(adev->handle,
 						 "Duplicate LPS0 _DSM functions (mask: 0x%x)\n",
 						 func_mask);
-				lps0_dsm_func_mask &= ~func_mask;
-			}
 		}
 	}
 
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

Commit 073237281a50 ("ACPI: PM: s2idle: Enable Low-Power S0 Idle MSFT UUID for non-AMD systems") attempted to avoid evaluating the same Low- Power S0 Idle _DSM functions for different UUIDs, but that turns out to be a mistake, because some systems in the field are adversely affected by it.

Quoted 8 lines

Address this by allowing all Low-Power S0 Idle _DSM functions to be evaluated, but still print the message regarding duplication of Low- Power S0 Idle _DSM function sets for different UUIDs.

Fixes 073237281a50 ("ACPI: PM: s2idle: Enable Low-Power S0 Idle MSFT UUID for non-AMD systems")
Reported-and-tested-by Mark Pearson <[email protected]>

Ah glad to hear that my idea worked. FWIW we saw the same type of issue on some AMD systems when we first introduced the MSFT UUID.

Quoted 31 lines
---
  drivers/acpi/x86/s2idle.c |    8 +++-----
  1 file changed, 3 insertions(+), 5 deletions(-)

Index: linux-pm/drivers/acpi/x86/s2idle.c
===================================================================

drivers/acpi/x86/s2idle.c +3 -5
@@ -492,16 +492,14 @@ static int lps0_device_attach(struct acp
  			unsigned int func_mask;
 
  			/*
-			 * Avoid evaluating the same _DSM function for two
-			 * different UUIDs and prioritize the MSFT one.
+			 * Log a message if the _DSM function sets for two
+			 * different UUIDs overlap.
  			 */
  			func_mask = lps0_dsm_func_mask & lps0_dsm_func_mask_microsoft;
-			if (func_mask) {
+			if (func_mask)
  				acpi_handle_info(adev->handle,
  						 "Duplicate LPS0 _DSM functions (mask: 0x%x)\n",
  						 func_mask);
-				lps0_dsm_func_mask &= ~func_mask;
-			}
  		}
  	}
 
#2 lore raw
Quoted 14 lines · Mario Limonciello
Quoted 12 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

Commit 073237281a50 ("ACPI: PM: s2idle: Enable Low-Power S0 Idle MSFT UUID for non-AMD systems") attempted to avoid evaluating the same Low- Power S0 Idle _DSM functions for different UUIDs, but that turns out to be a mistake, because some systems in the field are adversely affected by it.

Address this by allowing all Low-Power S0 Idle _DSM functions to be evaluated, but still print the message regarding duplication of Low- Power S0 Idle _DSM function sets for different UUIDs.

Quoted 6 lines
Quoted 4 lines
Fixes 073237281a50 ("ACPI: PM: s2idle: Enable Low-Power S0 Idle MSFT UUID for non-AMD systems")
Reported-and-tested-by Mark Pearson <[email protected]>

Ah glad to hear that my idea worked.

We've arrived at the same solution independently, I've only looked at the BZ when the patch was ready to send.

Quoted 4 lines

FWIW we saw the same type of issue
on some AMD systems when we first introduced the MSFT UUID.

But sure.

Quoted 1 line

Thanks!

Quoted 32 lines
Quoted 31 lines
---
  drivers/acpi/x86/s2idle.c |    8 +++-----
  1 file changed, 3 insertions(+), 5 deletions(-)

Index: linux-pm/drivers/acpi/x86/s2idle.c
===================================================================

drivers/acpi/x86/s2idle.c +3 -5
@@ -492,16 +492,14 @@ static int lps0_device_attach(struct acp
                      unsigned int func_mask;
 
                      /*
-                      * Avoid evaluating the same _DSM function for two
-                      * different UUIDs and prioritize the MSFT one.
+                      * Log a message if the _DSM function sets for two
+                      * different UUIDs overlap.
                       */
                      func_mask = lps0_dsm_func_mask & lps0_dsm_func_mask_microsoft;
-                     if (func_mask) {
+                     if (func_mask)
                              acpi_handle_info(adev->handle,
                                               "Duplicate LPS0 _DSM functions (mask: 0x%x)\n",
                                               func_mask);
-                             lps0_dsm_func_mask &= ~func_mask;
-                     }
              }
      }
 
#3 lore raw
In reply to Rafael J. Wysocki
Quoted 8 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

Commit 073237281a50 ("ACPI: PM: s2idle: Enable Low-Power S0 Idle MSFT UUID for non-AMD systems") attempted to avoid evaluating the same Low- Power S0 Idle _DSM functions for different UUIDs, but that turns out to be a mistake, because some systems in the field are adversely affected by it.

Quoted 8 lines

Address this by allowing all Low-Power S0 Idle _DSM functions to be evaluated, but still print the message regarding duplication of Low- Power S0 Idle _DSM function sets for different UUIDs.

Fixes 073237281a50 ("ACPI: PM: s2idle: Enable Low-Power S0 Idle MSFT UUID for non-AMD systems")
Reported-and-tested-by Mark Pearson <[email protected]>

FYI, I can confirm that this fixes the regression on my Thinkpad P1 Gen 6.