diff options
| author | Thomas Gleixner <tglx@kernel.org> | 2026-04-10 14:18:57 +0200 |
|---|---|---|
| committer | Thomas Gleixner <tglx@kernel.org> | 2026-07-15 15:04:55 +0200 |
| commit | dfc256dac54c8b692110bf905c64cb130e15963d (patch) | |
| tree | 4afc93732b58e322168f62f03d85753d6012c19a /arch/arm | |
| parent | 3ed403bbc967a3138b8e37566510e9b062751372 (diff) | |
| download | linux-next-dfc256dac54c8b692110bf905c64cb130e15963d.tar.gz linux-next-dfc256dac54c8b692110bf905c64cb130e15963d.zip | |
calibrate: Rework delay timer calibration
The header define in asm/timex,h and the naming of the function to read the
delay timer are confusing at best.
Convert it to a config switch selected by the archictures which provide the
functionality and rename the function to delay_read_timer(), which makes
the purpose clear. Move the declaration to linux/delay.h where it belongs.
Remove the resulting empty asm/timex.h files as well.
No functional change.
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260410120317.978403520@kernel.org
Diffstat (limited to 'arch/arm')
| -rw-r--r-- | arch/arm/Kconfig | 1 | ||||
| -rw-r--r-- | arch/arm/include/asm/delay.h | 1 | ||||
| -rw-r--r-- | arch/arm/include/asm/timex.h | 5 | ||||
| -rw-r--r-- | arch/arm/lib/delay.c | 10 |
4 files changed, 9 insertions, 8 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 9187240a02db..7788949992f4 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -11,6 +11,7 @@ config ARM select ARCH_HAS_CPU_FINALIZE_INIT if MMU select ARCH_HAS_CURRENT_STACK_POINTER select ARCH_HAS_DEBUG_VIRTUAL if MMU + select ARCH_HAS_DELAY_TIMER select ARCH_HAS_DMA_ALLOC if MMU select ARCH_HAS_DMA_OPS select ARCH_HAS_DMA_WRITE_COMBINE if !ARM_DMA_MEM_BUFFERABLE diff --git a/arch/arm/include/asm/delay.h b/arch/arm/include/asm/delay.h index 1d069e558d8d..d2231deb90fa 100644 --- a/arch/arm/include/asm/delay.h +++ b/arch/arm/include/asm/delay.h @@ -91,7 +91,6 @@ extern void __loop_udelay(unsigned long usecs); extern void __loop_const_udelay(unsigned long); /* Delay-loop timer registration. */ -#define ARCH_HAS_READ_CURRENT_TIMER extern void register_current_timer_delay(const struct delay_timer *timer); #endif /* __ASSEMBLY__ */ diff --git a/arch/arm/include/asm/timex.h b/arch/arm/include/asm/timex.h index 6d1337c169cd..94e40c19cfc5 100644 --- a/arch/arm/include/asm/timex.h +++ b/arch/arm/include/asm/timex.h @@ -10,7 +10,10 @@ #define _ASMARM_TIMEX_H typedef unsigned long cycles_t; -#define get_cycles() ({ cycles_t c; read_current_timer(&c) ? 0 : c; }) +// Temporary workaround until timex.h is cleaned up +bool delay_read_timer(unsigned long *t); + +#define get_cycles() ({ cycles_t c; delay_read_timer(&c) ? 0 : c; }) #define random_get_entropy() (((unsigned long)get_cycles()) ?: random_get_entropy_fallback()) #endif diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c index b7fe84f68bf1..7e9304012a68 100644 --- a/arch/arm/lib/delay.c +++ b/arch/arm/lib/delay.c @@ -12,7 +12,6 @@ #include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h> -#include <linux/timex.h> /* * Default to the loop-based delay implementation. @@ -27,15 +26,14 @@ static const struct delay_timer *delay_timer; static bool delay_calibrated; static u64 delay_res; -int read_current_timer(unsigned long *timer_val) +bool delay_read_timer(unsigned long *timer_val) { if (!delay_timer) - return -ENXIO; - + return false; *timer_val = delay_timer->read_current_timer(); - return 0; + return true; } -EXPORT_SYMBOL_GPL(read_current_timer); +EXPORT_SYMBOL_GPL(delay_read_timer); static inline u64 cyc_to_ns(u64 cyc, u32 mult, u32 shift) { |
