diff mbox series

platform/x86:intel/pmc: Leave ACPI PM Timer alone when using S3 suspend

Message ID 20240919165349.235777-1-hdegoede@redhat.com (mailing list archive)
State Handled Elsewhere, archived
Headers show
Series platform/x86:intel/pmc: Leave ACPI PM Timer alone when using S3 suspend | expand

Commit Message

Hans de Goede Sept. 19, 2024, 4:53 p.m. UTC
Disabling the ACPI PM timer causes suspend to no longer work on
a Intel Kaby Lake Dell XPS 13 using deep / S3 suspend.

The power-savings from disabling the pm-timer are mostly relevant for
s0ix suspend. If regular S3 suspend is used the firmware is in control of
the suspend and if necessary it should disable the timer if necessary.

Limit the disabling of the ACPI PM Timer on suspend to when using
S0ix (so not firmware, but OS handled) suspend to fix this.

Fixes: e86c8186d03a ("platform/x86:intel/pmc: Enable the ACPI PM Timer to be turned off when suspended")
Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
Closes: https://lore.kernel.org/linux-pm/18784f62-91ff-4d88-9621-6c88eb0af2b5@molgen.mpg.de/
Cc: Marek Maslanka <mmaslanka@google.com>
Tested-by: Paul Menzel <pmenzel@molgen.mpg.de> # Dell XPS 13 9360/0596KF, BIOS 2.21.0 06/02/2022
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/intel/pmc/core.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Andy Shevchenko Sept. 23, 2024, 8:46 a.m. UTC | #1
On Thu, Sep 19, 2024 at 06:53:49PM +0200, Hans de Goede wrote:
> Disabling the ACPI PM timer causes suspend to no longer work on
> a Intel Kaby Lake Dell XPS 13 using deep / S3 suspend.
> 
> The power-savings from disabling the pm-timer are mostly relevant for
> s0ix suspend. If regular S3 suspend is used the firmware is in control of
> the suspend and if necessary it should disable the timer if necessary.
> 
> Limit the disabling of the ACPI PM Timer on suspend to when using
> S0ix (so not firmware, but OS handled) suspend to fix this.

Acked-by: Andy Shevchenko <andy@kernel.org>
diff mbox series

Patch

diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c
index f443bf8bb82c..c753f013b59d 100644
--- a/drivers/platform/x86/intel/pmc/core.c
+++ b/drivers/platform/x86/intel/pmc/core.c
@@ -1275,6 +1275,10 @@  static void pmc_core_acpi_pm_timer_suspend_resume(void *data, bool suspend)
 	if (!map->acpi_pm_tmr_ctl_offset)
 		return;
 
+	/* Check if the suspend will actually use S0ix */
+	if (suspend && pm_suspend_via_firmware())
+		return;
+
 	guard(mutex)(&pmcdev->lock);
 
 	if (!suspend && !pmcdev->enable_acpi_pm_timer_on_resume)