From: Thomas Gleixner <tglx@linutronix.de>
To: tirthendu.sarkar@intel.com, Ingo Molnar <mingo@redhat.com>,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org
Cc: "H . Peter Anvin" <hpa@zytor.com>,
Jonathan Corbet <corbet@lwn.net>,
Andy Shevchenko <andriy.shevchenko@intel.com>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/time: Enable HPET under ACPI hardware-reduced mode with hpet=force
Date: Thu, 12 Nov 2026 17:14:43 +0100 [thread overview]
Message-ID: <8733t6t4b0.ffs@fw13> (raw)
In-Reply-To: <20261005075550.463089-1-tirthendu.sarkar@intel.com>
On Mon, Oct 05 2026 at 03:55, tirthendu.sarkar@intel.com 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
prev parent reply other threads:[~2026-11-12 16:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-05 7:55 [PATCH] x86/time: Enable HPET under ACPI hardware-reduced mode with hpet=force tirthendu.sarkar
2026-11-09 10:40 ` Tirthendu Sarkar
2026-11-12 16:14 ` Thomas Gleixner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8733t6t4b0.ffs@fw13 \
--to=tglx@linutronix.de \
--cc=andriy.shevchenko@intel.com \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tirthendu.sarkar@intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox