From: Greg Kroah-Hartman Date: Tue, 21 Apr 2026 07:44:41 +0000 (+0200) Subject: 7.0-stable patches X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;h=HEAD;p=thirdparty%2Fkernel%2Fstable-queue.git 7.0-stable patches added patches: clockevents-add-missing-resets-of-the-next_event_forced-flag.patch --- diff --git a/queue-7.0/clockevents-add-missing-resets-of-the-next_event_forced-flag.patch b/queue-7.0/clockevents-add-missing-resets-of-the-next_event_forced-flag.patch new file mode 100644 index 0000000000..e44c934f6a --- /dev/null +++ b/queue-7.0/clockevents-add-missing-resets-of-the-next_event_forced-flag.patch @@ -0,0 +1,78 @@ +From stable+bounces-240041-greg=kroah.com@vger.kernel.org Tue Apr 21 08:29:11 2026 +From: Thomas Gleixner +Date: Tue, 21 Apr 2026 08:26:19 +0200 +Subject: clockevents: Add missing resets of the next_event_forced flag +To: Sasha Levin , patches@lists.linux.dev, stable@vger.kernel.org +Cc: Calvin Owens , Borislav Petkov , Sasha Levin , fweisbec@gmail.com, mingo@kernel.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org +Message-ID: <87jyu0de2c.ffs@tglx> + +From: Thomas Gleixner + +commit 4096fd0e8eaea13ebe5206700b33f49635ae18e5 upstream. + +The prevention mechanism against timer interrupt starvation missed to reset +the next_event_forced flag in a couple of places: + + - When the clock event state changes. That can cause the flag to be + stale over a shutdown/startup sequence + + - When a non-forced event is armed, which then prevents rearming before + that event. If that event is far out in the future this will cause + missed timer interrupts. + + - In the suspend wakeup handler. + +That led to stalls which have been reported by several people. + +Add the missing resets, which fixes the problems for the reporters. + +Fixes: d6e152d905bd ("clockevents: Prevent timer interrupt starvation") +Reported-by: Hanabishi +Reported-by: Eric Naim +Signed-off-by: Thomas Gleixner +Tested-by: Hanabishi +Tested-by: Eric Naim +Cc: stable@vger.kernel.org +Closes: https://lore.kernel.org/68d1e9ac-2780-4be3-8ee3-0788062dd3a4@gmail.com +Link: https://patch.msgid.link/87340xfeje.ffs@tglx + +Signed-off-by: Greg Kroah-Hartman +--- + kernel/time/clockevents.c | 7 ++++++- + kernel/time/tick-broadcast.c | 1 + + 2 files changed, 7 insertions(+), 1 deletion(-) + +--- a/kernel/time/clockevents.c ++++ b/kernel/time/clockevents.c +@@ -94,6 +94,9 @@ static int __clockevents_switch_state(st + if (dev->features & CLOCK_EVT_FEAT_DUMMY) + return 0; + ++ /* On state transitions clear the forced flag unconditionally */ ++ dev->next_event_forced = 0; ++ + /* Transition with new state-specific callbacks */ + switch (state) { + case CLOCK_EVT_STATE_DETACHED: +@@ -332,8 +335,10 @@ int clockevents_program_event(struct clo + if (delta > (int64_t)dev->min_delta_ns) { + delta = min(delta, (int64_t) dev->max_delta_ns); + clc = ((unsigned long long) delta * dev->mult) >> dev->shift; +- if (!dev->set_next_event((unsigned long) clc, dev)) ++ if (!dev->set_next_event((unsigned long) clc, dev)) { ++ dev->next_event_forced = 0; + return 0; ++ } + } + + if (dev->next_event_forced) +--- a/kernel/time/tick-broadcast.c ++++ b/kernel/time/tick-broadcast.c +@@ -108,6 +108,7 @@ static struct clock_event_device *tick_g + + static void tick_oneshot_wakeup_handler(struct clock_event_device *wd) + { ++ wd->next_event_forced = 0; + /* + * If we woke up early and the tick was reprogrammed in the + * meantime then this may be spurious but harmless. diff --git a/queue-7.0/series b/queue-7.0/series index 46d6384207..9561002198 100644 --- a/queue-7.0/series +++ b/queue-7.0/series @@ -74,3 +74,4 @@ nilfs2-fix-null-i_assoc_inode-dereference-in-nilfs_mdt_save_to_shadow_map.patch media-vidtv-fix-pass-by-value-structs-causing-msan-warnings.patch media-hackrf-fix-to-not-free-memory-after-the-device-is-registered-in-hackrf_probe.patch mm-userfaultfd-fix-hugetlb-fault-mutex-hash-calculation.patch +clockevents-add-missing-resets-of-the-next_event_forced-flag.patch