summaryrefslogtreecommitdiff
path: root/drivers/clocksource
AgeCommit message (Collapse)Author
11 daysMerge tag 'pm-7.4-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management updates from Rafael Wysocki: "This time, the most visible part are the ACPI CPPC updates from Christian Loehle, including CPPC cpufreq driver changes, even though updates of cpufreq drivers proper are still the largest topic group. However, the updates of cpufreq drivers depend on the ACPI CPPC updates, so they should really be counted together and that is well over 1/2 of the total commit count. Interestingly enough, almost all of the updates included here are fixes or cleanups, with some new feature support in the amd-pstate cpufreq driver and IPQ9650 support in the qcom-nvmem cpufreq driver. The runtime PM documentation improvements from Brian Norris can also be mostly regarded as fixes, but a new kunit test goes along with them. Specifics: - Fix multiple issues related to input validation, synchronization, access safety, memory layout and register field validation, and error handling in the ACPI CPPC library (Christian Loehle and Sumit Gupta) - Select the frequency-invariance callback per CPU in the CPPC cpufreq driver and create the FIE worker before enabling PCC callbacks in it to avoid queueing work through a missing worker and dereferencing a NULL pointer (Christian Loehle) - Update the CPPC cpufreq driver entry in MAINTAINERS and add a new entry for the ACPI CPPC library (Christian Loehle) - Minor fixes in various cpufreq drivers (Alexander Koskovich, Daniel Schwierzeck, Frank Zhang, Haotian Zhang, Kathiravan Thirumoorthy, Sumeet Pawnikar, and Xueqin Luo) - Fix wrong behaviors on multi-node servers in the Loongson cpufreq driver (Huacai Chen) - Reject NULL from cpufreq_cpu_get() in the Rust code (Mehmet Koseoglu) - Add suspend OPP to mediatek cpufreq driver and DT (Ryan Brue) - Fixups for a few bugs identified by Sashiko in the amd-pstate cpufreq driver (Mario Limoncielloi, Wentao Guan) - Initial support for maximum frequency capacity handling on Zen6 client in amd-pstate (Mario Limonciello) - Fix for amd-pstate-ut with 'Requested CPU Min frequency' BIOS option (K Prateek Nayak) - New Zen6 tuning values for EPP in amd-pstate (Mario Limonciello, Vishal Badole) - amd-pstate documentation fix (Karl Mehltretter) - Restrict deferred downscaling to low load for shared policies in the conservative cpufreq governor to avoid undesirable CPU frequency reduction in some cases (Shengming Hu) - Serialize sugov_start() against rate limit updates in the schedutil cpufreq governor to avoid using a stale rate limit value (Hui Su) - Prevent cpuidle governors menu and teo from returning idle state 0 after it has been disabled (Xueqin Luo) - Replace min_t() with the better alternatives in the intel_idle driver and make it use 2-argument strscpy() (Andy Shevchenko) - Fix two repeated phrase instances in cpuidle (Hemanth Selam, Syazwina Fazrul) - Add rugged Panther Lake support to the intel_rapl power capping driver and make it use %pe for printing error pointers (Srinivas Pandruvada and Sumeet Pawnikar) - Update and improve runtime PM documentation and add a kunit test for supplier idle/suspend (Brian Norris) - Add a pm_runtime_dont_use_autosuspend() call to pm_runtime_reinit() to ensure autosuspend disabling on driver teardown (Joshua Crofts) - Ignore page-zero RAM in E820 checksum during hibernation on x86 to avoid rejecting images created after kexec() (Matthias Goergens) - Add resume event mapping for PMSG_POWEROFF to the PM core to allow it to carry out device shutdown in the future (Mario Limonciello) - Add DPM watchdog to prepare/late/early/noirq/complete phases of device suspend and resume (Mayank Rungta) - Update swsusp.txt references to swsusp.rst in hibernation documentation (Li Jun) - Fix use-after-free of perf domain in netlink doit handlers for energy models (Fan Wu) - Add synchronize_rcu() back to cpu_pm_unregister_notifier() after it was removed inadvertently in previous development cycles to avoid use-after-free (Bradley Morgan) - Unregister CPU PM notifier outside the timer lock in the timer-ti-dm clocksource driver (Bradley Morgan) - Fix typo "sucessfully" in a comment in pm_clk_add_clk() kerneldoc comment and typo "hierachy" in a comment in pm-graph (Hemanth Selam) - Fix the return value in dev_pm_opp_get_of_node() kernel-doc (Karl Mehltretter)" * tag 'pm-7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (89 commits) cpufreq: loongson3: Replace IOCSR read/write with MMIO ones cpufreq: loongson3: Use global physical CPU ID in get/target callbacks cpufreq: loongson3: Replace per-package mutex with per-node cpufreq: loongson3: Adjust the width of id and val in smc_message cpufreq: loongson3: Make this driver depend on MACH_LOONGSON64 PM: runtime: Expand introduction with core concepts and structure cpufreq: schedutil: Serialize sugov_start() against rate limit updates MAINTAINERS: ACPI: Add a separate CPPC entry MAINTAINERS: cpufreq: Replace CPPC reviewer arm64: dts: mediatek: mt8173: Mark the lowest CPU OPPs for suspend cpufreq: mediatek: Enter system sleep at the suspend OPP cpufreq: qcom-cpufreq-hw: fix device node refcount leak in phandle parsing cpufreq: qcom-nvmem: Add IPQ9650 support cpufreq: Add Milos to cpufreq-dt-platdev blocklist cpufreq: Use %pe to print error pointers symbolically rust: rcpufreq_dt: add module alias cpufreq: sti: avoid NULL dereference in dev_err() cpufreq: tegra194: fix double-pointer error in get_cpu_ndiv cpufreq: sparc-us2e: fix frequency table index copy-paste error rust: cpufreq: reject NULL from cpufreq_cpu_get() ...
11 daysMerge tag 'timers-clocksource-2026-10-20' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull clocksource updates from Thomas Gleixner: "Updates for clocksource and clockevent drivers: - Support for the Renesas RZ/N1 timers - Rework of the per CPU and per cluster MIPS GIC timers to improve performance, sched clock precision and to add VDSO support. - The usual assorted pile of small fixes and improvements all over the place" * tag 'timers-clocksource-2026-10-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: clocksource/drivers/timer-ti-dm: Handle runtime resume failure clocksource/drivers/timer-mediatek: Request and enable the bus clock clocksource/drivers/timer-mediatek: Convert to OF probing clocksource/drivers/timer-mediatek: Fix random crash at boot clocksource/drivers/timer-econet-en751221: Fix clock reference leak clocksource/drivers/digicolor: Fix clk reference leak on request_irq failure clocksource/drivers/fttmr010: Fix clk reference leak in error paths clocksource/drivers/dbx500-prcmu: Check timer register mapping clocksource/drivers/timer-ti-dm: Register clocksource/event only for am654 clocksource/drivers/mips-gic-timer: Use local counter on synced multi-cluster systems clocksource/drivers/mips-gic-timer: Simplify gic_next_event() for per-cpu timer MAINTAINERS: Add the Renesas RZ/N1 timers driver entry clocksource/drivers: Add support for the Renesas RZ/N1 timers dt-bindings: timer: Add the Renesas RZ/N1 timer
2026-10-14clocksource/drivers/timer-ti-dm: Handle runtime resume failureJiale Yao
omap_dm_timer_write_counter() accesses timer registers and updates the saved counter value after requesting a runtime PM reference. If runtime resume fails, the timer remains inaccessible and no reference is acquired, but the function still writes the register, drops a reference, updates the cached value, and reports success. Check the return value and propagate an error before touching the timer state. Fixes: 0494fc345b37 ("clocksource/drivers/timer-ti-dm : Capture functionality for OMAP DM timer") Signed-off-by: Jiale Yao <yaojiale02@163.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Link: https://patch.msgid.link/20261003080812.429386-1-yaojiale02@163.com
2026-10-13clocksource/drivers/timer-mediatek: Request and enable the bus clockLuca Leonardo Scorcia
MediaTek APXGPT general purpose timers may optionally depend on a bus clock. If this clock is not enabled the timers don't actually run. Boot loaders usually turn it on, but later the kernel turns it off since it's never requested by any driver. Some platforms (like mt6735) declare it as a critical clock in their clock definitions to keep it running, but at least on mt8167 it's not actually required for a successful boot. If a bus clock is declared in the device tree, make sure it is enabled by driver probe and associated to the device. Signed-off-by: Luca Leonardo Scorcia <l.scorcia@gmail.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Link: https://patch.msgid.link/20261002072115.169250-4-l.scorcia@gmail.com
2026-10-13clocksource/drivers/timer-mediatek: Convert to OF probingLuca Leonardo Scorcia
MediaTek APXGPT general purpose timer driver is registered via TIMER_OF_DECLARE to be loaded early in the boot process. It depends on a reference 13 MHz clock that is assigned via the clocks property of its DT node. On platforms like mt8516/mt8167 this clock is provided by a driver that is loaded using OF probing and becomes available only later during boot. This leads to a silent EDEFER error during timer init, which is not recovered by TIMER_OF_DECLARE and GPT clocks are not registered at all. Since those clocks are not critical for boot, convert the timer-mediatek to OF probing and drop the TIMER_OF_DECLARE instructions. Signed-off-by: Luca Leonardo Scorcia <l.scorcia@gmail.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Link: https://patch.msgid.link/20261002072115.169250-3-l.scorcia@gmail.com
2026-10-13clocksource/drivers/timer-mediatek: Fix random crash at bootLuca Leonardo Scorcia
MediaTek bootloaders generally enable APXGPT timers at boot. This means that a timer IRQ can sometimes happen between the IRQ line request and the configuration of the clock event handler. This leads to a hard crash with an instruction abort, branch to pc 0x0 in mtk_gpt_interrupt handler as clkevt is null. To avoid this issue request the IRQ with IRQF_NO_AUTOEN and enable it explicitly after the clock event is configured. Issue was reported and fix tested on the Lenovo Tab E7 (TB-7104F, mt8167). Fixes: a0858f937960 ("clocksource/drivers/timer-mediatek: Convert the driver to timer-of") Signed-off-by: Luca Leonardo Scorcia <l.scorcia@gmail.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Link: https://patch.msgid.link/20261002072115.169250-2-l.scorcia@gmail.com
2026-10-07clocksource/drivers/timer-econet-en751221: Fix clock reference leakWentao Liang
timer_init() obtains the timer clock with of_clk_get() and only reads its frequency with clk_get_rate(); the clock is never prepared nor enabled. All four return paths after the acquisition (of_iomap() failure, clocksource_mmio_init() failure, cevt_init() failure and success) return without clk_put(), leaking the consumer reference. Drop the reference with clk_put() right after the frequency has been read. The clock enable state is untouched. Fixes: 3b4c33ac87d0 ("clocksource/drivers: Add EcoNet Timer HPT driver") Signed-off-by: Wentao Liang <vulab@iscas.ac.cn> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Tested-by: Caleb James DeLisle <cjd@cjdns.fr> Link: https://patch.msgid.link/20260915054552.1729612-1-vulab@iscas.ac.cn
2026-10-07clocksource/drivers/digicolor: Fix clk reference leak on request_irq failureWentao Liang
digicolor_timer_init() obtains the timer clock with of_clk_get() and enables it, but the request_irq() failure path returns without releasing the clock reference, leaking both the enable/prepare state and the reference itself. Disable and put the clock before returning on the request_irq() failure path. The success path keeps the clock enabled for the lifetime of the timer and is left untouched. Fixes: 9b8bb7736b78 ("clocksource: Driver for Conexant Digicolor SoC timer") Cc: stable@vger.kernel.org Signed-off-by: Wentao Liang <vulab@iscas.ac.cn> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Acked-by: Baruch Siach <baruch@tkos.co.il> Link: https://patch.msgid.link/20260915045242.1726702-1-vulab@iscas.ac.cn
2026-10-07clocksource/drivers/fttmr010: Fix clk reference leak in error pathsWentao Liang
fttmr010_common_init() obtains the PCLK reference with of_clk_get_by_name() but never calls clk_put(). If clk_prepare_enable() fails the reference is leaked directly, and every error path that jumps to out_disable_clock only calls clk_disable_unprepare(), which releases the prepare/enable state but not the reference obtained from of_clk_get_by_name(). Add clk_put() to the clk_prepare_enable() failure path and to the out_disable_clock label so the clock reference is no longer leaked. The success path keeps PCLK enabled for the lifetime of the timer and is left untouched. Fixes: dd98442e17a6 ("clocksource/drivers/fttmr010: Drop Gemini specifics") Cc: stable@vger.kernel.org Signed-off-by: Wentao Liang <vulab@iscas.ac.cn> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Reviewed-by: Linus Walleij <linusw@kernel.org> Link: https://patch.msgid.link/20260915045426.1726805-1-vulab@iscas.ac.cn
2026-10-02clocksource/drivers/dbx500-prcmu: Check timer register mappingSlavin Liu
Return -ENOMEM if of_iomap() fails, before reading or configuring the timer register block. Detected by static analysis and reviewed with AI-assisted source auditing. Fixes: 9d2aa8c7961a ("ARM/clocksource: use automatic DT probing for ux500 PRCMU") Assisted-by: LLM Signed-off-by: Slavin Liu <bolin.liu@seu.edu.cn> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Reviewed-by: Linus Walleij <linusw@kernel.org> Link: https://patch.msgid.link/20260911060917.94310-1-bolin.liu@seu.edu.cn
2026-10-02clocksource/drivers/timer-ti-dm: Register clocksource/event only for am654Markus Schneider-Pargmann (TI)
Registering clocksource/clockevent for the older platforms breaks booting them. The older platforms have their own implementation in early boot that is used to register clocksource/clockevent in timer-ti-dm-systimer.c. With am654, the timer is much more complex with more dependencies so doing this in early boot with the other driver is very difficult and gets ugly. Instead it is implemented in the platform driver for am654. However the old platforms may not register clocksource/clockevent in this driver as that would break the boot. Add a system_timer_capable flag that is only set for am654-timer that gates the clocksource/clockevent registration. Reported-by: H. Nikolaus Schaller <hns@goldelico.com> Closes: https://lore.kernel.org/r/2013A99A-0502-4128-ACFA-B04886224393@goldelico.com Fixes: b8eeeca55456 ("clocksource/drivers/timer-ti-dm: Add clocksource support") Signed-off-by: Markus Schneider-Pargmann (TI) <msp@baylibre.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Tested-by: Andreas Kemnade <andreas@kemnade.info> # OMAP3 GTA04 Tested-by: Kevin Hilman <khilman@baylibre.com> # OMAP3 Beagle XM Tested-by: H. Nikolaus Schaller <hns@goldelico.com> # OMAP3 OpenPandora Link: https://patch.msgid.link/20260828-v7-3-next-topic-ti-timer-dm-clocksource-omap-fix-v1-1-85f0e4dc6f9f@baylibre.com
2026-10-02clocksource/drivers/mips-gic-timer: Use local counter on synced ↵Benoît Monin
multi-cluster systems In a multi-cluster MIPS system there is one GIC per cluster, each with its own independent counter. These counters are not synchronized in hardware and can drift relative to one another, which is why multi- cluster systems currently fall back to gic_hpt_read_multicluster(): every clocksource read is redirected to cluster 0's counter via a cross-cluster register access. Instead, actively synchronize the counter of each secondary cluster to cluster 0's counter as its CPUs come online. When the first CPU of a cluster starts and the GIC counter is stopped, gic_sync_counter_64() is used to align the local counter with cluster 0 on systems using 64-bit CM accesses: - the local counter is stopped, loaded with cluster 0's counter value plus an accumulated offset, and restarted; - the alignment is checked by reading the local counter, cluster 0's counter and the local counter again (t0, t1, t2). If t1 lies between t0 and t2 the two counters are considered in sync; - otherwise the offset is refined by half of the measured error to compensate for the cross-cluster access latency, and the process is retried. After a short delay the alignment is re-checked to confirm the counters have not drifted apart, and only then is the cluster recorded as synchronized in gic_synced_cl_map. Clusters with no cores and cluster 0 itself are marked synchronized up-front. Once every cluster is synchronized, gic_clocksource_promote() sets gic_use_local_counter so that gic_hpt_read() stops redirecting reads to cluster 0 and uses the local counter instead. It also re-enables the GIC VDSO clock mode and registers the GIC counter as the sched_clock. Systems where synchronization cannot be achieved keep using the safe cross-cluster read path. The promotion is deferred to a workqueue because it is triggered from the CPU hotplug STARTING callback, which runs with interrupts disabled, while registering the sched_clock and switching the VDSO clock mode should be done from process context. Note that the clocksource is only promoted once when all clusters are first online and all GIC counters are in sync. It is assumed that even if a cluster is fully powered off and later powered on again, gic_sync_counter_64() will be able to re-synchronize it. Said differently: there is no support to "demote" the clocksource. On the dual-cluster Mobileye EyeQ6H SoC, this allows four times faster clock_gettime(CLOCK_MONOTONIC) and a much higher precision sched_clock instead of jiffies. Signed-off-by: Benoît Monin <benoit.monin@bootlin.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Reviewed-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Link: https://patch.msgid.link/20260929-sync-gic-counters-v4-5-ec70c4b60434@bootlin.com
2026-10-02clocksource/drivers/mips-gic-timer: Simplify gic_next_event() for per-cpu timerBenoît Monin
The GIC clock event device is registered per CPU and is flagged with CLOCK_EVT_FEAT_C3STOP. This guarantees that the set_next_event() callback is always invoked on the CPU of the event. Drop the code path configuring the compare register of another CPU as it is never called and does not correctly handle the case of having multiple clusters, and document this guarantee by adding the CLOCK_EVT_FEAT_PERCPU flag to the clock event device features. Signed-off-by: Benoît Monin <benoit.monin@bootlin.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Reviewed-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Link: https://patch.msgid.link/20260929-sync-gic-counters-v4-4-ec70c4b60434@bootlin.com
2026-10-02clocksource/drivers: Add support for the Renesas RZ/N1 timersHerve Codina (Schneider Electric)
The Renesas RZ/N1 timer block controller is the controller in charge of timers available in the Renesas RZ/N1 SoCs family. This controller handles 8 timers: - 6 16-bit timers - 2 32-bit timers Each timer has its own interrupt, its own prescaler that can be used to divide the clock by 25 and all of them can work in either one-shot or periodic mode. Signed-off-by: Herve Codina (Schneider Electric) <herve.codina@bootlin.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://patch.msgid.link/20261001082225.125956-3-herve.codina@bootlin.com
2026-09-11clocksource/drivers/timer-ti-dm: Unregister CPU PM notifier outside of the ↵Bradley Morgan
timer lock omap_dm_timer_remove() calls cpu_pm_unregister_notifier() with dm_timer_lock held and interrupts disabled. Nothing sleeps in there today, but it pins the helper into a context where it can never be allowed to sleep, which is in the way of restoring the RCU grace period on the cpu_pm notifier chain. Do the list lookup under the lock and move the unregister after the unlock. Nothing can race it at that point: remove() owns the device, and once the timer is off the list nobody can reach it anymore. Signed-off-by: Bradley Morgan <include@grrlz.net> Link: https://patch.msgid.link/20260813074343.26460-2-include@grrlz.net Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-04clocksource: clint: Use IPI_MAX for IPI muxingGUO Ren (XuanTie)
Replace the hard-coded BITS_PER_BYTE with IPI_MAX now that the constant is exported from riscv asm/smp.h. Signed-off-by: GUO Ren (XuanTie) <guoren@kernel.org> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://patch.msgid.link/20260816070049.2097442-4-guoren@kernel.org
2026-08-26Merge tag 'hyperv-next-signed-20260826' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull hyperv updates from Wei Liu: - Decrypt netvsc buffer on contiguous direct-map addresses (Kameron Carr) - Drop WS2012/2012R2 & Win8/8.1 Hyper-V support (Michael Kelley) - Use more meaningful errnos for hypercall status code (Hardik Garg) - Fix lost interrupts on CPU hot-unplug for Hyper-V PCI/MSI (Naman Jain) - Reserve more MSHV vectors for Linux root partition (Wei Liu) * tag 'hyperv-next-signed-20260826' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: clocksource: hyper-v: Remove support for stimer interrupts in message mode scsi: storvsc: Remove support for storvsc protocol of old Hyper-V hosts hv_netvsc: Remove GPADL teardown special case for old Hyper-V hosts hv_sock: Remove check for old Hyper-V hosts Drivers: hv: Remove support for WS2012/2012R2 & Win8/8.1 version of Hyper-V hv_netvsc: Allocate send/receive buffers using vmbus_alloc_buffer() Drivers: hv: vmbus: Add vmbus_alloc_buffer()/vmbus_free_buffer() for CoCo VMs Drivers: hv: vmbus: add vmbus_establish_gpadl_caller_decrypted() Drivers: hv: vmbus: Skip VMBus module cleanup for non-nested root partition x86/hyperv: reserve more vectors PCI: hv: Set irq_retrigger callback for the Hyper-V PCI MSI irqchip Drivers: hv: Use meaningful errnos for hypercall status codes
2026-08-24clocksource: hyper-v: Remove support for stimer interrupts in message modeMichael Kelley
In Hyper-V versions prior to WS2016/Win10, Hyper-V synthetic timers interrupt the guest by delivering a message that is initially handled by the Linux VMBus driver. Starting with WS2016/Win10, Hyper-V can deliver stimer interrupts directly to an assigned interrupt vector without involving the VMBus driver. This is called "Direct Mode". With the overall removal of Linux support for running on Hyper-V hosts earlier than WS2016 and Windows 10, it's no longer necessary to support the legacy message-based delivery. Remove that delivery mechanism and always use Direct Mode. If for some reason, the Hyper-V host does not enumerate Direct Mode, output an error message but continue to run using the LAPIC timer instead of an stimer. With these changes, the VMBus driver no longer calls the stimer interrupt service routine. This removal has a broader benefit in unblocking the disentangling of VMBus code and stimer code, as they should be independent of each other. The final disentangling will come as a follow-on patch set. Signed-off-by: Michael Kelley <mhklinux@outlook.com> Signed-off-by: Wei Liu <wei.liu@kernel.org>
2026-08-18Merge tag 'timers-vdso-2026-08-17' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull VDSO updates from Thomas Gleixner: - Consolidate the VDSO datastore further and provide support for mlock_all() and prefaulting. - Provide 32-bit legacy time related functionality only if CONFIG_COMPAT_32BIT_TIME is enabled. The config switch exists, but architecture code still exposes the legacy functionality even disabled. Clean this up by adding the missing guards and validating at build time that the VDSO is legacy free if disabled. - Consolidate the VDSO related config options in core and drivers, which removes some non-sensical dependencies and quite an amount of #ifdeffery. - Clean up the PAGE_SIZE definition maze * tag 'timers-vdso-2026-08-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (30 commits) random: vDSO: Drop custom PAGE_SIZE definitions LoongArch: Remove CONFIG_GENERIC_GETTIMEOFDAY ifdeffery clocksource/drivers/timer-riscv: Remove CONFIG_GENERIC_GETTIMEOFDAY ifdeffery clocksource/drivers/arm_arch_timer: Remove CONFIG_GENERIC_GETTIMEOFDAY ifdeffery clocksource/drivers/mips-gic-timer: Remove CONFIG_GENERIC_GETTIMEOFDAY ifdeffery MIPS: csrc-r4k: Remove CONFIG_GENERIC_GETTIMEOFDAY ifdeffery vDSO: Make clockmode constants available without CONFIG_GENERIC_GETTIMEOFDAY kbuild: Support generated asm-headers in subdirectories vdso: Rename HAVE_GENERIC_VDSO to VDSO_DATASTORE vdso: Drop HAVE_GENERIC_VDSO from architecture kconfig files vdso: Automatically select HAVE_GENERIC_VDSO if necessary MIPS: vdso: Stop using CONFIG_HAVE_GENERIC_VDSO vdso: Remove the dependency on HAVE_GENERIC_VDSO from ARCH_HAS_VDSO_ARCH_DATA futex: Remove dependency on HAVE_GENERIC_VDSO from FUTEX_ROBUST_UNLOCK vdso/gettimeofday: Verify COMPAT_32BIT_TIME interactions sparc: vdso: Respect COMPAT_32BIT_TIME MIPS: VDSO: Respect COMPAT_32BIT_TIME powerpc/vdso: Respect COMPAT_32BIT_TIME ARM: VDSO: Respect COMPAT_32BIT_TIME arm64: vdso32: Respect COMPAT_32BIT_TIME ...
2026-08-18Merge tag 'timers-clocksource-2026-08-17' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull clocksource/event driver updates from Thomas Gleixner: - Remove redundant dev_err() and dev_err_probe() invocations in various drivers - Handle SWAP_IO_SPACE correctly in the rtl-otto driver - Make the Samsumg PWM timer driver PREEMPT_RT compatible - Ensure that the SUN4I timer is programmed with a delta larger than zero as a zero delta causes the the timer to be disabled - The usual fixes and improvements all over the place * tag 'timers-clocksource-2026-08-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: clocksource/drivers/armada: Unwind timer clock on init failure clocksource/drivers/rtl-otto: Change driver to use __raw reads and writes clocksource/drivers/samsung_pwm: Switch to raw_spinlock_t type clocksource/drivers/clps711x: Do not unmap clocksource MMIO clocksource/drivers/nxp-pit: Fix IRQ leak on cpuhp_setup_state error path clocksource/drivers/timer-sun4i: Advertise a real minimum delta clocksource: Remove redundant dev_err()/dev_err_probe() clocksource/drivers/sh_cmt: Use named initializers for platform_device_id arrays clocksource/drivers/sh_mtu2: Drop unused assignment of platform_device_id
2026-08-13clocksource/drivers/armada: Unwind timer clock on init failureYuho Choi
The Armada timer init paths enable their clock before calling the common initialization routine. If that routine returns an error, the clock is left enabled even though the timer was not initialized successfully. Fixes: 12549e27c63c ("clocksource/drivers/time-armada-370-xp: Convert init function to return error") Signed-off-by: Yuho Choi <dbgh9129@gmail.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Link: https://patch.msgid.link/20260802213545.565913-1-dbgh9129@gmail.com
2026-08-13clocksource/drivers/rtl-otto: Change driver to use __raw reads and writesRustam Adilov
As it stands, the driver uses ioread32 and iowrite32 for register access and it works fine. However this stops working when the SWAP_IO_SPACE config is enabled as this drivers expects ioread32 and iowrite32 to be in native endian (that is big endian for currently supported SoCs). RTL9607C is a big endian MIPS SoC that has identical timer as the already supported chips but needs to have SWAP_IO_SPACE to have a functioning little endian USB host. Fix this by replacing all instances of ioread32 and iowrite32 with __raw_readl and __raw_writel variants. Since they essentially do the same register access, this shouldn't affect anything on other machines. Signed-off-by: Rustam Adilov <adilov@disroot.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Link: https://patch.msgid.link/20260725175510.77240-1-adilov@disroot.org
2026-08-13clocksource/drivers/samsung_pwm: Switch to raw_spinlock_t typeMarek Szyprowski
Samsung PWM timer might be used as a clock source on some legacy systems. When PREEMPT_RT is enabled on ARM, regular spinlock is converted to a sleeping lock (mutex-based), which must not be used in atomic context such as hard interrupt handlers. Switch the samsung_pwm_lock to the raw_spinlock, which remains a true non-sleeping spinlock even under PREEMPT_RT. Fixes: 7aac482e6290 ("clocksource: samsung_pwm_timer: Make PWM spinlock global") Fixes: f11899894c0a ("clocksource: add samsung pwm timer driver") Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Acked-by: Uwe Kleine-König <ukleinek@kernel.org> Link: https://patch.msgid.link/20260713085653.1145015-1-m.szyprowski@samsung.com
2026-08-13clocksource/drivers/clps711x: Do not unmap clocksource MMIOGuangshuo Li
clps711x_clksrc_init() stores the timer base address in the static tcd pointer and registers it as both the clocksource MMIO address and the sched_clock read address. The clocksource init path must therefore keep the mapping alive after clps711x_timer_init() returns. However, the shared unmap_io exit path is also reached after successful clocksource registration, so the MMIO mapping is torn down while the clocksource and sched_clock readers may still access it. Return directly after successful clocksource registration and leave the mapping alive for the registered readers. Keep the unmap_io path for the error paths and for the clockevent init path. Fixes: cd32e596f02f ("clocksource/drivers/clps711x: Fix resource leaks in error paths") Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Link: https://patch.msgid.link/20260704175451.256364-1-lgs201920130244@gmail.com
2026-08-13clocksource/drivers/nxp-pit: Fix IRQ leak on cpuhp_setup_state error pathWenTao Liang
When cpuhp_setup_state fails after pit_clockevent_per_cpu_init has successfully called request_irq, the error handling jumps directly to out_pit_clocksource_unregister without freeing the registered IRQ. This leaks the IRQ line and, since kfree(pit) follows, leaves a dangling pointer registered as the interrupt handler's dev_id, potentially leading to a use-after-free if the IRQ fires afterwards. Fix it by calling pit_clockevent_per_cpu_exit to properly release the IRQ before falling through to the existing cleanup chain. Suggested-by: Greg KH <gregkh@linuxfoundation.org> Fixes: bee33f22d7c3 ("clocksource/drivers/nxp-pit: Add NXP Automotive s32g2 / s32g3 support") Cc: stable@vger.kernel.org Signed-off-by: WenTao Liang <vulab@iscas.ac.cn> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Link: https://patch.msgid.link/20260628130700.45680-1-vulab@iscas.ac.cn
2026-08-13clocksource/drivers/timer-sun4i: Advertise a real minimum deltaFelix Yan
sun4i_clkevt_next_event() compensates for the timer stop/start synchronization delay by programming evt - TIMER_SYNC_TICKS into the hardware interval register. The clockevent device currently advertises TIMER_SYNC_TICKS as min_delta_ticks, so the clockevents core is allowed to call set_next_event() with evt == TIMER_SYNC_TICKS. That programs a zero-tick interval. With oneshot/highres/nohz timer operation this can leave the next event stuck, which was observed as a boot hang on Allwinner D1 after the clockevents core started reusing forced minimum-delta events. Advertise one extra tick instead, so the smallest event accepted by the core still programs at least one hardware tick after the synchronization compensation. Fixes: 12e1480bcb49 ("clocksource: sun4i: Report the minimum tick that we can program") Reported-by: Indrek Kruusa <indrek.kruusa@gmail.com> Closes: https://lore.kernel.org/linux-riscv/CA+fTLhgLmTY+exGujKf8OYYQvcEW5X5NJ_5sLq2AYL6zER2c0A@mail.gmail.com/ Assisted-by: Codex:gpt-5.5 Signed-off-by: Felix Yan <felixonmars@archlinux.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Tested-by: Indrek Kruusa <indrek.kruusa@gmail.com> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/linux-riscv/CA+fTLhgLmTY+exGujKf8OYYQvcEW5X5NJ_5sLq2AYL6zER2c0A@mail.gmail.com/ Link: https://patch.msgid.link/20260624220434.4183732-1-felixonmars@archlinux.org
2026-08-13clocksource: Remove redundant dev_err()/dev_err_probe()Pan Chuang
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in devm_request_*_irq()"), devm_request_irq() automatically logs detailed error messages on failure. Remove the now-redundant driver-specific dev_err() and dev_err_probe() calls. Signed-off-by: Pan Chuang <panchuang@vivo.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Link: https://patch.msgid.link/20260713130740.293502-1-panchuang@vivo.com
2026-08-13clocksource/drivers/sh_cmt: Use named initializers for platform_device_id arraysUwe Kleine-König (The Capable Hub)
Named initializers are better readable and more robust to changes of the struct definition. This robustness is relevant for a planned change to struct platform_device_id replacing .driver_data by an anonymous union. Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Link: https://patch.msgid.link/6a6951b86f0e9a2ab4a378ab63edf7a487f1d693.1781687723.git.u.kleine-koenig@baylibre.com
2026-08-13clocksource/drivers/sh_mtu2: Drop unused assignment of platform_device_idUwe Kleine-König (The Capable Hub)
The driver explicitly sets the .driver_data member of struct platform_device_id to zero without relying on that value. Drop these unused assignments. While touching this array drop the comma after the list terminator and use a named initializer for .name. Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Link: https://patch.msgid.link/a44e520e437f1b4017b3205c274a2457cbdeb43d.1781687723.git.u.kleine-koenig@baylibre.com
2026-08-12clocksource/drivers/arm_arch_timer: Workaround bcm2712 broken EL2 virtual timerMarc Zyngier
It appears that the bcm2712 SoC found in the relatively popular RPi5 has a broken EL2 virtual timer. Tthe reason why the timer isn't working is unknown (the timer is ticking, but the interrupt never fires), and the SoC vendor doesn't communicate on the reason why this isn't working, leaving users and maintainers in the dark. Paper over the issue by detecting the broken HW, falling back to the physical timer instead, and let the user know about it. Also taint the kernel as the machine is definitely not compliant with the spec, and it's unknown what else is wrong with it. Reported-by: John <therealgraysky@proton.me> Reported-by: Daniel Drake <dan@reactivated.net> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Tested-by: Gary Guo <gary@garyguo.net> Acked-by: Florian Fainelli <florian.fainelli@broadcom.com> Cc: Daniel Lezcano <daniel.lezcano@kernel.org> Link: https://patch.msgid.link/20260710080958.491620-1-maz@kernel.org
2026-08-10clocksource/drivers/timer-riscv: Remove CONFIG_GENERIC_GETTIMEOFDAY ifdefferyThomas Weißschuh
Now that there is a definition of VDSO_CLOCKMODE_ARCHTIMER even if no vDSO is built, the ugly ifdeffery can be removed. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20260724-vdso-arch-clockmodes-v4-6-ddbe447be860@linutronix.de
2026-08-10clocksource/drivers/arm_arch_timer: Remove CONFIG_GENERIC_GETTIMEOFDAY ifdefferyThomas Weißschuh
Now that there is a definition of VDSO_CLOCKMODE_ARCHTIMER even if no vDSO is built, the ugly ifdeffery can be removed. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Acked-by: Marc Zyngier <maz@kernel.org> Link: https://patch.msgid.link/20260724-vdso-arch-clockmodes-v4-5-ddbe447be860@linutronix.de
2026-08-10clocksource/drivers/mips-gic-timer: Remove CONFIG_GENERIC_GETTIMEOFDAY ifdefferyThomas Weißschuh
Now that there is a definition of VDSO_CLOCKMODE_GIC even if no vDSO is built, the ugly ifdeffery can be removed. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20260724-vdso-arch-clockmodes-v4-4-ddbe447be860@linutronix.de
2026-06-15Merge tag 'timers-vdso-2026-06-13' of ↵Linus Torvalds
gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip Pull vdso updates from Thomas Gleixner: - Remove the redundant CONFIG_GENERIC_TIME_VSYSCALL after converting the remaining users over. - Rework and sanitize the MIPS VDSO handling, so it does not handle the time related VDSO if there is no VDSO capable clocksource available. Also stop mapping VDSO data pages unconditionally even if there is no usage possible. * tag 'timers-vdso-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip: MIPS: VDSO: Fold MIPS_CLOCK_VSYSCALL into MIPS_GENERIC_GETTIMEOFDAY MIPS: VDSO: Gate microMIPS restriction on GCC version MIPS: VDSO: Fold MIPS_DISABLE_VDSO into MIPS_GENERIC_GETTIMEOFDAY clocksource/drivers/mips-gic-timer: Only use VDSO_CLOCKMODE_GIC when it is a available MIPS: csrc-r4k: Only use VDSO_CLOCKMODE_R4K when it is a available MIPS: VDSO: Only map the data pages when the vDSO is used MIPS: Introduce Kconfig MIPS_GENERIC_GETTIMEOFDAY vdso/datastore: Always provide symbol declarations MAINTAINERS: Add include/linux/vdso_datastore.h to vDSO block vdso/gettimeofday: Rename __arch_get_vdso_u_timens_data() vdso/treewide: Drop GENERIC_TIME_VSYSCALL vdso/vsyscall: Gate update_vsyscall() behind CONFIG_GENERIC_GETTIMEOFDAY riscv: vdso: Drop CONFIG_GENERIC_TIME_VSYSCALL guard around syscall fallbacks
2026-06-15Merge tag 'timers-ptp-2026-06-13' of ↵Linus Torvalds
gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip Pull timekeeping updates from Thomas Gleixner: "Updates for NTP/timekeeping and PTP: - Expand timekeeping snapshot mechanisms The various snapshot functions are mostly used for PTP to collect "atomic" snapshots of various involved clocks. They lack support for the recently introduced AUX clocks and do not provide the underlying counter value (e.g. TSC) to user space. Exposing the counter value snapshot allows for better control and steering. Convert the hard wired ktime_get_snapshot() to take a clock ID, which allows the caller to select the clock ID to be captured along with CLOCK_MONONOTONIC_RAW. Additionally capture the underlying hardware counter value and the clock source ID of the counter. Expand the hardware based snapshot capture where devices provide a mechanism to snapshot the hardware PTP clock and the system counter (usually via PCI/PTM) to support AUX clocks and also provide the captured counter value back to the caller and not only the clock timestamps derived from it. - Add a new optional read_snapshot() callback to clocksources That is required to capture atomic snapshots from clocksources which are derived from TSC with a scaling mechanism (e.g. Hyper-V, KVMclock). The value pair is handed back in the snapshot structure to the callers, so they can do the necessary correlations in a more precise way. This touches usage sites of the affected functions and data structure all over the tree, but stays fully backwards compatible for the existing user space exposed interfaces. New PTP IOCTLs will provide access to the extended functionality in later kernel versions" * tag 'timers-ptp-2026-06-13' of gitolite.kernel.org:pub/scm/linux/kernel/git/tip/tip: (28 commits) ptp: vmclock: Use hw_cycles from snapshot for precise TSC pairing x86/kvmclock: Implement read_snapshot() for kvmclock clocksource clocksource/hyperv: Implement read_snapshot() for TSC page clocksource timekeeping: Add clocksource read_snapshot() method and hw_cycles to snapshot ptp: Switch to ktime_get_snapshot_id() for pre/post timestamps timekeeping: Add support for AUX clock cross timestamping timekeeping: Remove system_device_crosststamp::sys_realtime ALSA: hda/common: Use system_device_crosststamp::sys_systime wifi: iwlwifi: Use system_device_crosststamp::sys_systime ptp: Use system_device_crosststamp::sys_systime timekeeping: Prepare for cross timestamps on arbitrary clock IDs timekeeping: Remove ktime_get_snapshot() virtio_rtc: Use provided clock ID for history snapshot net/mlx5: Use provided clock ID for history snapshot igc: Use provided clock ID for history snapshot ice/ptp: Use provided clock ID for history snapshot wifi: iwlwifi: Adopt PTP cross timestamps to core changes timekeeping: Add CLOCK ID to system_device_crosststamp timekeeping: Add system_counterval_t to struct system_device_crosststamp timekeeping: Add CLOCK_AUX support for ktime_get_snapshot_id() ...
2026-06-10clocksource: move NXP timer selection to drivers/clocksourceEnric Balletbo i Serra
The Kconfig logic for selecting the scheduler clocksource on NXP Vybrid (VF610) uses a `choice` block restricted to 32-bit ARM. This prevents 64-bit architectures, such as the NXP S32 family, from enabling the NXP Periodic Interrupt Timer (PIT) driver (CONFIG_NXP_PIT_TIMER). Relocate the NXP clocksource selection from arch/arm/mach-imx/Kconfig to drivers/clocksource/Kconfig. This allows the configuration to be shared across different architectures. Update the selection to include support for ARCH_S32 and add a "None" option restricted to ARCH_S32, since Vybrid lacks the ARM Architected Timer. The Vybrid Global Timer option is restricted to ARCH_MULTI_V7 SOC_VF610 platforms to prevent it from being visible on Cortex-M4 builds, which lack the ARM Global Timer hardware. Fixes: bee33f22d7c3 ("clocksource/drivers/nxp-pit: Add NXP Automotive s32g2 / s32g3 support") Signed-off-by: Enric Balletbo i Serra <eballetb@redhat.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260514-fix-nxp-timer-v3-1-a3e68fdb505e@redhat.com
2026-06-10clocksource/drivers/timer-tegra186: Reserve and service a kernel watchdogKartik Rajput
Tegra SoCs supports multiple watchdog timers. If the kernel crashes or hangs before userspace enables a watchdog, the system cannot recover and may remain bricked, e.g. after a failed OTA update. The driver currently leaves all watchdogs disabled until userspace configures them. Reserve first available watchdog as a kernel-only watchdog for Tegra186 and Tegra234. Arm it during probe (120s timeout) and keep it alive in the driver IRQ handler. Do not register it to userspace. Other available watchdogs remain exposed to userspace. This guarantees the system can reset itself in case of a hang or crash even when userspace never starts. Signed-off-by: Kartik Rajput <kkartik@nvidia.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Link: https://patch.msgid.link/20260507154557.2082697-5-kkartik@nvidia.com
2026-06-10clocksource/drivers/timer-tegra186: Register all accessible watchdog timersKartik Rajput
Tegra186+ SoCs expose multiple watchdog timers, but the driver only registers WDT(0). Iterate over num_wdts and, for each WDT, check the SCR (firewall) registers in the TKE block to determine whether Linux has read and write access. Register the watchdogs that are accessible. Signed-off-by: Kartik Rajput <kkartik@nvidia.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Link: https://patch.msgid.link/20260507154557.2082697-4-kkartik@nvidia.com
2026-06-10clocksource/drivers/timer-tegra186: Correct num_wdts for Tegra186 and Tegra234Kartik Rajput
On Tegra186 and Tegra234, WDT2 is connected to the Audio Processing Engine (APE) and cannot be accessed from Linux. Only WDT0 and WDT1 are accessible to Linux. Update num_wdts from 3 to 2 for both Tegra186 and Tegra234 to reflect the actual number of watchdogs available to Linux. Signed-off-by: Kartik Rajput <kkartik@nvidia.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Link: https://patch.msgid.link/20260507154557.2082697-3-kkartik@nvidia.com
2026-06-10clocksource/drivers/timer-tegra186: Fix support for multiple watchdog instancesKartik Rajput
Tegra SoCs support multiple watchdogs; currently only one (WDT0) is used. When multiple watchdogs are registered, tegra186_wdt_enable() overwrites the TKEIE(x) register, discarding any existing watchdog interrupt enable bits. As a result, enabling one watchdog inadvertently disables interrupts for the others. Fix this by preserving the existing TKEIE(x) value and updating it using a read-modify-write sequence. Fixes: 42cee19a9f83 ("clocksource: Add Tegra186 timers support") Cc: stable@vger.kernel.org Signed-off-by: Kartik Rajput <kkartik@nvidia.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Link: https://patch.msgid.link/20260507154557.2082697-2-kkartik@nvidia.com
2026-06-09clocksource/drivers/mips-gic-timer: Only use VDSO_CLOCKMODE_GIC when it is a ↵Thomas Weißschuh
available VDSO_CLOCKMODE_GIC is only defined if CONFIG_GENERIC_GETTIMEOFDAY is enabled. Right now this is always the case, but it will change soon. Prepare for the potential unavailability of VDSO_CLOCKMODE_GIC. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Link: https://patch.msgid.link/20260521-vdso-mips-kconfig-v1-6-2f79dcd6c78f@linutronix.de
2026-06-05clocksource/hyperv: Implement read_snapshot() for TSC page clocksourceDavid Woodhouse
Implement the read_snapshot() callback for the Hyper-V TSC page clock- source. This returns the derived 10MHz reference time (for timekeeping) while also providing the raw TSC value that was used to compute it. When the TSC page is valid, hv_read_tsc_page_tsc() atomically captures both values from a single RDTSC inside the sequence-counter protected read. When the TSC page is invalid (sequence == 0), the hw_csid and hw_cycles are set to zero indicating no value is available. This enables ktime_get_snapshot_id() to provide the raw TSC to consumers like KVM's master clock when running nested guests under Hyper-V. Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Assisted-by: Kiro:claude-opus-4.6-1m Reviewed-by: Michael Kelley <mhklinux@outlook.com> Link: https://patch.msgid.link/20260604095755.64849-2-dwmw2@infradead.org
2026-06-03clocksource/drivers/timer-ti-dm: Add clockevent supportMarkus Schneider-Pargmann (TI)
Add support for using the TI Dual-Mode Timer for clockevents. The second always on device with the "ti,timer-alwon" property is selected to be used for clockevents. The first one is used as clocksource. This allows clockevents to be setup independently of the CPU. Signed-off-by: Markus Schneider-Pargmann (TI) <msp@baylibre.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Link: https://patch.msgid.link/20260508-topic-ti-dm-clkevt-v6-16-v5-3-61d546a0aff9@baylibre.com
2026-06-03clocksource/drivers/timer-ti-dm: Add clocksource supportMarkus Schneider-Pargmann (TI)
Add support for using the TI Dual-Mode Timer as a clocksource. The driver automatically picks the first timer that is marked as always-on on with the "ti,timer-alwon" property to be the clocksource. The timer can then be used for CPU independent time keeping. Signed-off-by: Markus Schneider-Pargmann (TI) <msp@baylibre.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Link: https://patch.msgid.link/20260508-topic-ti-dm-clkevt-v6-16-v5-2-61d546a0aff9@baylibre.com
2026-06-03clocksource/drivers/timer-ti-dm: Fix property name in commentMarkus Schneider-Pargmann (TI)
ti,always-on property doesn't exist. ti,timer-alwon is meant here. Fix this minor bug in the comment. Signed-off-by: Markus Schneider-Pargmann (TI) <msp@baylibre.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Reviewed-by: Kevin Hilman <khilman@baylibre.com> Reviewed-by: Dhruva Gole <d-gole@ti.com> Link: https://patch.msgid.link/20260508-topic-ti-dm-clkevt-v6-16-v5-1-61d546a0aff9@baylibre.com
2026-06-03clocksource/drivers/arm_arch_timer: Default to EL2 virtual timer when ↵Marc Zyngier
running VHE When running with at EL2 with VHE enabled, the architecture provides two EL2 timer/counters, dubbed physical and virtual. Apart from their names, they are strictly identical. However, they don't get virtualised the same way, specially when it comes to adding arbitrary offsets to the timers. When running as a guest, the host CNTVOFF_EL2 does apply to the guest's view of CNTHV*_El2. This is not true for CNTPOFF_EL2 and CNTHP*_EL2, as the architecture is broken past the first level of virtualisation (it lacks some essential mechanisms to be usable, despite what the ARM ARM pretends). This means that when running as a L2 guest hypervisor, using the physical timer results in traps to L0, which are then forwarded to L1 in order to emulate the offset, leading to even worse performance due to massive trap amplification (the combination of register and ERET trapping is absolutely lethal). Switch the arch timer code to using the virtual timer when running in VHE by default, only using the physical timer if the interrupt is not correctly described in the firmware tables (which seems to be an unfortunately common case). This comes as no impact on bare-metal, and slightly improves the situation in the virtualised case. Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Link: https://patch.msgid.link/20260523140242.586031-4-maz@kernel.org
2026-05-06clocksource/drivers/sun5i: Add D1 hstimer supportMichal Piekos
D1 high speed timer differs from existing timer-sun5i by register base offset. Add sunxi quirks to handle D1 specific offset. Add D1 compatible string to OF match table. Signed-off-by: Michal Piekos <michal.piekos@mmpsystems.pl> Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Reviewed-by: Chen-Yu Tsai <wens@kernel.org> Link: https://patch.msgid.link/20260428-h616-t113s-hstimer-v3-2-7e02178a93ee@mmpsystems.pl
2026-04-20Merge branch into tip/master: 'timers/clocksource'Ingo Molnar
# New commits in timers/clocksource: 68ed094971b0 ("clocksource/drivers/timer-of: Make the code compatible with modules") 2423405880c2 ("clocksource/drivers/mmio: Make the code compatible with modules") fed9f727cc3f ("clocksource/drivers/sun5i: Handle error returns from devm_reset_control_get_optional_exclusive()") 045a9dac7eb7 ("clocksource/drivers/timer-rtl-otto: Make rttm_cs variable static") b385caf91868 ("dt-bindings: timer: fsl,imxgpt: add compatible string fsl,imx25-epit") Signed-off-by: Ingo Molnar <mingo@kernel.org>
2026-04-03clocksource/drivers/timer-of: Make the code compatible with modulesDaniel Lezcano
The next changes will bring the module support on the timer drivers. Those use the API exported by the timer-of which are not exporting their symbols. Fix that by adding EXPORT_SYMBOL_GPL(). Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Link: https://patch.msgid.link/20260327180600.8150-4-daniel.lezcano@kernel.org
2026-04-03clocksource/drivers/mmio: Make the code compatible with modulesDaniel Lezcano
The next changes will bring the module support on the timer drivers. Those use the API exported by the mmio clocksource which are not exporting their symbols. Fix that by adding EXPORT_SYMBOL_GPL(). Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org> Acked-by: John Stultz <jstultz@google.com> Link: https://patch.msgid.link/20260327180600.8150-3-daniel.lezcano@kernel.org