This is an automated email from the ASF dual-hosted git repository.

GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 0ab7b531a07 arch/x86_64: Offer SCHED_TICKLESS only with a tickless 
timer driver.
0ab7b531a07 is described below

commit 0ab7b531a0759e0da35f52e4130d3d7d61416f7c
Author: Marco Casaroli <[email protected]>
AuthorDate: Tue Nov 17 14:52:12 2026 +0100

    arch/x86_64: Offer SCHED_TICKLESS only with a tickless timer driver.
    
    With the APIC timer (ARCH_INTEL64_TSC) and SCHED_TICKLESS, the build
    fails: intel64_tsc_oneshot.c needs ONESHOT_COUNT and ALARM_ARCH, which
    only the TSC DEADLINE and HPET timers select.  To select them is not
    enough: the driver programs MSR_IA32_TSC_DEADLINE, and the CPU ignores
    this MSR when the APIC timer is not in TSC-deadline mode, so no timer
    interrupt comes.
    
    ARCH_INTEL64 selects ARCH_HAVE_TICKLESS for all timers.  The two timers
    with a tickless driver select ALARM_ARCH, which selects
    ARCH_HAVE_TICKLESS already.  Remove the select from ARCH_INTEL64, so
    that SCHED_TICKLESS is not available with the APIC timer.  Say it in the
    help text and in the documentation.
    
    A "depends on !SCHED_TICKLESS" on ARCH_INTEL64_TSC does not work: it
    makes a dependency loop through the timer choice and ALARM_ARCH.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 Documentation/platforms/x86_64/intel64/index.rst | 3 ++-
 arch/x86_64/Kconfig                              | 1 -
 arch/x86_64/src/intel64/Kconfig                  | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/platforms/x86_64/intel64/index.rst 
b/Documentation/platforms/x86_64/intel64/index.rst
index b2752d3bdcc..01097c7a569 100644
--- a/Documentation/platforms/x86_64/intel64/index.rst
+++ b/Documentation/platforms/x86_64/intel64/index.rst
@@ -42,7 +42,8 @@ IRQs are managed by LAPIC(X2APIC) and IOAPIC.
 Clock source
 ------------
 
-TSC DEADLINE timer, APIC timer or HPET can be used as system clock.
+TSC DEADLINE timer, APIC timer or HPET can be used as system clock. The APIC
+timer does not support ``CONFIG_SCHED_TICKLESS``.
 
 SMP
 ---
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index 4a49f147419..5ab8c4d42b3 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -34,7 +34,6 @@ config ARCH_INTEL64
        select ARCH_HAVE_ADDRENV
        select ARCH_NEED_ADDRENV_MAPPING
        select ARCH_HAVE_ELF_EXECUTABLE
-       select ARCH_HAVE_TICKLESS
        select ARCH_HAVE_STACKCHECK
        select ARCH_HAVE_RNG
        select ARCH_HAVE_RESET
diff --git a/arch/x86_64/src/intel64/Kconfig b/arch/x86_64/src/intel64/Kconfig
index 5de224aa1e7..e9fc38ae3d7 100644
--- a/arch/x86_64/src/intel64/Kconfig
+++ b/arch/x86_64/src/intel64/Kconfig
@@ -88,6 +88,7 @@ config ARCH_INTEL64_TSC
        select ARCH_INTEL64_HAVE_TSC
        ---help---
                Select to enable the use of TSC APIC timer of x86_64
+               (SCHED_TICKLESS is not available with this timer).
 
 config ARCH_INTEL64_HPET_ALARM
        bool "HPET timer alarm support"

Reply via email to