From c793bbfc4a0a9f5a66978fc91559e9681748dbeb Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Tue, 18 Aug 2026 00:14:57 +0200 Subject: [PATCH 1/2] timer: Keep debugobjects state consistent in migrate_timer_list() When timers are migrated away from an offline CPU the debugobjects state gets corrupted. The timer is accounted as inactive on deletion, but the enqueue on the alive CPU lacks the activation call. That used to work, but got broken when the trace point and the debug objects call got separated. That change missed to fixup migrate_timer_list(). Add the missing debug_timer_activate() invocation to fix it. Fixes: dc1e7dc5ac62 ("timer: Move trace point to get proper index") Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://patch.msgid.link/87bjb0l7ha.ffs@fw13 --- kernel/time/timer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 655a8c6cd84d..ae9abf14688e 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -2492,6 +2492,7 @@ static void migrate_timer_list(struct timer_base *new_base, struct hlist_head *h timer = hlist_entry(head->first, struct timer_list, entry); detach_timer(timer, false); timer->flags = (timer->flags & ~TIMER_BASEMASK) | cpu; + debug_timer_activate(timer); internal_add_timer(new_base, timer); } } From e1e3a0ab69c64eedaf53dce9306f8a090bf038f0 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Wed, 19 Aug 2026 14:43:21 -0700 Subject: [PATCH 2/2] ARM: Fix get_cycles() after delay_read_timer() conversion After commit dfc256dac54c ("calibrate: Rework delay timer calibration"), certain ARM configurations (such as multi_v5_defconfig) hang during boot. The use of read_current_timer() in arch/arm's get_cycles() was improperly converted to delay_read_timer(), resulting in get_cycles() returning 0 even when the timer has been read or an uninitialized stack value when delay_read_timer() returns false. Flip the branches of the ternary condition to fix get_cycles(). Fixes: dfc256dac54c ("calibrate: Rework delay timer calibration") Signed-off-by: Nathan Chancellor Signed-off-by: Thomas Gleixner Reviewed-by: Jinjie Ruan Cc: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org Link: https://patch.msgid.link/20260819-fix-arm-get_cycles-v1-1-208bf07ac540@kernel.org --- arch/arm/include/asm/timex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/include/asm/timex.h b/arch/arm/include/asm/timex.h index 94e40c19cfc5..4d31eab9dba2 100644 --- a/arch/arm/include/asm/timex.h +++ b/arch/arm/include/asm/timex.h @@ -13,7 +13,7 @@ typedef unsigned long cycles_t; // 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 get_cycles() ({ cycles_t c; delay_read_timer(&c) ? c : 0; }) #define random_get_entropy() (((unsigned long)get_cycles()) ?: random_get_entropy_fallback()) #endif