Skip to content

Commit f05e33b

Browse files
superm1roxanan1996
authored andcommitted
rtc: cmos: Use ACPI alarm for non-Intel x86 systems too
BugLink: https://bugs.launchpad.net/bugs/2059068 commit 3d762e2 upstream. Intel systems > 2015 have been configured to use ACPI alarm instead of HPET to avoid s2idle issues. Having HPET programmed for wakeup causes problems on AMD systems with s2idle as well. One particular case is that the systemd "SuspendThenHibernate" feature doesn't work properly on the Framework 13" AMD model. Switching to using ACPI alarm fixes the issue. Adjust the quirk to apply to AMD/Hygon systems from 2021 onwards. This matches what has been tested and is specifically to avoid potential risk to older systems. Cc: <stable@vger.kernel.org> # 6.1+ Reported-by: <alvin.zhuge@gmail.com> Reported-by: <renzhamin@gmail.com> Closes: systemd/systemd#24279 Reported-by: Kelvie Wong <kelvie@kelvie.ca> Closes: https://community.frame.work/t/systemd-suspend-then-hibernate-wakes-up-after-5-minutes/39392 Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20231106162310.85711-1-mario.limonciello@amd.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Portia Stephens <portia.stephens@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent e42890c commit f05e33b

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

drivers/rtc/rtc-cmos.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -818,18 +818,24 @@ static void rtc_wake_off(struct device *dev)
818818
}
819819

820820
#ifdef CONFIG_X86
821-
/* Enable use_acpi_alarm mode for Intel platforms no earlier than 2015 */
822821
static void use_acpi_alarm_quirks(void)
823822
{
824-
if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
823+
switch (boot_cpu_data.x86_vendor) {
824+
case X86_VENDOR_INTEL:
825+
if (dmi_get_bios_year() < 2015)
826+
return;
827+
break;
828+
case X86_VENDOR_AMD:
829+
case X86_VENDOR_HYGON:
830+
if (dmi_get_bios_year() < 2021)
831+
return;
832+
break;
833+
default:
825834
return;
826-
835+
}
827836
if (!is_hpet_enabled())
828837
return;
829838

830-
if (dmi_get_bios_year() < 2015)
831-
return;
832-
833839
use_acpi_alarm = true;
834840
}
835841
#else

0 commit comments

Comments
 (0)