]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
7.0-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Apr 2026 07:44:41 +0000 (09:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Apr 2026 07:44:41 +0000 (09:44 +0200)
added patches:
clockevents-add-missing-resets-of-the-next_event_forced-flag.patch

queue-7.0/clockevents-add-missing-resets-of-the-next_event_forced-flag.patch [new file with mode: 0644]
queue-7.0/series

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 (file)
index 0000000..e44c934
--- /dev/null
@@ -0,0 +1,78 @@
+From stable+bounces-240041-greg=kroah.com@vger.kernel.org Tue Apr 21 08:29:11 2026
+From: Thomas Gleixner <tglx@kernel.org>
+Date: Tue, 21 Apr 2026 08:26:19 +0200
+Subject: clockevents: Add missing resets of the next_event_forced flag
+To: Sasha Levin <sashal@kernel.org>, patches@lists.linux.dev, stable@vger.kernel.org
+Cc: Calvin Owens <calvin@wbinvd.org>, Borislav Petkov <bp@alien8.de>, Sasha Levin <sashal@kernel.org>, fweisbec@gmail.com, mingo@kernel.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org
+Message-ID: <87jyu0de2c.ffs@tglx>
+
+From: Thomas Gleixner <tglx@kernel.org>
+
+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 <i.r.e.c.c.a.k.u.n+kernel.org@gmail.com>
+Reported-by: Eric Naim <dnaim@cachyos.org>
+Signed-off-by: Thomas Gleixner <tglx@kernel.org>
+Tested-by: Hanabishi <i.r.e.c.c.a.k.u.n+kernel.org@gmail.com>
+Tested-by: Eric Naim <dnaim@cachyos.org>
+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 <gregkh@linuxfoundation.org>
+---
+ 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.
index 46d63842078636982adae6ba9dfb3ddd74f324aa..95610021981b4738015a03c339a430cf6e91f6bc 100644 (file)
@@ -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