From nobody Fri Apr 3 12:48:45 2026 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E63334A3DA for ; Thu, 19 Feb 2026 17:13:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771521223; cv=none; b=fzwHHnsfiHPDB/KWvfyT25blp/Z8RvkMPMIECKZh5aqyglZS8Gv5x7bUaKOei3umPYudlW9bpNDsa03p0lqa7cA2BQ3W299F/8sZA6ov6uaYa9LwifjBw7Ff4aL7ILU4t71uLUBkkGshduRmuriQ6uzkgPg89KqbNh83V1zeoME= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771521223; c=relaxed/simple; bh=p4TRIPhh7eCXg4oL8eEB5Ly0L/lmhP7XDzG06yVs7As=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=e38tPazKo6bK4bkwHAMgo3QrTWRNncousEypW383vjybWnoTuMTROr2efxXxASs3rLf5ttdtLr4yZmIlxnLsjeTJRzmWEGCt+FnITDDqr2QY37BHnf5n8+NBlgsLQLhPL9Ud1Qp84IGmKupHZGo+MiOc8g+sEMmooR7KUHQNO/0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FKrlFlES; arc=none smtp.client-ip=209.85.210.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FKrlFlES" Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-823c56765fdso560949b3a.1 for ; Thu, 19 Feb 2026 09:13:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771521220; x=1772126020; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pWjvp+vOFGL8T/NXTev+NZf62jPu9HyIJqL4GkC+d9Y=; b=FKrlFlES6e6BGVghY8oWZK3LyO/CF2mkwPfSWj/5/7ziUBrV/6mOMLEE4QxJhCxaTH rYroFZ7raOj9l3ErtFIcEsYuf9wEeRGhKYtOGGPtYx03vQTwlWZ2qQLisyp9oblOJgmB nsBL3dek3d9pUUCuJui1cgLaAZFn+rH8uAHED239238h1tkqfP+c/OblFrIFd7cz/PbN 6wHvW+KpCBtAqEIgEVMMjfwfw5yNViW9z70tJ6nNTQ2EMAUq7Mn8Sgzg8cnjTylhvOTj +NpxcrorjQkmpHvYV6nlX0NQs6Mig/akS0/zKWfu2fVGPpKj5HKGNkrqW52dPflxiVvf WnQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771521220; x=1772126020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=pWjvp+vOFGL8T/NXTev+NZf62jPu9HyIJqL4GkC+d9Y=; b=YTiFym0wK9RIVzL9K3C8XAXsqm6UQdxSZw38CMV1Tu+rH1gCMCzSU8xbP+VQchKcXD FO4Xbk7jnhEQaV6y2NQ1D1/+0/B0loRGKGl7rcBAHV78+S1lnJx6oSU5TcYsbuQVh4JR 2bf72BD3quhb+LznYAR7kqiZVMyVha2aJ6R8XB6GgIs8NZx++m8YxHwArgaT6jCK/pe0 R3D5nUVtghYQD//iaOBZqMwQei8Bb7tEZdm7XvMZl6LaWGOE2EtCzt/s8Tvo3VXxPaxf TbllSg3wE8z15097NCYYUcFjoBuPqW+GHhmZ2VMNMItFZICknt/JsOTT5wrPjmqooe1/ doRg== X-Forwarded-Encrypted: i=1; AJvYcCWdgXSBgpbhRpCxpHRc1h+yMqFChls2SU27xH0boX8Ur6vX6KvACopzz/v62YEb3SaqeOCgvVpbJyl76lg=@vger.kernel.org X-Gm-Message-State: AOJu0YwOUuXoR7Oi4Hxh5+ZbsHp6eDasL2PqS/mlH9ifCHWVvd+Ix4Tl GC8l5mdNWImrZWSXdxKFN6X0wx1E5598Np7j4aeNXR+ns/GxFHzwQhj2 X-Gm-Gg: AZuq6aLHPOd76FuKWCu1ZOPy+EWiouLlT2iJqsN0bf6E9ghq4szv0YMFa1Ay/7pDI23 T8GBUuGT6pZwZLuY1DIj7ZkhnsI783x56ieQ2GugL7M6mm7FsCu/fjOvASxPat2yCLp22AcaZyk GF+2pNjaB242BsvilQbSK5LXpmS02y/wlDV7VuQZhgjbT4xqlWCAdFzW5OZ6ih6Aa16JPU4ezPW Qq+3QTjYOwtT2iyCPRAEjThesC6aRaDmcZH4WsBSUbr9sUYibe8DJ1id7KEo2FKal1SCS4nUHr7 FOYHv4xcgX4GuwfNxHGdd2XfxgtysDdDR7dIehb4EbDAdZ2ZPm/KHbdK/pZRTcE+ZyZvVgxVwVO FfRKjolVFF5K/kiyhIn5o7IPMuSaCQTTiYJPDUX78gBjwSXoGcHLoFrAyGoDCtQJ4gI8F5NqCu3 lu5zTFLdkH7ZbcsOG0ShoZ0gJLxpXWwuSd8A0ZxJFkF0r74aau/A== X-Received: by 2002:a05:6a21:330b:b0:394:6023:a0f2 with SMTP id adf61e73a8af0-394fc21a2d7mr5528099637.21.1771521220510; Thu, 19 Feb 2026 09:13:40 -0800 (PST) Received: from name2965-Precision-7820-Tower.. ([121.185.236.165]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c6e532fa2e5sm15895002a12.26.2026.02.19.09.13.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Feb 2026 09:13:39 -0800 (PST) From: Jeongjun Park 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, zouyipeng@huawei.com, aha310510@gmail.com, linux-staging@lists.linux.dev, Jacob Keller Subject: [PATCH 5.10.y 06/15] timers: Replace BUG_ON()s Date: Fri, 20 Feb 2026 02:13:01 +0900 Message-Id: <20260219171310.118170-7-aha310510@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260219171310.118170-1-aha310510@gmail.com> References: <20260219171310.118170-1-aha310510@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- kernel/time/timer.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index e09852be4e63..7094b916c854 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1208,7 +1208,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); @@ -1227,7 +1228,8 @@ void add_timer_on(struct timer_list *timer, int cpu) struct timer_base *new_base, *base; unsigned long flags; =20 - BUG_ON(timer_pending(timer) || !timer->function); + if (WARN_ON_ONCE(timer_pending(timer) || !timer->function)) + return; =20 new_base =3D get_timer_cpu_base(timer->flags, cpu); =20 @@ -2047,8 +2049,6 @@ int timers_dead_cpu(unsigned int cpu) struct timer_base *new_base; int b, i; =20 - BUG_ON(cpu_online(cpu)); - for (b =3D 0; b < NR_BASES; b++) { old_base =3D per_cpu_ptr(&timer_bases[b], cpu); new_base =3D get_cpu_ptr(&timer_bases[b]); @@ -2065,7 +2065,8 @@ int timers_dead_cpu(unsigned int cpu) */ forward_timer_base(new_base); =20 - BUG_ON(old_base->running_timer); + WARN_ON_ONCE(old_base->running_timer); + old_base->running_timer =3D NULL; =20 for (i =3D 0; i < WHEEL_SIZE; i++) migrate_timer_list(new_base, old_base->vectors + i); --