[PATCH v3 3/5] ACPI / x86: Check LPI constraints by default

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently LPI constraints are only checked when `pm_debug_messages` has
been set. They are mostly used as a debugging tactic.

As the results of constraint checking will be passed to consumers of
the LPS0 callback, ensure that constraints are checked by default so this
value can be trusted.

Suggested-by: David E. Box <david.e.box@xxxxxxxxxxxxxxx>
Signed-off-by: Mario Limonciello <mario.limonciello@xxxxxxx>
---
changes from v2->v3:
 * no changes
changes from v1->v2:
 * New patch
 drivers/acpi/x86/s2idle.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
index 646faa117c70..2a15e61406a3 100644
--- a/drivers/acpi/x86/s2idle.c
+++ b/drivers/acpi/x86/s2idle.c
@@ -307,16 +307,19 @@ static void lpi_check_constraints(bool *met)
 			acpi_power_state_string(adev->power.state));
 
 		if (!adev->flags.power_manageable) {
-			acpi_handle_info(handle, "LPI: Device not power manageable\n");
+			if (pm_debug_messages_on)
+				acpi_handle_info(handle, "LPI: Device not power manageable\n");
 			lpi_constraints_table[i].handle = NULL;
 			continue;
 		}
 
 		if (adev->power.state < lpi_constraints_table[i].min_dstate) {
-			acpi_handle_info(handle,
-				"LPI: Constraint not met; min power state:%s current power state:%s\n",
-				acpi_power_state_string(lpi_constraints_table[i].min_dstate),
-				acpi_power_state_string(adev->power.state));
+			if (pm_debug_messages_on) {
+				acpi_handle_info(handle,
+					"LPI: Constraint not met; min power state:%s current power state:%s\n",
+					acpi_power_state_string(lpi_constraints_table[i].min_dstate),
+					acpi_power_state_string(adev->power.state));
+			}
 			*met = false;
 		}
 	}
@@ -456,8 +459,7 @@ int acpi_s2idle_prepare_late(void)
 	if (!lps0_device_handle || sleep_no_lps0)
 		return 0;
 
-	if (pm_debug_messages_on)
-		lpi_check_constraints(&constraints_met);
+	lpi_check_constraints(&constraints_met);
 
 	/* Screen off */
 	if (lps0_dsm_func_mask > 0)
-- 
2.34.1




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux