Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

timekeeping: Introduce auxiliary timekeepers

Provide timekeepers for auxiliary clocks and initialize them during
boot.

Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: John Stultz <jstultz@google.com>
Link: https://lore.kernel.org/all/20250519083026.350061049@linutronix.de


authored by

Anna-Maria Behnsen and committed by
Thomas Gleixner
22c62b9a 61680246

+20 -2
+20 -2
kernel/time/timekeeping.c
··· 53 53 raw_spinlock_t lock; 54 54 } ____cacheline_aligned; 55 55 56 - static struct tk_data tk_core; 56 + static struct tk_data timekeeper_data[TIMEKEEPERS_MAX]; 57 + 58 + /* The core timekeeper */ 59 + #define tk_core (timekeeper_data[TIMEKEEPER_CORE]) 60 + 57 61 58 62 /* flag for if timekeeping is suspended */ 59 63 int __read_mostly timekeeping_suspended; ··· 116 112 .base[0] = FAST_TK_INIT, 117 113 .base[1] = FAST_TK_INIT, 118 114 }; 115 + 116 + #ifdef CONFIG_POSIX_AUX_CLOCKS 117 + static __init void tk_aux_setup(void); 118 + #else 119 + static inline void tk_aux_setup(void) { } 120 + #endif 119 121 120 122 unsigned long timekeeper_lock_irqsave(void) 121 123 { ··· 1599 1589 } 1600 1590 EXPORT_SYMBOL(ktime_get_raw_ts64); 1601 1591 1602 - 1603 1592 /** 1604 1593 * timekeeping_valid_for_hres - Check if timekeeping is suitable for hres 1605 1594 */ ··· 1710 1701 struct clocksource *clock; 1711 1702 1712 1703 tkd_basic_setup(&tk_core, TIMEKEEPER_CORE, true); 1704 + tk_aux_setup(); 1713 1705 1714 1706 read_persistent_wall_and_boot_offset(&wall_time, &boot_offset); 1715 1707 if (timespec64_valid_settod(&wall_time) && ··· 2640 2630 } 2641 2631 EXPORT_SYMBOL(hardpps); 2642 2632 #endif /* CONFIG_NTP_PPS */ 2633 + 2634 + #ifdef CONFIG_POSIX_AUX_CLOCKS 2635 + static __init void tk_aux_setup(void) 2636 + { 2637 + for (int i = TIMEKEEPER_AUX_FIRST; i <= TIMEKEEPER_AUX_LAST; i++) 2638 + tkd_basic_setup(&timekeeper_data[i], i, false); 2639 + } 2640 + #endif /* CONFIG_POSIX_AUX_CLOCKS */