From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D59033120D; Sat, 7 Feb 2026 15:43:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770479027; cv=none; b=j2jjM9nb4xpoRflu7m+dj1U2xgzDXeWKtJwEeDExHLzWo5eT80hwee0u9TLB7MD/9NXoR2UFym9spxegBRqUanT0Cx0em36WuE2Ty86XCC9/E4BLn31gUfAHyf5GlzG8T1LtboSefT9WMJB26c9lxXLn2h47HSXi0Jke5RzKrNU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770479027; c=relaxed/simple; bh=V+QnxiS+m0NcQZxOeg1xO4Hkndp8MYNjmoVQMgC+7ho=; h=Subject:To:Cc:From:Date:In-Reply-To:Message-ID:MIME-Version: Content-Type; b=htVNLs3OGrdk2gopL65bNy+wOGO8rU5OXiZtMEa/ELX83Li+iEu6BITETPpAjb0g7Z5kelDTIoeLHWCBqnPpRUHum0wyLUtyLccmZBMgii2l0smAQ78+NjPMgoBBB1XNaFc+3aqF+Wbnb+hm/Lh62Rd3MxEoAnImBOd2Hum/U4A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=a+xZOu6/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="a+xZOu6/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4503C116D0; Sat, 7 Feb 2026 15:43:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770479027; bh=V+QnxiS+m0NcQZxOeg1xO4Hkndp8MYNjmoVQMgC+7ho=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=a+xZOu6/NJh22pQI6oY0pIdWcf4l5225yVrxUzsx4/K20pjSmIPtanT5e5L7V7AFA r05H8KTarmZqDqjl1AqDd2+jBKwynO4roSrT/tk6SNSeU3l6NxrXvmL5YaNDW5iAFv 3RGnCdQyFotvweXP0Rm1t7VLfcme+RGPLEn9XOKY= Subject: Patch "timers: Replace BUG_ON()s" has been added to the 5.15-stable tree To: Julia.Lawall@inria.fr,aha310510@gmail.com,akpm@linux-foundation.org,anna-maria@linutronix.de,arnd@arndb.de,gregkh@linuxfoundation.org,jacob.e.keller@intel.com,linux-staging@lists.linux.dev,linux@roeck-us.net,luiz.dentz@gmail.com,marcel@holtmann.org,maz@kernel.org,peterz@infradead.org,rostedt@goodmis.org,sboyd@kernel.org,tglx@linutronix.de,viresh.kumar@linaro.org Cc: From: Date: Sat, 07 Feb 2026 16:43:04 +0100 In-Reply-To: <20251128160539.358938-7-aha310510@gmail.com> Message-ID: <2026020704-system-dinner-7909@gregkh> Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit X-stable: commit X-Patchwork-Hint: ignore This is a note to let you know that I've just added the patch titled timers: Replace BUG_ON()s to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: timers-replace-bug_on-s.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From stable+bounces-197608-greg=kroah.com@vger.kernel.org Fri Nov 28 17:08:07 2025 From: Jeongjun Park Date: Sat, 29 Nov 2025 01:05:31 +0900 Subject: timers: Replace BUG_ON()s To: stable@vger.kernel.org Cc: gregkh@linuxfoundation.org, tglx@linutronix.de, Julia.Lawall@inria.fr, akpm@linux-foundation.org, anna-maria@linutronix.de, arnd@arndb.de, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, linux@roeck-us.net, luiz.dentz@gmail.com, marcel@holtmann.org, maz@kernel.org, peterz@infradead.org, rostedt@goodmis.org, sboyd@kernel.org, viresh.kumar@linaro.org, aha310510@gmail.com, linux-staging@lists.linux.dev, Jacob Keller Message-ID: <20251128160539.358938-7-aha310510@gmail.com> From: Thomas Gleixner [ Upstream commit 82ed6f7ef58f9634fe4462dd721902c580f01569 ] The timer code still has a few BUG_ON()s left which are crashing the kernel in situations where it still can recover or simply refuse to take an action. Remove the one in the hotplug callback which checks for the CPU being offline. If that happens then the whole hotplug machinery will explode in colourful ways. Replace the rest with WARN_ON_ONCE() and conditional returns where appropriate. Signed-off-by: Thomas Gleixner Tested-by: Guenter Roeck Reviewed-by: Jacob Keller Reviewed-by: Anna-Maria Behnsen Link: https://lore.kernel.org/r/20221123201624.769128888@linutronix.de Signed-off-by: Jeongjun Park Signed-off-by: Greg Kroah-Hartman --- kernel/time/timer.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1155,7 +1155,8 @@ EXPORT_SYMBOL(timer_reduce); */ void add_timer(struct timer_list *timer) { - BUG_ON(timer_pending(timer)); + if (WARN_ON_ONCE(timer_pending(timer))) + return; __mod_timer(timer, timer->expires, MOD_TIMER_NOTPENDING); } EXPORT_SYMBOL(add_timer); @@ -1174,7 +1175,8 @@ void add_timer_on(struct timer_list *tim struct timer_base *new_base, *base; unsigned long flags; - BUG_ON(timer_pending(timer) || !timer->function); + if (WARN_ON_ONCE(timer_pending(timer) || !timer->function)) + return; new_base = get_timer_cpu_base(timer->flags, cpu); @@ -1995,8 +1997,6 @@ int timers_dead_cpu(unsigned int cpu) struct timer_base *new_base; int b, i; - BUG_ON(cpu_online(cpu)); - for (b = 0; b < NR_BASES; b++) { old_base = per_cpu_ptr(&timer_bases[b], cpu); new_base = get_cpu_ptr(&timer_bases[b]); @@ -2013,7 +2013,8 @@ int timers_dead_cpu(unsigned int cpu) */ forward_timer_base(new_base); - BUG_ON(old_base->running_timer); + WARN_ON_ONCE(old_base->running_timer); + old_base->running_timer = NULL; for (i = 0; i < WHEEL_SIZE; i++) migrate_timer_list(new_base, old_base->vectors + i); Patches currently in stable-queue which might be from aha310510@gmail.com are queue-5.15/timers-update-the-documentation-to-reflect-on-the-new-timer_shutdown-api.patch queue-5.15/clocksource-drivers-arm_arch_timer-do-not-use-timer-namespace-for-timer_shutdown-function.patch queue-5.15/timers-split-del_timer-to-prepare-for-shutdown-mode.patch queue-5.15/arm-spear-do-not-use-timer-namespace-for-timer_shutdown-function.patch queue-5.15/timers-add-shutdown-mechanism-to-the-internal-functions.patch queue-5.15/timers-provide-timer_shutdown.patch queue-5.15/timers-rename-del_timer-to-timer_delete.patch queue-5.15/timers-replace-bug_on-s.patch queue-5.15/bluetooth-hci_qca-fix-the-teardown-problem-for-real.patch queue-5.15/documentation-replace-del_timer-del_timer_sync.patch queue-5.15/documentation-remove-bogus-claim-about-del_timer_sync.patch queue-5.15/timers-silently-ignore-timers-with-a-null-function.patch queue-5.15/timers-get-rid-of-del_singleshot_timer_sync.patch queue-5.15/clocksource-drivers-sp804-do-not-use-timer-namespace-for-timer_shutdown-function.patch