From: Lukas Wunner Date: Fri, 15 Sep 2023 07:55:39 +0000 (+0200) Subject: panic: Reenable preemption in WARN slowpath X-Git-Tag: v6.1.61~873 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=038249ee7264b331d6161f315257a4058f00f265;p=platform%2Fkernel%2Flinux-starfive.git panic: Reenable preemption in WARN slowpath [ Upstream commit cccd32816506cbac3a4c65d9dff51b3125ef1a03 ] Commit: 5a5d7e9badd2 ("cpuidle: lib/bug: Disable rcu_is_watching() during WARN/BUG") amended warn_slowpath_fmt() to disable preemption until the WARN splat has been emitted. However the commit neglected to reenable preemption in the !fmt codepath, i.e. when a WARN splat is emitted without additional format string. One consequence is that users may see more splats than intended. E.g. a WARN splat emitted in a work item results in at least two extra splats: BUG: workqueue leaked lock or atomic (emitted by process_one_work()) BUG: scheduling while atomic (emitted by worker_thread() -> schedule()) Ironically the point of the commit was to *avoid* extra splats. ;) Fix it. Fixes: 5a5d7e9badd2 ("cpuidle: lib/bug: Disable rcu_is_watching() during WARN/BUG") Signed-off-by: Lukas Wunner Signed-off-by: Ingo Molnar Cc: Linus Torvalds Cc: Thomas Gleixner Cc: Paul E. McKenney Link: https://lore.kernel.org/r/3ec48fde01e4ee6505f77908ba351bad200ae3d1.1694763684.git.lukas@wunner.de Signed-off-by: Sasha Levin --- diff --git a/kernel/panic.c b/kernel/panic.c index ca5452a..63e94f3 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -695,6 +695,7 @@ void warn_slowpath_fmt(const char *file, int line, unsigned taint, if (!fmt) { __warn(file, line, __builtin_return_address(0), taint, NULL, NULL); + warn_rcu_exit(rcu); return; }