From 3ed403bbc967a3138b8e37566510e9b062751372 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 10 Apr 2026 14:18:52 +0200 Subject: [PATCH] treewide: Remove CLOCK_TICK_RATE This has been scheduled for removal more than a decade ago and the comments related to it have been dutifully ignored. The last dependencies are gone. Remove it along with various now empty asm/timex.h files. Signed-off-by: Thomas Gleixner Reviewed-by: Christophe Leroy (CS GROUP) Link: https://patch.msgid.link/20260410120317.910770161@kernel.org --- arch/alpha/include/asm/timex.h | 4 ---- arch/arc/include/asm/timex.h | 15 --------------- arch/arm/mach-omap1/Kconfig | 2 +- arch/hexagon/include/asm/timex.h | 3 --- arch/m68k/include/asm/timex.h | 15 --------------- arch/microblaze/include/asm/timex.h | 13 ------------- arch/mips/include/asm/timex.h | 8 -------- arch/openrisc/include/asm/timex.h | 3 --- arch/parisc/include/asm/timex.h | 2 -- arch/powerpc/include/asm/timex.h | 2 -- arch/s390/include/asm/timex.h | 2 -- arch/sh/include/asm/timex.h | 24 ------------------------ arch/sparc/include/asm/timex.h | 2 +- arch/sparc/include/asm/timex_32.h | 14 -------------- arch/sparc/include/asm/timex_64.h | 2 -- arch/um/include/asm/timex.h | 9 --------- arch/x86/include/asm/timex.h | 3 --- 17 files changed, 2 insertions(+), 121 deletions(-) delete mode 100644 arch/arc/include/asm/timex.h delete mode 100644 arch/microblaze/include/asm/timex.h delete mode 100644 arch/sh/include/asm/timex.h delete mode 100644 arch/sparc/include/asm/timex_32.h delete mode 100644 arch/um/include/asm/timex.h diff --git a/arch/alpha/include/asm/timex.h b/arch/alpha/include/asm/timex.h index f89798da8a14..5a71ba6136b9 100644 --- a/arch/alpha/include/asm/timex.h +++ b/arch/alpha/include/asm/timex.h @@ -7,10 +7,6 @@ #ifndef _ASMALPHA_TIMEX_H #define _ASMALPHA_TIMEX_H -/* With only one or two oddballs, we use the RTC as the ticker, selecting - the 32.768kHz reference clock, which nicely divides down to our HZ. */ -#define CLOCK_TICK_RATE 32768 - /* * Standard way to access the cycle counter. * Currently only used on SMP for scheduling. diff --git a/arch/arc/include/asm/timex.h b/arch/arc/include/asm/timex.h deleted file mode 100644 index 48b3482bc97f..000000000000 --- a/arch/arc/include/asm/timex.h +++ /dev/null @@ -1,15 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) - */ - -#ifndef _ASM_ARC_TIMEX_H -#define _ASM_ARC_TIMEX_H - -#define CLOCK_TICK_RATE 80000000 /* slated to be removed */ - -#include - -/* XXX: get_cycles() to be implemented with RTSC insn */ - -#endif /* _ASM_ARC_TIMEX_H */ diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig index b114f7ca2173..2a724aa6674c 100644 --- a/arch/arm/mach-omap1/Kconfig +++ b/arch/arm/mach-omap1/Kconfig @@ -74,7 +74,7 @@ config OMAP_32K_TIMER currently only available for OMAP16XX, 24XX, 34XX, OMAP4/5 and DRA7XX. On OMAP2PLUS this value is only used for CONFIG_HZ and - CLOCK_TICK_RATE compile time calculation. + timer frequency compile time calculation. The actual timer selection is done in the board file through the (DT_)MACHINE_START structure. diff --git a/arch/hexagon/include/asm/timex.h b/arch/hexagon/include/asm/timex.h index dfe69e118b2b..f0cc2cd6be07 100644 --- a/arch/hexagon/include/asm/timex.h +++ b/arch/hexagon/include/asm/timex.h @@ -9,9 +9,6 @@ #include #include -/* Using TCX0 as our clock. CLOCK_TICK_RATE scheduled to be removed. */ -#define CLOCK_TICK_RATE 19200 - #define ARCH_HAS_READ_CURRENT_TIMER static inline int read_current_timer(unsigned long *timer_val) diff --git a/arch/m68k/include/asm/timex.h b/arch/m68k/include/asm/timex.h index f4a7a340f4ca..b58115f3a282 100644 --- a/arch/m68k/include/asm/timex.h +++ b/arch/m68k/include/asm/timex.h @@ -7,21 +7,6 @@ #ifndef _ASMm68K_TIMEX_H #define _ASMm68K_TIMEX_H -#ifdef CONFIG_COLDFIRE -/* - * CLOCK_TICK_RATE should give the underlying frequency of the tick timer - * to make ntp work best. For Coldfires, that's the main clock. - */ -#include -#define CLOCK_TICK_RATE MCF_CLK -#else -/* - * This default CLOCK_TICK_RATE is probably wrong for many 68k boards - * Users of those boards will need to check and modify accordingly - */ -#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ -#endif - typedef unsigned long cycles_t; static inline cycles_t get_cycles(void) diff --git a/arch/microblaze/include/asm/timex.h b/arch/microblaze/include/asm/timex.h deleted file mode 100644 index e99cc29cbe57..000000000000 --- a/arch/microblaze/include/asm/timex.h +++ /dev/null @@ -1,13 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Copyright (C) 2006 Atmark Techno, Inc. - */ - -#ifndef _ASM_MICROBLAZE_TIMEX_H -#define _ASM_MICROBLAZE_TIMEX_H - -#include - -#define CLOCK_TICK_RATE 1000 /* Timer input freq. */ - -#endif /* _ASM_TIMEX_H */ diff --git a/arch/mips/include/asm/timex.h b/arch/mips/include/asm/timex.h index 7ef06dcdc46e..daedc62f0fb8 100644 --- a/arch/mips/include/asm/timex.h +++ b/arch/mips/include/asm/timex.h @@ -18,14 +18,6 @@ #include #include -/* - * This is the clock rate of the i8253 PIT. A MIPS system may not have - * a PIT by the symbol is used all over the kernel including some APIs. - * So keeping it defined to the number for the PIT is the only sane thing - * for now. - */ -#define CLOCK_TICK_RATE 1193182 - /* * Standard way to access the cycle counter. * Currently only used on SMP for scheduling. diff --git a/arch/openrisc/include/asm/timex.h b/arch/openrisc/include/asm/timex.h index 5487fa93dd9b..1b9f49061332 100644 --- a/arch/openrisc/include/asm/timex.h +++ b/arch/openrisc/include/asm/timex.h @@ -25,9 +25,6 @@ static inline cycles_t get_cycles(void) } #define get_cycles get_cycles -/* This isn't really used any more */ -#define CLOCK_TICK_RATE 1000 - #define ARCH_HAS_READ_CURRENT_TIMER #endif diff --git a/arch/parisc/include/asm/timex.h b/arch/parisc/include/asm/timex.h index b4622cb06a75..453468ba4e3a 100644 --- a/arch/parisc/include/asm/timex.h +++ b/arch/parisc/include/asm/timex.h @@ -9,8 +9,6 @@ #include -#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ - typedef unsigned long cycles_t; static inline cycles_t get_cycles(void) diff --git a/arch/powerpc/include/asm/timex.h b/arch/powerpc/include/asm/timex.h index 14b4489de52c..b48b78e47958 100644 --- a/arch/powerpc/include/asm/timex.h +++ b/arch/powerpc/include/asm/timex.h @@ -11,8 +11,6 @@ #include #include -#define CLOCK_TICK_RATE 1024000 /* Underlying HZ */ - typedef unsigned long cycles_t; static inline cycles_t get_cycles(void) diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h index ac3ab6c29912..23421b6eb225 100644 --- a/arch/s390/include/asm/timex.h +++ b/arch/s390/include/asm/timex.h @@ -159,8 +159,6 @@ static inline void local_tick_enable(unsigned long comp) set_clock_comparator(get_lowcore()->clock_comparator); } -#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ - typedef unsigned long cycles_t; static __always_inline unsigned long get_tod_clock(void) diff --git a/arch/sh/include/asm/timex.h b/arch/sh/include/asm/timex.h deleted file mode 100644 index f53f95bf4288..000000000000 --- a/arch/sh/include/asm/timex.h +++ /dev/null @@ -1,24 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * linux/include/asm-sh/timex.h - * - * sh architecture timex specifications - */ -#ifndef __ASM_SH_TIMEX_H -#define __ASM_SH_TIMEX_H - -/* - * Only parts using the legacy CPG code for their clock framework - * implementation need to define their own Pclk value. If provided, this - * can be used for accurately setting CLOCK_TICK_RATE, otherwise we - * simply fall back on the i8253 PIT value. - */ -#ifdef CONFIG_SH_PCLK_FREQ -#define CLOCK_TICK_RATE (CONFIG_SH_PCLK_FREQ / 4) /* Underlying HZ */ -#else -#define CLOCK_TICK_RATE 1193180 -#endif - -#include - -#endif /* __ASM_SH_TIMEX_H */ diff --git a/arch/sparc/include/asm/timex.h b/arch/sparc/include/asm/timex.h index 9aac26b1f45f..f0f980581590 100644 --- a/arch/sparc/include/asm/timex.h +++ b/arch/sparc/include/asm/timex.h @@ -4,6 +4,6 @@ #if defined(__sparc__) && defined(__arch64__) #include #else -#include +#include #endif #endif diff --git a/arch/sparc/include/asm/timex_32.h b/arch/sparc/include/asm/timex_32.h deleted file mode 100644 index f86326a6f89e..000000000000 --- a/arch/sparc/include/asm/timex_32.h +++ /dev/null @@ -1,14 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * linux/include/asm/timex.h - * - * sparc architecture timex specifications - */ -#ifndef _ASMsparc_TIMEX_H -#define _ASMsparc_TIMEX_H - -#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ - -#include - -#endif diff --git a/arch/sparc/include/asm/timex_64.h b/arch/sparc/include/asm/timex_64.h index 076c44f6845d..f55cfb9c7105 100644 --- a/arch/sparc/include/asm/timex_64.h +++ b/arch/sparc/include/asm/timex_64.h @@ -9,8 +9,6 @@ #include -#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ - /* Getting on the cycle counter on sparc64. */ typedef unsigned long cycles_t; #define get_cycles() tick_ops->get_tick() diff --git a/arch/um/include/asm/timex.h b/arch/um/include/asm/timex.h deleted file mode 100644 index 9f27176adb26..000000000000 --- a/arch/um/include/asm/timex.h +++ /dev/null @@ -1,9 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __UM_TIMEX_H -#define __UM_TIMEX_H - -#define CLOCK_TICK_RATE (HZ) - -#include - -#endif diff --git a/arch/x86/include/asm/timex.h b/arch/x86/include/asm/timex.h index 6e57e3c0fdd2..3c07d6bfc106 100644 --- a/arch/x86/include/asm/timex.h +++ b/arch/x86/include/asm/timex.h @@ -13,9 +13,6 @@ static inline unsigned long random_get_entropy(void) } #define random_get_entropy random_get_entropy -/* Assume we use the PIT time source for the clock tick */ -#define CLOCK_TICK_RATE PIT_TICK_RATE - #define ARCH_HAS_READ_CURRENT_TIMER #endif /* _ASM_X86_TIMEX_H */