From: Rafael J. Wysocki Date: Sat, 14 Mar 2026 12:11:20 +0000 (+0100) Subject: rtc: cmos: Enable ACPI alarm if advertised in ACPI FADT X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=db5dab0784a8e8477598b52f3de7bdfbed733b3f;p=thirdparty%2Fkernel%2Flinux.git rtc: cmos: Enable ACPI alarm if advertised in ACPI FADT If the ACPI_FADT_FIXED_RTC flag is unset, the platform is declaring that it supports the ACPI RTC fixed event which should be used instead of a dedicated CMOS RTC IRQ. However, the driver only enables it when is_hpet_enabled() returns true, which is questionable because there is no clear connection between enabled HPET and signaling wakeup via the ACPI RTC fixed event (for instance, the latter can be expected to work on systems that don't include a functional HPET). Moreover, since use_hpet_alarm() returns false if use_acpi_alarm is set, the ACPI RTC fixed event is effectively used instead of the HPET alarm if the latter is functional, but there is no particular reason why it could not be used otherwise. Accordingly, on x86 systems with ACPI, set use_acpi_alarm if ACPI_FADT_FIXED_RTC is unset without looking at whether or not HPET is enabled. Also, do the ACPI FADT check in use_acpi_alarm_quirks() before the DMI BIOS year checks which are more expensive and it's better to skip them if ACPI_FADT_FIXED_RTC is set. Signed-off-by: Rafael J. Wysocki Acked-by: Alexandre Belloni Reviewed-by: Mario Limonciello (AMD) Link: https://patch.msgid.link/9618535.CDJkKcVGEf@rafael.j.wysocki --- diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c index 9ac5bab846c12..221e7525cd3fb 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c @@ -817,6 +817,9 @@ static void rtc_wake_off(struct device *dev) #ifdef CONFIG_X86 static void use_acpi_alarm_quirks(void) { + if (acpi_gbl_FADT.flags & ACPI_FADT_FIXED_RTC) + return; + switch (boot_cpu_data.x86_vendor) { case X86_VENDOR_INTEL: if (dmi_get_bios_year() < 2015) @@ -830,8 +833,6 @@ static void use_acpi_alarm_quirks(void) default: return; } - if (!is_hpet_enabled()) - return; use_acpi_alarm = true; }