Skip to content

Commit 7edf6f7

Browse files
committed
ACPI: PM: s2idle: Add module parameter for LPS0 constraints checking
Commit 32ece31 ("ACPI: PM: s2idle: Only retrieve constraints when needed") attempted to avoid useless evaluation of LPS0 _DSM Function 1 in lps0_device_attach() because pm_debug_messages_on might never be set (and that is the case on production systems most of the time), but it turns out that LPS0 _DSM Function 1 is generally problematic on some platforms and causes suspend issues to occur when pm_debug_messages_on is set now. In Linux, LPS0 _DSM Function 1 is only useful for diagnostics and only in the cases when the system does not reach the deepest platform idle state during suspend-to-idle for some reason. If such diagnostics is not necessary, evaluating it is a loss of time, so using it along with the other pm_debug_messages_on diagnostics is questionable because the latter is expected to be suitable for collecting debug information even during production use of system suspend. For this reason, add a module parameter called check_lps0_constraints to control whether or not the list of LPS0 constraints will be checked in acpi_s2idle_prepare_late_lps0() and so whether or not to evaluate LPS0 _DSM Function 1 (once) in acpi_s2idle_begin_lps0(). Fixes: 32ece31 ("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> Link: https://patch.msgid.link/2827214.mvXUDI8C0e@rafael.j.wysocki
1 parent 8f334e3 commit 7edf6f7

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/acpi/x86/s2idle.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ static bool sleep_no_lps0 __read_mostly;
2828
module_param(sleep_no_lps0, bool, 0644);
2929
MODULE_PARM_DESC(sleep_no_lps0, "Do not use the special LPS0 device interface");
3030

31+
static bool check_lps0_constraints __read_mostly;
32+
module_param(check_lps0_constraints, bool, 0644);
33+
MODULE_PARM_DESC(check_lps0_constraints, "Check LPS0 device constraints");
34+
3135
static const struct acpi_device_id lps0_device_ids[] = {
3236
{"PNP0D80", },
3337
{"", },
@@ -515,7 +519,7 @@ static struct acpi_scan_handler lps0_handler = {
515519

516520
static int acpi_s2idle_begin_lps0(void)
517521
{
518-
if (lps0_device_handle && !sleep_no_lps0 && pm_debug_messages_on &&
522+
if (lps0_device_handle && !sleep_no_lps0 && check_lps0_constraints &&
519523
!lpi_constraints_table) {
520524
if (acpi_s2idle_vendor_amd())
521525
lpi_device_get_constraints_amd();
@@ -540,7 +544,7 @@ static int acpi_s2idle_prepare_late_lps0(void)
540544
if (!lps0_device_handle || sleep_no_lps0)
541545
return 0;
542546

543-
if (pm_debug_messages_on)
547+
if (check_lps0_constraints)
544548
lpi_check_constraints();
545549

546550
/* Screen off */

0 commit comments

Comments
 (0)