From 8ae119f6f253112e56358951304e43150628fa27 Mon Sep 17 00:00:00 2001 From: Micha L Date: Sun, 9 Feb 2025 21:56:32 -0800 Subject: [PATCH] ANDROID: hrtimers: revert mismerged commit in 6.1.127 LTS merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.1.127 includes commit "hrtimers: Handle CPU state correctly on hotplug". This commit is supposed to fix "hrtimers: Push pending hrtimers away from outgoing CPU earlier". However commit "hrtimers: Push pending hrtimers away from outgoing CPU earlier" was reverted earlier on 6.1-lts. 6.1.127 incorrectly merged parts of "hrtimers: Handle CPU state correctly on hotplug", which leads to random reboots. Let´s revert those parts. Fixes: 79f1b689da71 ("Merge 6.1.127 into android14-6.1-lts") Change-Id: Ieb5e3910d631034eb8d4376c6f5a8e9751cae936 Signed-off-by: Micha Lechner Signed-off-by: Greg Kroah-Hartman --- include/linux/hrtimer.h | 1 - kernel/time/hrtimer.c | 11 +---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 93f8cff313b9..f5d43920ecd6 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -533,7 +533,6 @@ extern void __init hrtimers_init(void); extern void sysrq_timer_list_show(void); int hrtimers_prepare_cpu(unsigned int cpu); -int hrtimers_cpu_starting(unsigned int cpu); #ifdef CONFIG_HOTPLUG_CPU int hrtimers_dead_cpu(unsigned int cpu); #else diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 36a49f5c66bb..348237258613 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -2176,15 +2176,6 @@ int hrtimers_prepare_cpu(unsigned int cpu) } cpu_base->cpu = cpu; - hrtimer_cpu_base_init_expiry_lock(cpu_base); - return 0; -} - -int hrtimers_cpu_starting(unsigned int cpu) -{ - struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases); - - /* Clear out any left over state from a CPU down operation */ cpu_base->active_bases = 0; cpu_base->hres_active = 0; cpu_base->hang_detected = 0; @@ -2192,6 +2183,7 @@ int hrtimers_cpu_starting(unsigned int cpu) cpu_base->softirq_next_timer = NULL; cpu_base->expires_next = KTIME_MAX; cpu_base->softirq_expires_next = KTIME_MAX; + hrtimer_cpu_base_init_expiry_lock(cpu_base); return 0; } @@ -2277,7 +2269,6 @@ int hrtimers_dead_cpu(unsigned int scpu) void __init hrtimers_init(void) { hrtimers_prepare_cpu(smp_processor_id()); - hrtimers_cpu_starting(smp_processor_id()); open_softirq(HRTIMER_SOFTIRQ, hrtimer_run_softirq); }