Re: [PATCH] x86/time: Enable HPET under ACPI hardware-reduced mode with hpet=force
From: Thomas Gleixner
Date: Thu Nov 12 2026 - 11:20:58 EST
On Mon, Oct 05 2026 at 03:55, tirthendu.sarkar@xxxxxxxxx wrote:
> #include <asm/vsyscall.h>
> #include <asm/x86_init.h>
> @@ -72,6 +73,25 @@ static __init void x86_late_time_init(void)
> */
> x86_init.irqs.intr_mode_select();
>
> + /*
> + * ACPI hardware-reduced mode unconditionally stubs .timer_init() to
> + * a noop, on the assumption that no legacy timer exists. Some such
> + * platforms do provide a real HPET, so let "hpet=force" give it a
> + * chance to come up.
These platforms must advertise the TSC/CPU frequency and must have a
reliable TSC and a working APIC (deadline) timer.
So why on earth would they need HPET enabled. Just because some hardware
guy deciced that it's a brilliant idea to stick an HPET in such a SoC
does not make it useful. Nothing uses it, so why do you want to enable
it?
> +_ * Only hpet_enable() is wanted here, not
> + * hpet_time_init(): its PIT fallback and legacy timer interrupt have
> + * no hardware behind them on such platforms, and registering a PIT
> + * clockevent whose interrupt can never be delivered also fails the
> + * local APIC timer's calibration cross-check, disabling that too.
OMG. On a platform which advertises the TSC/CPU frequency the APIC is
not calibrated by anything. It uses the firmware/CPUID provided
frequencies. You try to support Frankenstein's hardware monster which
does not exist in the real world.
> + * This also covers hardware-reduced platforms that install their own
> + * .timer_init() rather than being stubbed (e.g. Intel MID, which
> + * sets up the local APIC timer only). None of them enable the HPET
> + * themselves, so it cannot end up registered twice.
> + */
> + if (IS_ENABLED(CONFIG_HPET_TIMER) && acpi_reduced_hardware() &&
> + hpet_force_user)
> + hpet_enable();
TBH, that's a horrible hack.
In the unexpected case that you can come up with a sensible and
convincing rationale why enabling HPET on these platform is useful, then
this has to be hidden in a reduced platform specific timer_init() and
not glued into a random place.
Thanks,
tglx