summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0099-printk-Consider-nbcon-boot-consoles-on-seq-init.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-11 08:28:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-11 08:28:00 +0000
commit3565071f226432336a54d0193d729fa4508a3394 (patch)
tree4cde13f078f84c0a7785d234fd52edce7c90546a /debian/patches-rt/0099-printk-Consider-nbcon-boot-consoles-on-seq-init.patch
parentAdding upstream version 6.6.15. (diff)
downloadlinux-3565071f226432336a54d0193d729fa4508a3394.tar.xz
linux-3565071f226432336a54d0193d729fa4508a3394.zip
Adding debian version 6.6.15-2.debian/6.6.15-2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches-rt/0099-printk-Consider-nbcon-boot-consoles-on-seq-init.patch')
-rw-r--r--debian/patches-rt/0099-printk-Consider-nbcon-boot-consoles-on-seq-init.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/debian/patches-rt/0099-printk-Consider-nbcon-boot-consoles-on-seq-init.patch b/debian/patches-rt/0099-printk-Consider-nbcon-boot-consoles-on-seq-init.patch
new file mode 100644
index 000000000..b4e61c768
--- /dev/null
+++ b/debian/patches-rt/0099-printk-Consider-nbcon-boot-consoles-on-seq-init.patch
@@ -0,0 +1,51 @@
+From: John Ogness <john.ogness@linutronix.de>
+Date: Wed, 22 Nov 2023 11:23:43 +0000
+Subject: [PATCH 099/134] printk: Consider nbcon boot consoles on seq init
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/6.6/older/patches-6.6.7-rt18.tar.xz
+
+If a non-boot console is registering and boot consoles exist, the
+consoles are flushed before being unregistered. This allows the
+non-boot console to continue where the boot console left off.
+
+If for whatever reason flushing fails, the lowest seq found from
+any of the enabled boot consoles is used. Until now con->seq was
+checked. However, if it is an nbcon boot console, the function
+nbcon_seq_read() must be used to read seq because con->seq is
+always 0.
+
+Check if it is an nbcon boot console and if so call
+nbcon_seq_read() to read seq.
+
+Signed-off-by: John Ogness <john.ogness@linutronix.de>
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+---
+ kernel/printk/printk.c | 17 +++++++++++++----
+ 1 file changed, 13 insertions(+), 4 deletions(-)
+
+--- a/kernel/printk/printk.c
++++ b/kernel/printk/printk.c
+@@ -3392,11 +3392,20 @@ static void console_init_seq(struct cons
+
+ newcon->seq = prb_next_seq(prb);
+ for_each_console(con) {
+- if ((con->flags & CON_BOOT) &&
+- (con->flags & CON_ENABLED) &&
+- con->seq < newcon->seq) {
+- newcon->seq = con->seq;
++ u64 seq;
++
++ if (!((con->flags & CON_BOOT) &&
++ (con->flags & CON_ENABLED))) {
++ continue;
+ }
++
++ if (con->flags & CON_NBCON)
++ seq = nbcon_seq_read(con);
++ else
++ seq = con->seq;
++
++ if (seq < newcon->seq)
++ newcon->seq = seq;
+ }
+ }
+