linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] printk: export pr_flush()
@ 2024-04-02 10:10 Esben Haabendal
  2024-04-02 10:10 ` [PATCH 2/2] reboot: flush printk buffers before final shutdown Esben Haabendal
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Esben Haabendal @ 2024-04-02 10:10 UTC (permalink / raw)
  To: Petr Mladek, Steven Rostedt, John Ogness, Sergey Senozhatsky,
	linux-rt-users
  Cc: Martin Hundebøll

From: Martin Hundebøll <martin@geanix.com>

Outside prinkt users might wan't assure whatever printed has reached
its destination before continuing. E.g. during the shutdown-procedure,
where printk-buffers aren't emptied before the system goes down.

Signed-off-by: Martin Hundebøll <martin@geanix.com>
---
 include/linux/printk.h | 2 ++
 kernel/printk/printk.c | 5 ++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/linux/printk.h b/include/linux/printk.h
index a2d40a637226..c8ac0f17d828 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -142,6 +142,8 @@ void early_printk(const char *s, ...) { }
 
 struct dev_printk_info;
 
+bool pr_flush(int timeout_ms, bool reset_on_progress);
+
 #ifdef CONFIG_PRINTK
 asmlinkage __printf(4, 0)
 int vprintk_emit(int facility, int level,
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index e29f77f4f8b4..26a63457ba6c 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2484,7 +2484,6 @@ asmlinkage __visible int _printk(const char *fmt, ...)
 }
 EXPORT_SYMBOL(_printk);
 
-static bool pr_flush(int timeout_ms, bool reset_on_progress);
 static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progress);
 
 static struct task_struct *nbcon_legacy_kthread;
@@ -2505,7 +2504,7 @@ static inline void wake_up_legacy_kthread(void)
 
 static u64 syslog_seq;
 
-static bool pr_flush(int timeout_ms, bool reset_on_progress) { return true; }
+bool pr_flush(int timeout_ms, bool reset_on_progress) { return true; }
 static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progress) { return true; }
 
 static inline void nbcon_legacy_kthread_create(void) { }
@@ -4217,7 +4216,7 @@ static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progre
  * Context: Process context. May sleep while acquiring console lock.
  * Return: true if all usable printers are caught up.
  */
-static bool pr_flush(int timeout_ms, bool reset_on_progress)
+bool pr_flush(int timeout_ms, bool reset_on_progress)
 {
 	return __pr_flush(NULL, timeout_ms, reset_on_progress);
 }
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-04-03 10:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-02 10:10 [PATCH 1/2] printk: export pr_flush() Esben Haabendal
2024-04-02 10:10 ` [PATCH 2/2] reboot: flush printk buffers before final shutdown Esben Haabendal
2024-04-02 10:12   ` Esben Haabendal
2024-04-02 10:13   ` Esben Haabendal
2024-04-02 10:12 ` [PATCH 1/2] printk: export pr_flush() Esben Haabendal
2024-04-02 10:13 ` Esben Haabendal
2024-04-02 10:25 ` John Ogness
2024-04-02 11:19   ` Esben Haabendal
2024-04-02 13:23     ` John Ogness
2024-04-02 14:41       ` Esben Haabendal
2024-04-02 15:20         ` John Ogness
2024-04-03  9:45           ` Esben Haabendal
2024-04-03 10:09             ` John Ogness

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).