summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0023-printk-Track-nbcon-consoles.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:11:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:11:37 +0000
commit85f603d4fd6d85c425502723a17daa94574977de (patch)
tree188a21432c3b8e8ddb8a08e9a09397164a88181c /debian/patches-rt/0023-printk-Track-nbcon-consoles.patch
parentMerging upstream version 6.9.7. (diff)
downloadlinux-85f603d4fd6d85c425502723a17daa94574977de.tar.xz
linux-85f603d4fd6d85c425502723a17daa94574977de.zip
Adding debian version 6.9.7-1.debian/6.9.7-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches-rt/0023-printk-Track-nbcon-consoles.patch')
-rw-r--r--debian/patches-rt/0023-printk-Track-nbcon-consoles.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/debian/patches-rt/0023-printk-Track-nbcon-consoles.patch b/debian/patches-rt/0023-printk-Track-nbcon-consoles.patch
new file mode 100644
index 0000000000..07220890af
--- /dev/null
+++ b/debian/patches-rt/0023-printk-Track-nbcon-consoles.patch
@@ -0,0 +1,66 @@
+From: John Ogness <john.ogness@linutronix.de>
+Date: Mon, 11 Dec 2023 09:36:52 +0000
+Subject: [PATCH 23/46] printk: Track nbcon consoles
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/6.9/older/patches-6.9-rt5.tar.xz
+
+Add a global flag @have_nbcon_console to identify if any nbcon
+consoles are registered. This will be used in follow-up commits
+to preserve legacy behavior when no nbcon consoles are registered.
+
+Signed-off-by: John Ogness <john.ogness@linutronix.de>
+Reviewed-by: Petr Mladek <pmladek@suse.com>
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+---
+ kernel/printk/printk.c | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+--- a/kernel/printk/printk.c
++++ b/kernel/printk/printk.c
+@@ -471,6 +471,11 @@ static DEFINE_MUTEX(syslog_lock);
+ static bool have_legacy_console;
+
+ /*
++ * Specifies if an nbcon console is registered.
++ */
++static bool have_nbcon_console;
++
++/*
+ * Specifies if a boot console is registered. If boot consoles are present,
+ * nbcon consoles cannot print simultaneously and must be synchronized by
+ * the console lock. This is because boot consoles and nbcon consoles may
+@@ -3552,6 +3557,7 @@ void register_console(struct console *ne
+ init_seq = get_init_console_seq(newcon, bootcon_registered);
+
+ if (newcon->flags & CON_NBCON) {
++ have_nbcon_console = true;
+ nbcon_init(newcon, init_seq);
+ } else {
+ have_legacy_console = true;
+@@ -3631,6 +3637,7 @@ EXPORT_SYMBOL(register_console);
+ static int unregister_console_locked(struct console *console)
+ {
+ bool found_legacy_con = false;
++ bool found_nbcon_con = false;
+ bool found_boot_con = false;
+ unsigned long flags;
+ struct console *c;
+@@ -3698,13 +3705,18 @@ static int unregister_console_locked(str
+ for_each_console(c) {
+ if (c->flags & CON_BOOT)
+ found_boot_con = true;
+- if (!(c->flags & CON_NBCON))
++
++ if (c->flags & CON_NBCON)
++ found_nbcon_con = true;
++ else
+ found_legacy_con = true;
+ }
+ if (!found_boot_con)
+ have_boot_console = found_boot_con;
+ if (!found_legacy_con)
+ have_legacy_console = found_legacy_con;
++ if (!found_nbcon_con)
++ have_nbcon_console = found_nbcon_con;
+
+ return res;
+ }