diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-07-31 23:43:18 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-08-05 01:51:26 +0200 |
commit | e870c6c87cf9484090d28f2a68aa29e008960c93 (patch) | |
tree | 9d19e498e1ed8bcc864b66d5817f03d09cc6ddcd /drivers/acpi/sleep.c | |
parent | 635173a17b0323c28a39fb06fa36d876035cd2b9 (diff) | |
download | linux-e870c6c87cf9484090d28f2a68aa29e008960c93.tar.gz linux-e870c6c87cf9484090d28f2a68aa29e008960c93.tar.bz2 linux-e870c6c87cf9484090d28f2a68aa29e008960c93.zip |
ACPI / PM: Prefer suspend-to-idle over S3 on some systems
Modify the ACPI system sleep support setup code to select
suspend-to-idle as the default system sleep state if
(1) the ACPI_FADT_LOW_POWER_S0 flag is set in the FADT and
(2) the Low Power Idle S0 _DSM interface has been discovered and
(3) the default sleep state was not selected from the kernel command
line.
The main motivation for this change is that systems where the (1) and
(2) conditions are met typically ship with OSes that don't exercise
the S3 path in the platform firmware which remains untested and turns
out to be non-functional at least in some cases.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Mario Limonciello <mario.limonciello@dell.com>
Diffstat (limited to 'drivers/acpi/sleep.c')
-rw-r--r-- | drivers/acpi/sleep.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index be17664736b2..b363283dfcd9 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -714,6 +714,12 @@ static int lps0_device_attach(struct acpi_device *adev, if ((bitmask & ACPI_S2IDLE_FUNC_MASK) == ACPI_S2IDLE_FUNC_MASK) { lps0_dsm_func_mask = bitmask; lps0_device_handle = adev->handle; + /* + * Use suspend-to-idle by default if the default + * suspend mode was not set from the command line. + */ + if (mem_sleep_default > PM_SUSPEND_MEM) + mem_sleep_current = PM_SUSPEND_FREEZE; } acpi_handle_debug(adev->handle, "_DSM function mask: 0x%x\n", |