From: John Ogness <john.ogness@linutronix.de>
To: Petr Mladek <pmladek@suse.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
Steven Rostedt <rostedt@goodmis.org>,
Ryan Roberts <ryan.roberts@arm.com>,
Breno Leitao <leitao@debian.org>,
printk@lists.linux.dev, linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Rio <rioo.tsukatsukii@gmail.com>,
Aaron Tomlin <atomlin@atomlin.com>,
Bradley Morgan <brads@mainlining.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Alessandro Carminati <acarmina@redhat.com>,
Randy Dunlap <rdunlap@infradead.org>,
Pnina Feder <pnina.feder@mobileye.com>,
Petr Pavlu <petr.pavlu@suse.com>
Subject: [PATCH printk 4/6] printk: Remove nbcon_atomic_flush_unsafe()
Date: Mon, 9 Nov 2026 13:37:21 +0106 [thread overview]
Message-ID: <20261109123127.489676-5-john.ogness@linutronix.de> (raw)
In-Reply-To: <20261109123127.489676-1-john.ogness@linutronix.de>
There is no need for the special function nbcon_atomic_flush_unsafe(),
which is only called at the end of panic(). Its functionality is
replaced with printk_trigger_flush(PR_FLUSH_HANG).
Signed-off-by: John Ogness <john.ogness@linutronix.de>
---
include/linux/printk.h | 5 -----
kernel/panic.c | 2 +-
kernel/printk/nbcon.c | 12 ------------
3 files changed, 1 insertion(+), 18 deletions(-)
diff --git a/include/linux/printk.h b/include/linux/printk.h
index c669497bd3378..1c8947fc46411 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -225,7 +225,6 @@ void console_try_replay_all(void);
void printk_legacy_allow_panic_sync(void);
extern bool nbcon_device_try_acquire(struct console *con);
extern void nbcon_device_release(struct console *con);
-void nbcon_atomic_flush_unsafe(void);
bool pr_flush(int timeout_ms, bool reset_on_progress);
#else
static inline __printf(1, 0)
@@ -336,10 +335,6 @@ static inline void nbcon_device_release(struct console *con)
{
}
-static inline void nbcon_atomic_flush_unsafe(void)
-{
-}
-
static inline bool pr_flush(int timeout_ms, bool reset_on_progress)
{
return true;
diff --git a/kernel/panic.c b/kernel/panic.c
index a4dbb6b8cd2bf..7c03a17ba1288 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -765,7 +765,7 @@ void vpanic(const char *fmt, va_list args)
* Explicitly flush the kernel log buffer one last time.
*/
console_flush_on_panic(CONSOLE_FLUSH_PENDING);
- nbcon_atomic_flush_unsafe();
+ printk_trigger_flush(PR_FLUSH_HANG);
local_irq_enable();
for (i = 0; ; i += PANIC_TIMER_STEP) {
diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c
index 513bfd399858c..0c832e33a8f2c 100644
--- a/kernel/printk/nbcon.c
+++ b/kernel/printk/nbcon.c
@@ -1739,18 +1739,6 @@ void nbcon_atomic_flush_pending(enum pr_flush_reason reason)
__nbcon_atomic_flush_pending(reason, prb_next_reserve_seq(prb));
}
-/**
- * nbcon_atomic_flush_unsafe - Flush all nbcon consoles using their
- * write_atomic() callback and allowing unsafe hostile takeovers
- *
- * Flush the backlog up through the currently newest record. Unsafe hostile
- * takeovers will be performed, if necessary.
- */
-void nbcon_atomic_flush_unsafe(void)
-{
- __nbcon_atomic_flush_pending(PR_FLUSH_HANG, prb_next_reserve_seq(prb));
-}
-
/**
* nbcon_cpu_emergency_enter - Enter an emergency section where printk()
* messages for that CPU are flushed directly
--
2.47.3
next prev parent reply other threads:[~2026-11-09 12:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 12:31 [PATCH printk 0/6] Introduce policies for unsafe flushing John Ogness
2026-11-09 12:31 ` [PATCH printk 1/6] printk: Introduce and specify flush reasons John Ogness
2026-11-09 12:31 ` [PATCH printk 2/6] console: Introduce unsafe flush policy flags John Ogness
2026-11-09 12:31 ` [PATCH printk 3/6] printk: Evaluate flush policy in nbcon_allow_unsafe_takeover() John Ogness
2026-11-09 12:31 ` John Ogness [this message]
2026-11-09 12:31 ` [PATCH printk 5/6] printk: Add panic+kexec flush point John Ogness
2026-11-09 12:31 ` [PATCH printk 6/6] netconsole: Always perform unsafe flushing on panic/kdb/restart John Ogness
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261109123127.489676-5-john.ogness@linutronix.de \
--to=john.ogness@linutronix.de \
--cc=acarmina@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=atomlin@atomlin.com \
--cc=brads@mainlining.org \
--cc=gregkh@linuxfoundation.org \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=petr.pavlu@suse.com \
--cc=pmladek@suse.com \
--cc=pnina.feder@mobileye.com \
--cc=printk@lists.linux.dev \
--cc=rdunlap@infradead.org \
--cc=rioo.tsukatsukii@gmail.com \
--cc=rostedt@goodmis.org \
--cc=ryan.roberts@arm.com \
--cc=senozhatsky@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®