aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2024-04-03 17:30:58 +0200
committerSebastian Andrzej Siewior <bigeasy@linutronix.de>2024-04-03 17:30:58 +0200
commit51d3b509c00b888a9b5aa2ea06926a86a29a6799 (patch)
treed6b769de97739bb319bd74297e68573db0110be6
parent040e01319430f32a913ba5f41949124c73142212 (diff)
downloadlinux-rt-devel-linux-6.8.y-rt-patches.tar.gz
Dear RT folks! I'm pleased to announce the v6.8.2-rt11 patch set. Changes since v6.8.2-rt10: - Update of the printk series by John Ogness: - fix usage of port lock before initialization. - adjust pr_flush() compiler barrier to ensure proper local variable usage. Known issues None. The delta patch against v6.8.2-rt10 is appended below and can be found here: https://cdn.kernel.org/pub/linux/kernel/projects/rt/6.8/incr/patch-6.8.2-rt10-rt11.patch.xz You can get this release via the git tree at: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git v6.8.2-rt11 The RT patch against v6.8.2 can be found here: https://cdn.kernel.org/pub/linux/kernel/projects/rt/6.8/older/patch-6.8.2-rt11.patch.xz The split quilt queue is available at: https://cdn.kernel.org/pub/linux/kernel/projects/rt/6.8/older/patches-6.8.2-rt11.tar.xz Sebastian Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
-rw-r--r--patches/0001-printk-ringbuffer-Clarify-special-lpos-values.patch (renamed from patches/0005-printk-ringbuffer-Clarify-special-lpos-values.patch)2
-rw-r--r--patches/0002-printk-For-suppress_panic_printk-check-for-other-CPU.patch (renamed from patches/0006-printk-For-suppress_panic_printk-check-for-other-CPU.patch)2
-rw-r--r--patches/0003-printk-Avoid-non-panic-CPUs-writing-to-ringbuffer.patch (renamed from patches/0012-printk-Avoid-non-panic-CPUs-writing-to-ringbuffer.patch)2
-rw-r--r--patches/0004-panic-Flush-kernel-log-buffer-at-the-end.patch (renamed from patches/0013-panic-Flush-kernel-log-buffer-at-the-end.patch)2
-rw-r--r--patches/0005-dump_stack-Do-not-get-cpu_sync-for-panic-CPU.patch (renamed from patches/0014-dump_stack-Do-not-get-cpu_sync-for-panic-CPU.patch)2
-rw-r--r--patches/0006-printk-Add-notation-to-console_srcu-locking.patch (renamed from patches/0015-printk-Add-notation-to-console_srcu-locking.patch)2
-rw-r--r--patches/0007-printk-Properly-deal-with-nbcon-consoles-on-seq-init.patch (renamed from patches/0016-printk-Properly-deal-with-nbcon-consoles-on-seq-init.patch)2
-rw-r--r--patches/0008-printk-nbcon-Remove-return-value-for-write_atomic.patch (renamed from patches/0017-printk-nbcon-Remove-return-value-for-write_atomic.patch)2
-rw-r--r--patches/0009-printk-Check-printk_deferred_enter-_exit-usage.patch (renamed from patches/0018-printk-Check-printk_deferred_enter-_exit-usage.patch)2
-rw-r--r--patches/0010-printk-nbcon-Add-detailed-doc-for-write_atomic.patch (renamed from patches/0020-printk-nbcon-Add-detailed-doc-for-write_atomic.patch)2
-rw-r--r--patches/0011-printk-nbcon-Add-callbacks-to-synchronize-with-drive.patch (renamed from patches/0021-printk-nbcon-Add-callbacks-to-synchronize-with-drive.patch)38
-rw-r--r--patches/0012-printk-nbcon-Use-driver-synchronization-while-regist.patch (renamed from patches/0022-printk-nbcon-Add-consoles-with-driver-synchronizatio.patch)3
-rw-r--r--patches/0013-serial-core-Provide-low-level-functions-to-lock-port.patch (renamed from patches/0019-serial-core-Provide-low-level-functions-to-port-lock.patch)28
-rw-r--r--patches/0014-printk-nbcon-Implement-processing-in-port-lock-wrapp.patch (renamed from patches/0023-printk-nbcon-Implement-processing-in-port-lock-wrapp.patch)36
-rw-r--r--patches/0015-printk-nbcon-Do-not-rely-on-proxy-headers.patch (renamed from patches/0024-printk-nbcon-Do-not-rely-on-proxy-headers.patch)3
-rw-r--r--patches/0016-printk-nbcon-Fix-kerneldoc-for-enums.patch (renamed from patches/0025-printk-nbcon-Fix-kerneldoc-for-enums.patch)2
-rw-r--r--patches/0017-printk-Make-console_is_usable-available-to-nbcon.patch (renamed from patches/0026-printk-Make-console_is_usable-available-to-nbcon.patch)2
-rw-r--r--patches/0018-printk-Let-console_is_usable-handle-nbcon.patch (renamed from patches/0027-printk-Let-console_is_usable-handle-nbcon.patch)2
-rw-r--r--patches/0019-printk-Add-flags-argument-for-console_is_usable.patch (renamed from patches/0028-printk-Add-flags-argument-for-console_is_usable.patch)2
-rw-r--r--patches/0020-printk-nbcon-Provide-function-to-flush-using-write_a.patch (renamed from patches/0029-printk-nbcon-Provide-function-to-flush-using-write_a.patch)4
-rw-r--r--patches/0021-printk-Track-registered-boot-consoles.patch (renamed from patches/0030-printk-Track-registered-boot-consoles.patch)2
-rw-r--r--patches/0022-printk-nbcon-Use-nbcon-consoles-in-console_flush_all.patch (renamed from patches/0031-printk-nbcon-Use-nbcon-consoles-in-console_flush_all.patch)2
-rw-r--r--patches/0023-printk-nbcon-Assign-priority-based-on-CPU-state.patch (renamed from patches/0032-printk-nbcon-Assign-priority-based-on-CPU-state.patch)2
-rw-r--r--patches/0024-printk-nbcon-Add-unsafe-flushing-on-panic.patch (renamed from patches/0033-printk-nbcon-Add-unsafe-flushing-on-panic.patch)2
-rw-r--r--patches/0025-printk-Avoid-console_lock-dance-if-no-legacy-or-boot.patch (renamed from patches/0034-printk-Avoid-console_lock-dance-if-no-legacy-or-boot.patch)63
-rw-r--r--patches/0026-printk-Track-nbcon-consoles.patch (renamed from patches/0035-printk-Track-nbcon-consoles.patch)18
-rw-r--r--patches/0027-printk-Coordinate-direct-printing-in-panic.patch (renamed from patches/0036-printk-Coordinate-direct-printing-in-panic.patch)38
-rw-r--r--patches/0028-printk-nbcon-Implement-emergency-sections.patch (renamed from patches/0037-printk-nbcon-Implement-emergency-sections.patch)6
-rw-r--r--patches/0029-panic-Mark-emergency-section-in-warn.patch (renamed from patches/0040-panic-Mark-emergency-section-in-warn.patch)2
-rw-r--r--patches/0030-panic-Mark-emergency-section-in-oops.patch (renamed from patches/0041-panic-Mark-emergency-section-in-oops.patch)2
-rw-r--r--patches/0031-rcu-Mark-emergency-sections-in-rcu-stalls.patch (renamed from patches/0042-rcu-Mark-emergency-section-in-rcu-stalls.patch)14
-rw-r--r--patches/0032-lockdep-Mark-emergency-sections-in-lockdep-splats.patch (renamed from patches/0043-lockdep-Mark-emergency-sections-in-lockdep-splats.patch)2
-rw-r--r--patches/0033-printk-nbcon-Introduce-printing-kthreads.patch (renamed from patches/0044-printk-nbcon-Introduce-printing-kthreads.patch)34
-rw-r--r--patches/0034-printk-Atomic-print-in-printk-context-on-shutdown.patch (renamed from patches/0045-printk-Atomic-print-in-printk-context-on-shutdown.patch)11
-rw-r--r--patches/0035-printk-nbcon-Add-context-to-console_is_usable.patch (renamed from patches/0046-printk-nbcon-Add-context-to-console_is_usable.patch)12
-rw-r--r--patches/0036-printk-nbcon-Add-printer-thread-wakeups.patch (renamed from patches/0047-printk-nbcon-Add-printer-thread-wakeups.patch)18
-rw-r--r--patches/0037-printk-nbcon-Stop-threads-on-shutdown-reboot.patch (renamed from patches/0048-printk-nbcon-Stop-threads-on-shutdown-reboot.patch)4
-rw-r--r--patches/0038-printk-nbcon-Start-printing-threads.patch (renamed from patches/0049-printk-nbcon-Start-printing-threads.patch)20
-rw-r--r--patches/0039-printk-Provide-helper-for-message-prepending.patch (renamed from patches/0038-printk-Provide-helper-for-message-prepending.patch)6
-rw-r--r--patches/0040-printk-nbcon-Show-replay-message-on-takeover.patch (renamed from patches/0039-printk-nbcon-show-replay-message-on-takeover.patch)26
-rw-r--r--patches/0041-proc-Add-nbcon-support-for-proc-consoles.patch (renamed from patches/0050-proc-Add-nbcon-support-for-proc-consoles.patch)2
-rw-r--r--patches/0042-tty-sysfs-Add-nbcon-support-for-active.patch (renamed from patches/0051-tty-sysfs-Add-nbcon-support-for-active.patch)2
-rw-r--r--patches/0043-printk-nbcon-Provide-function-to-reacquire-ownership.patch (renamed from patches/0052-printk-nbcon-Provide-function-to-reacquire-ownership.patch)4
-rw-r--r--patches/0044-serial-8250-Switch-to-nbcon-console.patch (renamed from patches/0053-serial-8250-Switch-to-nbcon-console.patch)2
-rw-r--r--patches/0045-serial-8250-Revert-drop-lockdep-annotation-from-seri.patch (renamed from patches/0054-serial-8250-Revert-drop-lockdep-annotation-from-seri.patch)2
-rw-r--r--patches/0046-printk-Add-kthread-for-all-legacy-consoles.patch (renamed from patches/0055-printk-Add-kthread-for-all-legacy-consoles.patch)30
-rw-r--r--patches/0047-printk-Provide-threadprintk-boot-argument.patch (renamed from patches/0056-printk-Provide-threadprintk-boot-argument.patch)2
-rw-r--r--patches/0048-printk-Avoid-false-positive-lockdep-report-for-legac.patch (renamed from patches/0057-printk-Avoid-false-positive-lockdep-report-for-legac.patch)8
-rw-r--r--patches/Add_localversion_for_-RT_release.patch2
-rw-r--r--patches/PREEMPT_AUTO.patch8
-rw-r--r--patches/series96
51 files changed, 296 insertions, 286 deletions
diff --git a/patches/0005-printk-ringbuffer-Clarify-special-lpos-values.patch b/patches/0001-printk-ringbuffer-Clarify-special-lpos-values.patch
index 12367c8a5cf74..ce5061e28c571 100644
--- a/patches/0005-printk-ringbuffer-Clarify-special-lpos-values.patch
+++ b/patches/0001-printk-ringbuffer-Clarify-special-lpos-values.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 7 Feb 2024 14:46:54 +0106
-Subject: [PATCH 05/57] printk: ringbuffer: Clarify special lpos values
+Subject: [PATCH 01/48] printk: ringbuffer: Clarify special lpos values
For empty line records, no data blocks are created. Instead,
these valid records are identified by special logical position
diff --git a/patches/0006-printk-For-suppress_panic_printk-check-for-other-CPU.patch b/patches/0002-printk-For-suppress_panic_printk-check-for-other-CPU.patch
index 725d2c3300795..9706c63ba7c24 100644
--- a/patches/0006-printk-For-suppress_panic_printk-check-for-other-CPU.patch
+++ b/patches/0002-printk-For-suppress_panic_printk-check-for-other-CPU.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 7 Feb 2024 14:46:55 +0106
-Subject: [PATCH 06/57] printk: For @suppress_panic_printk check for other CPU
+Subject: [PATCH 02/48] printk: For @suppress_panic_printk check for other CPU
in panic
Currently @suppress_panic_printk is checked along with
diff --git a/patches/0012-printk-Avoid-non-panic-CPUs-writing-to-ringbuffer.patch b/patches/0003-printk-Avoid-non-panic-CPUs-writing-to-ringbuffer.patch
index a65b5487eda0f..19ef091371907 100644
--- a/patches/0012-printk-Avoid-non-panic-CPUs-writing-to-ringbuffer.patch
+++ b/patches/0003-printk-Avoid-non-panic-CPUs-writing-to-ringbuffer.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 7 Feb 2024 14:47:01 +0106
-Subject: [PATCH 12/57] printk: Avoid non-panic CPUs writing to ringbuffer
+Subject: [PATCH 03/48] printk: Avoid non-panic CPUs writing to ringbuffer
Commit 13fb0f74d702 ("printk: Avoid livelock with heavy printk
during panic") introduced a mechanism to silence non-panic CPUs
diff --git a/patches/0013-panic-Flush-kernel-log-buffer-at-the-end.patch b/patches/0004-panic-Flush-kernel-log-buffer-at-the-end.patch
index 77cbff22eb8b9..106d1e6db995d 100644
--- a/patches/0013-panic-Flush-kernel-log-buffer-at-the-end.patch
+++ b/patches/0004-panic-Flush-kernel-log-buffer-at-the-end.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 7 Feb 2024 14:47:02 +0106
-Subject: [PATCH 13/57] panic: Flush kernel log buffer at the end
+Subject: [PATCH 04/48] panic: Flush kernel log buffer at the end
If the kernel crashes in a context where printk() calls always
defer printing (such as in NMI or inside a printk_safe section)
diff --git a/patches/0014-dump_stack-Do-not-get-cpu_sync-for-panic-CPU.patch b/patches/0005-dump_stack-Do-not-get-cpu_sync-for-panic-CPU.patch
index 0ba3a76d03992..25c9d25dc1a83 100644
--- a/patches/0014-dump_stack-Do-not-get-cpu_sync-for-panic-CPU.patch
+++ b/patches/0005-dump_stack-Do-not-get-cpu_sync-for-panic-CPU.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 7 Feb 2024 14:47:03 +0106
-Subject: [PATCH 14/57] dump_stack: Do not get cpu_sync for panic CPU
+Subject: [PATCH 05/48] dump_stack: Do not get cpu_sync for panic CPU
dump_stack() is called in panic(). If for some reason another CPU
is holding the printk_cpu_sync and is unable to release it, the
diff --git a/patches/0015-printk-Add-notation-to-console_srcu-locking.patch b/patches/0006-printk-Add-notation-to-console_srcu-locking.patch
index 192f1577f36d4..c1804d33376a1 100644
--- a/patches/0015-printk-Add-notation-to-console_srcu-locking.patch
+++ b/patches/0006-printk-Add-notation-to-console_srcu-locking.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Mon, 9 Oct 2023 13:55:19 +0000
-Subject: [PATCH 15/57] printk: Add notation to console_srcu locking
+Subject: [PATCH 06/48] printk: Add notation to console_srcu locking
kernel/printk/printk.c:284:5: sparse: sparse: context imbalance in
'console_srcu_read_lock' - wrong count at exit
diff --git a/patches/0016-printk-Properly-deal-with-nbcon-consoles-on-seq-init.patch b/patches/0007-printk-Properly-deal-with-nbcon-consoles-on-seq-init.patch
index f1dd115ab6f9b..cdd68dd93b680 100644
--- a/patches/0016-printk-Properly-deal-with-nbcon-consoles-on-seq-init.patch
+++ b/patches/0007-printk-Properly-deal-with-nbcon-consoles-on-seq-init.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 22 Nov 2023 11:23:43 +0000
-Subject: [PATCH 16/57] printk: Properly deal with nbcon consoles on seq init
+Subject: [PATCH 07/48] printk: Properly deal with nbcon consoles on seq init
If a non-boot console is registering and boot consoles exist, the
consoles are flushed before being unregistered. This allows the
diff --git a/patches/0017-printk-nbcon-Remove-return-value-for-write_atomic.patch b/patches/0008-printk-nbcon-Remove-return-value-for-write_atomic.patch
index 44e19d828bbd2..b5dafc2969689 100644
--- a/patches/0017-printk-nbcon-Remove-return-value-for-write_atomic.patch
+++ b/patches/0008-printk-nbcon-Remove-return-value-for-write_atomic.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Fri, 20 Oct 2023 09:52:59 +0000
-Subject: [PATCH 17/57] printk: nbcon: Remove return value for write_atomic()
+Subject: [PATCH 08/48] printk: nbcon: Remove return value for write_atomic()
The return value of write_atomic() does not provide any useful
information. On the contrary, it makes things more complicated
diff --git a/patches/0018-printk-Check-printk_deferred_enter-_exit-usage.patch b/patches/0009-printk-Check-printk_deferred_enter-_exit-usage.patch
index 62835a2171883..564fe5d904d36 100644
--- a/patches/0018-printk-Check-printk_deferred_enter-_exit-usage.patch
+++ b/patches/0009-printk-Check-printk_deferred_enter-_exit-usage.patch
@@ -1,6 +1,6 @@
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Fri, 22 Sep 2023 14:58:18 +0000
-Subject: [PATCH 18/57] printk: Check printk_deferred_enter()/_exit() usage
+Subject: [PATCH 09/48] printk: Check printk_deferred_enter()/_exit() usage
Add validation that printk_deferred_enter()/_exit() are called in
non-migration contexts.
diff --git a/patches/0020-printk-nbcon-Add-detailed-doc-for-write_atomic.patch b/patches/0010-printk-nbcon-Add-detailed-doc-for-write_atomic.patch
index 1050c40a086f8..2e765af59cdbb 100644
--- a/patches/0020-printk-nbcon-Add-detailed-doc-for-write_atomic.patch
+++ b/patches/0010-printk-nbcon-Add-detailed-doc-for-write_atomic.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 7 Feb 2024 18:38:14 +0000
-Subject: [PATCH 20/57] printk: nbcon: Add detailed doc for write_atomic()
+Subject: [PATCH 10/48] printk: nbcon: Add detailed doc for write_atomic()
The write_atomic() callback has special requirements and is
allowed to use special helper functions. Provide detailed
diff --git a/patches/0021-printk-nbcon-Add-callbacks-to-synchronize-with-drive.patch b/patches/0011-printk-nbcon-Add-callbacks-to-synchronize-with-drive.patch
index 04a0277de60f9..8d91728ceac62 100644
--- a/patches/0021-printk-nbcon-Add-callbacks-to-synchronize-with-drive.patch
+++ b/patches/0011-printk-nbcon-Add-callbacks-to-synchronize-with-drive.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Mon, 18 Mar 2024 10:11:56 +0000
-Subject: [PATCH 21/57] printk: nbcon: Add callbacks to synchronize with driver
+Subject: [PATCH 11/48] printk: nbcon: Add callbacks to synchronize with driver
Console drivers typically must deal with access to the hardware
via user input/output (such as an interactive login shell) and
@@ -15,13 +15,12 @@ itself (for example, the port lock for uart serial consoles).
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
- include/linux/console.h | 43 +++++++++++++++++++++++++++++++++++++++++++
- include/linux/serial_core.h | 10 ++++++++--
- 2 files changed, 51 insertions(+), 2 deletions(-)
+ include/linux/console.h | 42 ++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 42 insertions(+)
--- a/include/linux/console.h
+++ b/include/linux/console.h
-@@ -352,6 +352,49 @@ struct console {
+@@ -352,6 +352,48 @@ struct console {
*/
void (*write_atomic)(struct console *con, struct nbcon_write_context *wctxt);
@@ -46,9 +45,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+ * migrate_disable().
+ *
+ * The flags argument is provided as a convenience to the driver. It
-+ * will be passed again to device_unlock() when printing is completed
-+ * (for example, if spin_lock_irqsave() was used). It can be ignored
-+ * if the driver does not need it.
++ * will be passed again to device_unlock(). It can be ignored if the
++ * driver does not need it.
+ */
+ void (*device_lock)(struct console *con, unsigned long *flags);
+
@@ -71,27 +69,3 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
atomic_t __private nbcon_state;
atomic_long_t __private nbcon_seq;
struct printk_buffers *pbufs;
---- a/include/linux/serial_core.h
-+++ b/include/linux/serial_core.h
-@@ -588,13 +588,19 @@ struct uart_port {
- void *private_data; /* generic platform data pointer */
- };
-
--/* Only for internal port lock wrapper synchronization. */
-+/*
-+ * Only for console->device_lock()/_unlock() callbacks and internal
-+ * port lock wrapper synchronization.
-+ */
- static inline void __uart_port_lock_irqsave(struct uart_port *up, unsigned long *flags)
- {
- spin_lock_irqsave(&up->lock, *flags);
- }
-
--/* Only for internal port lock wrapper synchronization. */
-+/*
-+ * Only for console->device_lock()/_unlock() callbacks and internal
-+ * port lock wrapper synchronization.
-+ */
- static inline void __uart_port_unlock_irqrestore(struct uart_port *up, unsigned long flags)
- {
- spin_unlock_irqrestore(&up->lock, flags);
diff --git a/patches/0022-printk-nbcon-Add-consoles-with-driver-synchronizatio.patch b/patches/0012-printk-nbcon-Use-driver-synchronization-while-regist.patch
index 0f9b23c51ed06..05d4db14e60b9 100644
--- a/patches/0022-printk-nbcon-Add-consoles-with-driver-synchronizatio.patch
+++ b/patches/0012-printk-nbcon-Use-driver-synchronization-while-regist.patch
@@ -1,6 +1,7 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Fri, 15 Mar 2024 15:38:22 +0000
-Subject: [PATCH 22/57] printk: nbcon: Add consoles with driver synchronization
+Subject: [PATCH 12/48] printk: nbcon: Use driver synchronization while
+ registering
Depending on if an nbcon console is registered, a driver may
handle its internal locking differently. If a driver is holding
diff --git a/patches/0019-serial-core-Provide-low-level-functions-to-port-lock.patch b/patches/0013-serial-core-Provide-low-level-functions-to-lock-port.patch
index ca6599e959469..5c71158d1914b 100644
--- a/patches/0019-serial-core-Provide-low-level-functions-to-port-lock.patch
+++ b/patches/0013-serial-core-Provide-low-level-functions-to-lock-port.patch
@@ -1,11 +1,13 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Mon, 11 Dec 2023 09:19:18 +0000
-Subject: [PATCH 19/57] serial: core: Provide low-level functions to port lock
+Subject: [PATCH 13/48] serial: core: Provide low-level functions to lock port
-In follow-up commits it will be necessary at times for the uart
-console drivers to acquire the port lock directly. These are
-special cases when the console driver is in the process of
-registering itself as a console.
+It will be necessary at times for the uart nbcon console
+drivers to acquire the port lock directly (without the
+additional nbcon functionality of the port lock wrappers).
+These are special cases such as the implementation of the
+device_lock()/device_unlock() callbacks or for internal
+port lock wrapper synchronization.
Provide low-level variants __uart_port_lock_irqsave() and
__uart_port_unlock_irqrestore() for this purpose.
@@ -13,22 +15,28 @@ __uart_port_unlock_irqrestore() for this purpose.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
- include/linux/serial_core.h | 12 ++++++++++++
- 1 file changed, 12 insertions(+)
+ include/linux/serial_core.h | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
-@@ -588,6 +588,18 @@ struct uart_port {
+@@ -588,6 +588,24 @@ struct uart_port {
void *private_data; /* generic platform data pointer */
};
-+/* Only for internal port lock wrapper synchronization. */
++/*
++ * Only for console->device_lock()/_unlock() callbacks and internal
++ * port lock wrapper synchronization.
++ */
+static inline void __uart_port_lock_irqsave(struct uart_port *up, unsigned long *flags)
+{
+ spin_lock_irqsave(&up->lock, *flags);
+}
+
-+/* Only for internal port lock wrapper synchronization. */
++/*
++ * Only for console->device_lock()/_unlock() callbacks and internal
++ * port lock wrapper synchronization.
++ */
+static inline void __uart_port_unlock_irqrestore(struct uart_port *up, unsigned long flags)
+{
+ spin_unlock_irqrestore(&up->lock, flags);
diff --git a/patches/0023-printk-nbcon-Implement-processing-in-port-lock-wrapp.patch b/patches/0014-printk-nbcon-Implement-processing-in-port-lock-wrapp.patch
index 9f0567f75a751..03be6ab3c48e9 100644
--- a/patches/0023-printk-nbcon-Implement-processing-in-port-lock-wrapp.patch
+++ b/patches/0014-printk-nbcon-Implement-processing-in-port-lock-wrapp.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 13 Sep 2023 08:35:23 +0000
-Subject: [PATCH 23/57] printk: nbcon: Implement processing in port->lock
+Subject: [PATCH 14/48] printk: nbcon: Implement processing in port->lock
wrapper
Currently the port->lock wrappers uart_port_lock(),
@@ -23,7 +23,7 @@ owns the port lock via the port lock wrappers.
Also cleanup the description of the console_srcu_read_flags()
function. It is used by the port lock wrappers to ensure a
-console cannot be fully unregistered while anotehr context
+console cannot be fully unregistered while another context
owns the port lock via the port lock wrappers.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
@@ -31,12 +31,12 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
drivers/tty/serial/8250/8250_core.c | 6 +-
drivers/tty/serial/amba-pl011.c | 2
- drivers/tty/serial/serial_core.c | 2
+ drivers/tty/serial/serial_core.c | 16 ++---
include/linux/console.h | 57 ++++++++++++++++----
include/linux/printk.h | 13 ++++
include/linux/serial_core.h | 98 +++++++++++++++++++++++++++++++++++-
kernel/printk/nbcon.c | 52 +++++++++++++++++++
- 7 files changed, 212 insertions(+), 18 deletions(-)
+ 7 files changed, 219 insertions(+), 25 deletions(-)
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -76,15 +76,37 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
-@@ -3146,7 +3146,7 @@ static int serial_core_add_one_port(stru
+@@ -3145,8 +3145,15 @@ static int serial_core_add_one_port(stru
+ state->uart_port = uport;
uport->state = state;
++ /*
++ * If this port is in use as a console then the spinlock is already
++ * initialised.
++ */
++ if (!uart_console_registered(uport))
++ uart_port_spin_lock_init(uport);
++
state->pm_state = UART_PM_STATE_UNDEFINED;
- uport->cons = drv->cons;
+ uart_port_set_cons(uport, drv->cons);
uport->minor = drv->tty_driver->minor_start + uport->line;
uport->name = kasprintf(GFP_KERNEL, "%s%d", drv->dev_name,
drv->tty_driver->name_base + uport->line);
+@@ -3155,13 +3162,6 @@ static int serial_core_add_one_port(stru
+ goto out;
+ }
+
+- /*
+- * If this port is in use as a console then the spinlock is already
+- * initialised.
+- */
+- if (!uart_console_registered(uport))
+- uart_port_spin_lock_init(uport);
+-
+ if (uport->cons && uport->dev)
+ of_console_check(uport->dev->of_node, uport->cons->name, uport->line);
+
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -283,6 +283,25 @@ struct nbcon_write_context {
@@ -113,7 +135,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
* struct console - The console descriptor structure
* @name: The name of the console driver
* @write: Legacy write callback to output messages (Optional)
-@@ -397,6 +416,21 @@ struct console {
+@@ -396,6 +415,21 @@ struct console {
atomic_t __private nbcon_state;
atomic_long_t __private nbcon_seq;
@@ -135,7 +157,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
struct printk_buffers *pbufs;
};
-@@ -426,28 +460,29 @@ extern void console_list_unlock(void) __
+@@ -425,28 +459,29 @@ extern void console_list_unlock(void) __
extern struct hlist_head console_list;
/**
diff --git a/patches/0024-printk-nbcon-Do-not-rely-on-proxy-headers.patch b/patches/0015-printk-nbcon-Do-not-rely-on-proxy-headers.patch
index bb110f006e36d..d249d552c6b24 100644
--- a/patches/0024-printk-nbcon-Do-not-rely-on-proxy-headers.patch
+++ b/patches/0015-printk-nbcon-Do-not-rely-on-proxy-headers.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Mon, 19 Feb 2024 17:35:49 +0000
-Subject: [PATCH 24/57] printk: nbcon: Do not rely on proxy headers
+Subject: [PATCH 15/48] printk: nbcon: Do not rely on proxy headers
The headers kernel.h, serial_core.h, and console.h allow for the
definitions of many types and functions from other headers.
@@ -10,6 +10,7 @@ list alphabetically to be able to easily detect duplicates.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: John Ogness <john.ogness@linutronix.de>
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/printk/internal.h | 8 ++++++--
diff --git a/patches/0025-printk-nbcon-Fix-kerneldoc-for-enums.patch b/patches/0016-printk-nbcon-Fix-kerneldoc-for-enums.patch
index d50531b1f04a4..0104ccf8576e3 100644
--- a/patches/0025-printk-nbcon-Fix-kerneldoc-for-enums.patch
+++ b/patches/0016-printk-nbcon-Fix-kerneldoc-for-enums.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Fri, 9 Feb 2024 10:46:58 +0000
-Subject: [PATCH 25/57] printk: nbcon: Fix kerneldoc for enums
+Subject: [PATCH 16/48] printk: nbcon: Fix kerneldoc for enums
Kerneldoc requires enums to be specified as such. Otherwise it is
interpreted as function documentation.
diff --git a/patches/0026-printk-Make-console_is_usable-available-to-nbcon.patch b/patches/0017-printk-Make-console_is_usable-available-to-nbcon.patch
index 5bd022ee9846d..87cbadba8fd89 100644
--- a/patches/0026-printk-Make-console_is_usable-available-to-nbcon.patch
+++ b/patches/0017-printk-Make-console_is_usable-available-to-nbcon.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Tue, 12 Sep 2023 13:25:41 +0000
-Subject: [PATCH 26/57] printk: Make console_is_usable() available to nbcon
+Subject: [PATCH 17/48] printk: Make console_is_usable() available to nbcon
Move console_is_usable() as-is into internal.h so that it can
be used by nbcon printing functions as well.
diff --git a/patches/0027-printk-Let-console_is_usable-handle-nbcon.patch b/patches/0018-printk-Let-console_is_usable-handle-nbcon.patch
index 6dc500f4e7d26..fed250f947e95 100644
--- a/patches/0027-printk-Let-console_is_usable-handle-nbcon.patch
+++ b/patches/0018-printk-Let-console_is_usable-handle-nbcon.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Tue, 12 Sep 2023 13:53:21 +0000
-Subject: [PATCH 27/57] printk: Let console_is_usable() handle nbcon
+Subject: [PATCH 18/48] printk: Let console_is_usable() handle nbcon
The nbcon consoles use a different printing callback. For nbcon
consoles, check for the write_atomic() callback instead of
diff --git a/patches/0028-printk-Add-flags-argument-for-console_is_usable.patch b/patches/0019-printk-Add-flags-argument-for-console_is_usable.patch
index 1db8468786a7c..9f04930916662 100644
--- a/patches/0028-printk-Add-flags-argument-for-console_is_usable.patch
+++ b/patches/0019-printk-Add-flags-argument-for-console_is_usable.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Tue, 12 Sep 2023 13:45:33 +0000
-Subject: [PATCH 28/57] printk: Add @flags argument for console_is_usable()
+Subject: [PATCH 19/48] printk: Add @flags argument for console_is_usable()
The caller of console_is_usable() usually needs @console->flags
for its own checks. Rather than having console_is_usable() read
diff --git a/patches/0029-printk-nbcon-Provide-function-to-flush-using-write_a.patch b/patches/0020-printk-nbcon-Provide-function-to-flush-using-write_a.patch
index f969b5ed430b1..3c54b1c0ae0a6 100644
--- a/patches/0029-printk-nbcon-Provide-function-to-flush-using-write_a.patch
+++ b/patches/0020-printk-nbcon-Provide-function-to-flush-using-write_a.patch
@@ -1,6 +1,6 @@
From: Thomas Gleixner <tglx@linutronix.de>
Date: Tue, 12 Sep 2023 12:00:08 +0000
-Subject: [PATCH 29/57] printk: nbcon: Provide function to flush using
+Subject: [PATCH 20/48] printk: nbcon: Provide function to flush using
write_atomic()
Provide nbcon_atomic_flush_pending() to perform flushing of all
@@ -150,7 +150,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+ * lock for uart consoles). Therefore IRQs must be
+ * disabled to avoid being interrupted and then
+ * calling into a driver that will deadlock trying
-+ * acquire console ownership.
++ * to acquire console ownership.
+ */
+ local_irq_save(irq_flags);
+
diff --git a/patches/0030-printk-Track-registered-boot-consoles.patch b/patches/0021-printk-Track-registered-boot-consoles.patch
index 4533c1067e9ef..91d341c3a1322 100644
--- a/patches/0030-printk-Track-registered-boot-consoles.patch
+++ b/patches/0021-printk-Track-registered-boot-consoles.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Tue, 24 Oct 2023 14:13:14 +0000
-Subject: [PATCH 30/57] printk: Track registered boot consoles
+Subject: [PATCH 21/48] printk: Track registered boot consoles
Unfortunately it is not known if a boot console and a regular
(legacy or nbcon) console use the same hardware. For this reason
diff --git a/patches/0031-printk-nbcon-Use-nbcon-consoles-in-console_flush_all.patch b/patches/0022-printk-nbcon-Use-nbcon-consoles-in-console_flush_all.patch
index 5e4bc38312326..17e9d36b00ffb 100644
--- a/patches/0031-printk-nbcon-Use-nbcon-consoles-in-console_flush_all.patch
+++ b/patches/0022-printk-nbcon-Use-nbcon-consoles-in-console_flush_all.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Tue, 19 Sep 2023 14:33:27 +0000
-Subject: [PATCH 31/57] printk: nbcon: Use nbcon consoles in
+Subject: [PATCH 22/48] printk: nbcon: Use nbcon consoles in
console_flush_all()
Allow nbcon consoles to print messages in the legacy printk()
diff --git a/patches/0032-printk-nbcon-Assign-priority-based-on-CPU-state.patch b/patches/0023-printk-nbcon-Assign-priority-based-on-CPU-state.patch
index e7ef1fe065c52..788e7b64520e7 100644
--- a/patches/0032-printk-nbcon-Assign-priority-based-on-CPU-state.patch
+++ b/patches/0023-printk-nbcon-Assign-priority-based-on-CPU-state.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Thu, 14 Dec 2023 14:38:42 +0000
-Subject: [PATCH 32/57] printk: nbcon: Assign priority based on CPU state
+Subject: [PATCH 23/48] printk: nbcon: Assign priority based on CPU state
Use the current state of the CPU to determine which priority to
assign to the printing context.
diff --git a/patches/0033-printk-nbcon-Add-unsafe-flushing-on-panic.patch b/patches/0024-printk-nbcon-Add-unsafe-flushing-on-panic.patch
index 789c9868c0781..ad68f131f3e75 100644
--- a/patches/0033-printk-nbcon-Add-unsafe-flushing-on-panic.patch
+++ b/patches/0024-printk-nbcon-Add-unsafe-flushing-on-panic.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Fri, 20 Oct 2023 10:03:42 +0000
-Subject: [PATCH 33/57] printk: nbcon: Add unsafe flushing on panic
+Subject: [PATCH 24/48] printk: nbcon: Add unsafe flushing on panic
Add nbcon_atomic_flush_unsafe() to flush all nbcon consoles
using the write_atomic() callback and allowing unsafe hostile
diff --git a/patches/0034-printk-Avoid-console_lock-dance-if-no-legacy-or-boot.patch b/patches/0025-printk-Avoid-console_lock-dance-if-no-legacy-or-boot.patch
index 4bc8ba258658a..e7855e2f02000 100644
--- a/patches/0034-printk-Avoid-console_lock-dance-if-no-legacy-or-boot.patch
+++ b/patches/0025-printk-Avoid-console_lock-dance-if-no-legacy-or-boot.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Tue, 26 Sep 2023 12:44:07 +0000
-Subject: [PATCH 34/57] printk: Avoid console_lock dance if no legacy or boot
+Subject: [PATCH 25/48] printk: Avoid console_lock dance if no legacy or boot
consoles
Currently the console lock is used to attempt legacy-type
@@ -16,8 +16,8 @@ and no legacy consoles.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
- kernel/printk/printk.c | 77 ++++++++++++++++++++++++++++++++++++++++---------
- 1 file changed, 64 insertions(+), 13 deletions(-)
+ kernel/printk/printk.c | 79 +++++++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 64 insertions(+), 15 deletions(-)
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -26,7 +26,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/*
+ * Specifies if a legacy console is registered. If legacy consoles are
-+ * present, it is necessary to perform the console_lock/console_unlock dance
++ * present, it is necessary to perform the console lock/unlock dance
+ * whenever console flushing should occur.
+ */
+static bool have_legacy_console;
@@ -109,15 +109,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
return res;
}
-@@ -3815,6 +3838,7 @@ static bool __pr_flush(struct console *c
- u64 last_diff = 0;
- u64 printk_seq;
- short flags;
-+ bool locked;
- int cookie;
- u64 diff;
- u64 seq;
-@@ -3824,22 +3848,35 @@ static bool __pr_flush(struct console *c
+@@ -3824,22 +3847,34 @@ static bool __pr_flush(struct console *c
seq = prb_next_reserve_seq(prb);
/* Flush the consoles so that records up to @seq are printed. */
@@ -131,54 +123,55 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
for (;;) {
unsigned long begin_jiffies;
unsigned long slept_jiffies;
+-
+- diff = 0;
++ bool use_console_lock = printing_via_unlock;
-+ locked = false;
- diff = 0;
-
-+ if (printing_via_unlock) {
-+ /*
-+ * Hold the console_lock to guarantee safe access to
-+ * console->seq. Releasing console_lock flushes more
-+ * records in case @seq is still not printed on all
-+ * usable consoles.
-+ */
-+ console_lock();
-+ locked = true;
-+ }
-+
/*
- * Hold the console_lock to guarantee safe access to
- * console->seq. Releasing console_lock flushes more
- * records in case @seq is still not printed on all
- * usable consoles.
-+ * Ensure the compiler does not optimize @locked to be
-+ * @printing_via_unlock since the latter can change at any
++ * Ensure the compiler does not optimize @use_console_lock to
++ * be @printing_via_unlock since the latter can change at any
+ * time.
*/
- console_lock();
+ barrier();
++
++ diff = 0;
++
++ if (use_console_lock) {
++ /*
++ * Hold the console_lock to guarantee safe access to
++ * console->seq. Releasing console_lock flushes more
++ * records in case @seq is still not printed on all
++ * usable consoles.
++ */
++ console_lock();
++ }
cookie = console_srcu_read_lock();
for_each_console_srcu(c) {
-@@ -3859,6 +3896,7 @@ static bool __pr_flush(struct console *c
+@@ -3859,6 +3894,7 @@ static bool __pr_flush(struct console *c
if (flags & CON_NBCON) {
printk_seq = nbcon_seq_read(c);
} else {
-+ WARN_ON_ONCE(!locked);
++ WARN_ON_ONCE(!use_console_lock);
printk_seq = c->seq;
}
-@@ -3870,7 +3908,8 @@ static bool __pr_flush(struct console *c
+@@ -3870,7 +3906,8 @@ static bool __pr_flush(struct console *c
if (diff != last_diff && reset_on_progress)
remaining_jiffies = timeout_jiffies;
- console_unlock();
-+ if (locked)
++ if (use_console_lock)
+ console_unlock();
/* Note: @diff is 0 if there are no usable consoles. */
if (diff == 0 || remaining_jiffies == 0)
-@@ -3940,6 +3979,7 @@ static void __wake_up_klogd(int val)
+@@ -3940,6 +3977,7 @@ static void __wake_up_klogd(int val)
return;
preempt_disable();
@@ -186,7 +179,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/*
* Guarantee any new records can be seen by tasks preparing to wait
* before this context checks if the wait queue is empty.
-@@ -3951,11 +3991,22 @@ static void __wake_up_klogd(int val)
+@@ -3951,11 +3989,22 @@ static void __wake_up_klogd(int val)
*
* This pairs with devkmsg_read:A and syslog_print:A.
*/
diff --git a/patches/0035-printk-Track-nbcon-consoles.patch b/patches/0026-printk-Track-nbcon-consoles.patch
index 946eccbf17375..3a8fc89ef2dac 100644
--- a/patches/0035-printk-Track-nbcon-consoles.patch
+++ b/patches/0026-printk-Track-nbcon-consoles.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Mon, 11 Dec 2023 09:36:52 +0000
-Subject: [PATCH 35/57] printk: Track nbcon consoles
+Subject: [PATCH 26/48] printk: Track nbcon consoles
Add a global flag @have_nbcon_console to identify if any nbcon
consoles are registered. This will be used in follow-up commits
@@ -9,18 +9,16 @@ to preserve legacy behavior when no nbcon consoles are registered.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
- kernel/printk/printk.c | 16 +++++++++++++++-
- 1 file changed, 15 insertions(+), 1 deletion(-)
+ 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,13 @@ static DEFINE_MUTEX(syslog_lock);
+@@ -471,6 +471,11 @@ static DEFINE_MUTEX(syslog_lock);
static bool have_legacy_console;
/*
-+ * Specifies if an nbcon console is registered. If nbcon consoles are present,
-+ * synchronous printing of legacy consoles will not occur during panic until
-+ * the backtrace has been stored to the ringbuffer.
++ * Specifies if an nbcon console is registered.
+ */
+static bool have_nbcon_console;
+
@@ -28,7 +26,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
* 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
-@@ -3538,6 +3545,7 @@ void register_console(struct console *ne
+@@ -3538,6 +3543,7 @@ void register_console(struct console *ne
console_init_seq(newcon, bootcon_registered);
if (newcon->flags & CON_NBCON) {
@@ -36,7 +34,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
nbcon_init(newcon);
/*
-@@ -3624,6 +3632,7 @@ EXPORT_SYMBOL(register_console);
+@@ -3624,6 +3630,7 @@ EXPORT_SYMBOL(register_console);
static int unregister_console_locked(struct console *console)
{
bool found_legacy_con = false;
@@ -44,7 +42,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
bool found_boot_con = false;
struct console *c;
int res;
-@@ -3680,13 +3689,18 @@ static int unregister_console_locked(str
+@@ -3680,13 +3687,18 @@ static int unregister_console_locked(str
for_each_console(c) {
if (c->flags & CON_BOOT)
found_boot_con = true;
diff --git a/patches/0036-printk-Coordinate-direct-printing-in-panic.patch b/patches/0027-printk-Coordinate-direct-printing-in-panic.patch
index 8cb4d54f9d168..e2ab86a581415 100644
--- a/patches/0036-printk-Coordinate-direct-printing-in-panic.patch
+++ b/patches/0027-printk-Coordinate-direct-printing-in-panic.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 22 Nov 2023 11:56:58 +0000
-Subject: [PATCH 36/57] printk: Coordinate direct printing in panic
+Subject: [PATCH 27/48] printk: Coordinate direct printing in panic
Perform printing by nbcon consoles on the panic CPU from the
printk() caller context in order to get panic messages printed
@@ -19,10 +19,10 @@ from the printk() caller context).
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
- include/linux/printk.h | 5 ++++
+ include/linux/printk.h | 5 +++
kernel/panic.c | 2 +
- kernel/printk/printk.c | 57 ++++++++++++++++++++++++++++++++++++++++++-------
- 3 files changed, 57 insertions(+), 7 deletions(-)
+ kernel/printk/printk.c | 62 ++++++++++++++++++++++++++++++++++++++++++-------
+ 3 files changed, 61 insertions(+), 8 deletions(-)
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -58,7 +58,18 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
* add information to the kmsg dump output.
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
-@@ -2337,12 +2337,27 @@ int vprintk_store(int facility, int leve
+@@ -471,7 +471,9 @@ static DEFINE_MUTEX(syslog_lock);
+ static bool have_legacy_console;
+
+ /*
+- * Specifies if an nbcon console is registered.
++ * Specifies if an nbcon console is registered. If nbcon consoles are present,
++ * synchronous printing of legacy consoles will not occur during panic until
++ * the backtrace has been stored to the ringbuffer.
+ */
+ static bool have_nbcon_console;
+
+@@ -2335,12 +2337,29 @@ int vprintk_store(int facility, int leve
return ret;
}
@@ -73,8 +84,10 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+{
+ legacy_allow_panic_sync = true;
+
-+ if (printing_via_unlock && !in_nmi() && console_trylock())
-+ console_unlock();
++ if (printing_via_unlock && !in_nmi()) {
++ if (console_trylock())
++ console_unlock();
++ }
+}
+
asmlinkage int vprintk_emit(int facility, int level,
@@ -87,7 +100,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/* Suppress unimportant messages after panic happens */
if (unlikely(suppress_printk))
-@@ -2358,15 +2373,43 @@ asmlinkage int vprintk_emit(int facility
+@@ -2356,15 +2375,42 @@ asmlinkage int vprintk_emit(int facility
if (level == LOGLEVEL_SCHED) {
level = LOGLEVEL_DEFAULT;
@@ -121,10 +134,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+ *
+ * - When this CPU is in panic.
+ *
-+ * Note that if boot consoles are registered, the
-+ * console_lock/console_unlock dance must be relied upon
-+ * instead because nbcon consoles cannot print simultaneously
-+ * with boot consoles.
++ * Note that if boot consoles are registered, the console
++ * lock/unlock dance must be relied upon instead because nbcon
++ * consoles cannot print simultaneously with boot consoles.
+ */
+ if (is_panic_context)
+ nbcon_atomic_flush_pending();
@@ -134,7 +146,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/*
* The caller may be holding system-critical or
* timing-sensitive locks. Disable preemption during
-@@ -2386,10 +2429,10 @@ asmlinkage int vprintk_emit(int facility
+@@ -2384,10 +2430,10 @@ asmlinkage int vprintk_emit(int facility
preempt_enable();
}
diff --git a/patches/0037-printk-nbcon-Implement-emergency-sections.patch b/patches/0028-printk-nbcon-Implement-emergency-sections.patch
index ddafe8d26b6cf..245e15b7272b4 100644
--- a/patches/0037-printk-nbcon-Implement-emergency-sections.patch
+++ b/patches/0028-printk-nbcon-Implement-emergency-sections.patch
@@ -1,6 +1,6 @@
From: Thomas Gleixner <tglx@linutronix.de>
Date: Mon, 11 Sep 2023 15:21:57 +0000
-Subject: [PATCH 37/57] printk: nbcon: Implement emergency sections
+Subject: [PATCH 28/48] printk: nbcon: Implement emergency sections
In emergency situations (something has gone wrong but the
system continues to operate), usually important information
@@ -44,7 +44,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
--- a/include/linux/console.h
+++ b/include/linux/console.h
-@@ -560,10 +560,14 @@ static inline bool console_is_registered
+@@ -559,10 +559,14 @@ static inline bool console_is_registered
hlist_for_each_entry(con, &console_list, node)
#ifdef CONFIG_PRINTK
@@ -170,7 +170,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
*
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
-@@ -2416,16 +2416,25 @@ asmlinkage int vprintk_emit(int facility
+@@ -2417,16 +2417,25 @@ asmlinkage int vprintk_emit(int facility
* printing of all remaining records to all consoles so that
* this context can return as soon as possible. Hopefully
* another printk() caller will take over the printing.
diff --git a/patches/0040-panic-Mark-emergency-section-in-warn.patch b/patches/0029-panic-Mark-emergency-section-in-warn.patch
index 43e17dd46c5db..4c2fd804633d7 100644
--- a/patches/0040-panic-Mark-emergency-section-in-warn.patch
+++ b/patches/0029-panic-Mark-emergency-section-in-warn.patch
@@ -1,6 +1,6 @@
From: Thomas Gleixner <tglx@linutronix.de>
Date: Mon, 11 Sep 2023 15:53:04 +0000
-Subject: [PATCH 40/57] panic: Mark emergency section in warn
+Subject: [PATCH 29/48] panic: Mark emergency section in warn
Mark the full contents of __warn() as an emergency section. In
this section, the CPU will not perform console output for the
diff --git a/patches/0041-panic-Mark-emergency-section-in-oops.patch b/patches/0030-panic-Mark-emergency-section-in-oops.patch
index 47703bc51aa2b..e20f70d814b89 100644
--- a/patches/0041-panic-Mark-emergency-section-in-oops.patch
+++ b/patches/0030-panic-Mark-emergency-section-in-oops.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Tue, 19 Sep 2023 17:07:34 +0000
-Subject: [PATCH 41/57] panic: Mark emergency section in oops
+Subject: [PATCH 30/48] panic: Mark emergency section in oops
Mark an emergency section beginning with oops_enter() until the
end of oops_exit(). In this section, the CPU will not perform
diff --git a/patches/0042-rcu-Mark-emergency-section-in-rcu-stalls.patch b/patches/0031-rcu-Mark-emergency-sections-in-rcu-stalls.patch
index ff0d0d70c469b..690a15b699cbc 100644
--- a/patches/0042-rcu-Mark-emergency-section-in-rcu-stalls.patch
+++ b/patches/0031-rcu-Mark-emergency-sections-in-rcu-stalls.patch
@@ -1,12 +1,14 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Mon, 11 Sep 2023 15:53:39 +0000
-Subject: [PATCH 42/57] rcu: Mark emergency section in rcu stalls
+Subject: [PATCH 31/48] rcu: Mark emergency sections in rcu stalls
-Mark an emergency section within print_other_cpu_stall(), where
-RCU stall information is printed. In this section, the CPU will
-not perform console output for the printk() calls. Instead, a
-flushing of the console output is triggered when exiting the
-emergency section.
+Mark emergency sections wherever multiple lines of
+rcu stall information are generated. In an emergency
+section the CPU will not perform console output for the
+printk() calls. Instead, a flushing of the console
+output is triggered when exiting the emergency section.
+This allows the full message block to be stored as
+quickly as possible in the ringbuffer.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
diff --git a/patches/0043-lockdep-Mark-emergency-sections-in-lockdep-splats.patch b/patches/0032-lockdep-Mark-emergency-sections-in-lockdep-splats.patch
index 1b8409a5175d8..99d2928f90da9 100644
--- a/patches/0043-lockdep-Mark-emergency-sections-in-lockdep-splats.patch
+++ b/patches/0032-lockdep-Mark-emergency-sections-in-lockdep-splats.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Mon, 18 Sep 2023 20:27:41 +0000
-Subject: [PATCH 43/57] lockdep: Mark emergency sections in lockdep splats
+Subject: [PATCH 32/48] lockdep: Mark emergency sections in lockdep splats
Mark emergency sections wherever multiple lines of
lock debugging output are generated. In an emergency
diff --git a/patches/0044-printk-nbcon-Introduce-printing-kthreads.patch b/patches/0033-printk-nbcon-Introduce-printing-kthreads.patch
index 55f357bd13031..655719e80d584 100644
--- a/patches/0044-printk-nbcon-Introduce-printing-kthreads.patch
+++ b/patches/0033-printk-nbcon-Introduce-printing-kthreads.patch
@@ -1,6 +1,6 @@
From: Thomas Gleixner <tglx@linutronix.de>
Date: Fri, 22 Sep 2023 14:12:21 +0000
-Subject: [PATCH 44/57] printk: nbcon: Introduce printing kthreads
+Subject: [PATCH 33/48] printk: nbcon: Introduce printing kthreads
Provide the main implementation for running a printer kthread
per nbcon console that is takeover/handover aware.
@@ -26,16 +26,16 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
#include <linux/types.h>
struct vc_data;
-@@ -325,6 +326,8 @@ struct nbcon_drvdata {
+@@ -324,6 +325,8 @@ struct nbcon_drvdata {
+ * @nbcon_state: State for nbcon consoles
* @nbcon_seq: Sequence number of the next record for nbcon to print
- * @nbcon_prev_seq: Seq num the previous nbcon owner was assigned to print
* @pbufs: Pointer to nbcon private buffer
+ * @kthread: Printer kthread for this console
+ * @rcuwait: RCU-safe wait object for @kthread waking
*/
struct console {
char name[16];
-@@ -373,6 +376,27 @@ struct console {
+@@ -372,6 +375,27 @@ struct console {
void (*write_atomic)(struct console *con, struct nbcon_write_context *wctxt);
/**
@@ -63,7 +63,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
* @device_lock:
*
* NBCON callback to begin synchronization with driver code.
-@@ -434,6 +458,8 @@ struct console {
+@@ -431,6 +455,8 @@ struct console {
struct nbcon_drvdata *nbcon_drvdata;
struct printk_buffers *pbufs;
@@ -163,7 +163,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
{
struct nbcon_context *ctxt = &ACCESS_PRIVATE(wctxt, ctxt);
struct console *con = ctxt->console;
-@@ -922,8 +924,14 @@ static bool nbcon_emit_next_record(struc
+@@ -899,8 +901,14 @@ static bool nbcon_emit_next_record(struc
nbcon_state_read(con, &cur);
wctxt->unsafe_takeover = cur.unsafe_takeover;
@@ -179,7 +179,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
} else {
/*
* This function should never be called for legacy consoles.
-@@ -959,6 +967,118 @@ static bool nbcon_emit_next_record(struc
+@@ -936,6 +944,118 @@ static bool nbcon_emit_next_record(struc
return nbcon_context_exit_unsafe(ctxt);
}
@@ -298,7 +298,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/* Track the nbcon emergency nesting per CPU. */
static DEFINE_PER_CPU(unsigned int, nbcon_pcpu_emergency_nesting);
static unsigned int early_nbcon_pcpu_emergency_nesting __initdata;
-@@ -1005,7 +1125,7 @@ static bool nbcon_atomic_emit_one(struct
+@@ -982,7 +1102,7 @@ static bool nbcon_atomic_emit_one(struct
* handed over or taken over. In both cases the context is no
* longer valid.
*/
@@ -307,7 +307,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
return true;
nbcon_context_release(ctxt);
-@@ -1114,7 +1234,7 @@ static bool __nbcon_atomic_flush_pending
+@@ -1091,7 +1211,7 @@ static bool __nbcon_atomic_flush_pending
* handed over or taken over. In both cases the context is no
* longer valid.
*/
@@ -316,7 +316,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
return true;
if (!ctxt->backlog)
-@@ -1253,6 +1373,63 @@ void nbcon_cpu_emergency_exit(void)
+@@ -1230,6 +1350,63 @@ void nbcon_cpu_emergency_exit(void)
}
/**
@@ -380,15 +380,15 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
* nbcon_alloc - Allocate buffers needed by the nbcon console
* @con: Console to allocate buffers for
*
-@@ -1296,6 +1473,7 @@ void nbcon_init(struct console *con)
+@@ -1273,6 +1450,7 @@ void nbcon_init(struct console *con)
/* nbcon_alloc() must have been called and successful! */
BUG_ON(!con->pbufs);
+ rcuwait_init(&con->rcuwait);
nbcon_seq_force(con, 0);
- atomic_long_set(&ACCESS_PRIVATE(con, nbcon_prev_seq), -1UL);
nbcon_state_set(con, &state);
-@@ -1309,6 +1487,7 @@ void nbcon_free(struct console *con)
+ }
+@@ -1285,6 +1463,7 @@ void nbcon_free(struct console *con)
{
struct nbcon_state state = { };
@@ -407,7 +407,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/*
* Specifies if the console lock/unlock dance is needed for console
-@@ -2697,6 +2697,8 @@ void suspend_console(void)
+@@ -2698,6 +2698,8 @@ void suspend_console(void)
void resume_console(void)
{
struct console *con;
@@ -416,7 +416,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (!console_suspend_enabled)
return;
-@@ -2713,6 +2715,14 @@ void resume_console(void)
+@@ -2714,6 +2716,14 @@ void resume_console(void)
*/
synchronize_srcu(&console_srcu);
@@ -431,7 +431,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
pr_flush(1000, true);
}
-@@ -3068,6 +3078,13 @@ static bool console_flush_all(bool do_co
+@@ -3034,6 +3044,13 @@ static bool console_flush_all(bool do_co
u64 printk_seq;
bool progress;
@@ -445,7 +445,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (!console_is_usable(con, flags))
continue;
any_usable = true;
-@@ -3361,9 +3378,23 @@ EXPORT_SYMBOL(console_stop);
+@@ -3327,9 +3344,23 @@ EXPORT_SYMBOL(console_stop);
void console_start(struct console *console)
{
diff --git a/patches/0045-printk-Atomic-print-in-printk-context-on-shutdown.patch b/patches/0034-printk-Atomic-print-in-printk-context-on-shutdown.patch
index 4a45d5d781865..e043ae4c5c603 100644
--- a/patches/0045-printk-Atomic-print-in-printk-context-on-shutdown.patch
+++ b/patches/0034-printk-Atomic-print-in-printk-context-on-shutdown.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Mon, 23 Oct 2023 17:43:48 +0000
-Subject: [PATCH 45/57] printk: Atomic print in printk context on shutdown
+Subject: [PATCH 34/48] printk: Atomic print in printk context on shutdown
For nbcon consoles, normally the printing is handled by the
dedicated console printing threads. However, on shutdown the
@@ -18,17 +18,16 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
-@@ -2400,13 +2400,18 @@ asmlinkage int vprintk_emit(int facility
+@@ -2402,12 +2402,17 @@ asmlinkage int vprintk_emit(int facility
*
* - When this CPU is in panic.
*
+ * - During shutdown, since the printing threads may not get
+ * a chance to print the final messages.
+ *
- * Note that if boot consoles are registered, the
- * console_lock/console_unlock dance must be relied upon
- * instead because nbcon consoles cannot print simultaneously
- * with boot consoles.
+ * Note that if boot consoles are registered, the console
+ * lock/unlock dance must be relied upon instead because nbcon
+ * consoles cannot print simultaneously with boot consoles.
*/
- if (is_panic_context)
+ if (is_panic_context ||
diff --git a/patches/0046-printk-nbcon-Add-context-to-console_is_usable.patch b/patches/0035-printk-nbcon-Add-context-to-console_is_usable.patch
index 9c1ec51f39d10..d117ce421c6bd 100644
--- a/patches/0046-printk-nbcon-Add-context-to-console_is_usable.patch
+++ b/patches/0035-printk-nbcon-Add-context-to-console_is_usable.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Tue, 26 Sep 2023 14:43:30 +0000
-Subject: [PATCH 46/57] printk: nbcon: Add context to console_is_usable()
+Subject: [PATCH 35/48] printk: nbcon: Add context to console_is_usable()
The nbcon consoles have two callbacks to be used for different
contexts. In order to determine if an nbcon console is usable,
@@ -58,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
--- a/kernel/printk/nbcon.c
+++ b/kernel/printk/nbcon.c
-@@ -991,7 +991,7 @@ static bool nbcon_kthread_should_wakeup(
+@@ -968,7 +968,7 @@ static bool nbcon_kthread_should_wakeup(
cookie = console_srcu_read_lock();
flags = console_srcu_read_flags(con);
@@ -67,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/* Bring the sequence in @ctxt up to date */
ctxt->seq = nbcon_seq_read(con);
-@@ -1049,7 +1049,7 @@ static int nbcon_kthread_func(void *__co
+@@ -1026,7 +1026,7 @@ static int nbcon_kthread_func(void *__co
con_flags = console_srcu_read_flags(con);
@@ -76,7 +76,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
con->device_lock(con, &flags);
/*
-@@ -1269,7 +1269,7 @@ static void __nbcon_atomic_flush_pending
+@@ -1246,7 +1246,7 @@ static void __nbcon_atomic_flush_pending
if (!(flags & CON_NBCON))
continue;
@@ -87,7 +87,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (nbcon_seq_read(con) >= stop_seq)
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
-@@ -3090,7 +3090,7 @@ static bool console_flush_all(bool do_co
+@@ -3056,7 +3056,7 @@ static bool console_flush_all(bool do_co
if ((flags & CON_NBCON) && con->kthread)
continue;
@@ -96,7 +96,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
continue;
any_usable = true;
-@@ -4027,8 +4027,10 @@ static bool __pr_flush(struct console *c
+@@ -3991,8 +3991,10 @@ static bool __pr_flush(struct console *c
* that they make forward progress, so only increment
* @diff for usable consoles.
*/
diff --git a/patches/0047-printk-nbcon-Add-printer-thread-wakeups.patch b/patches/0036-printk-nbcon-Add-printer-thread-wakeups.patch
index ab6b546d523c3..cdb013ed98bff 100644
--- a/patches/0047-printk-nbcon-Add-printer-thread-wakeups.patch
+++ b/patches/0036-printk-nbcon-Add-printer-thread-wakeups.patch
@@ -1,6 +1,6 @@
From: Thomas Gleixner <tglx@linutronix.de>
Date: Tue, 26 Sep 2023 13:03:52 +0000
-Subject: [PATCH 47/57] printk: nbcon: Add printer thread wakeups
+Subject: [PATCH 36/48] printk: nbcon: Add printer thread wakeups
Add a function to wakeup the printer threads. Use the new function
when:
@@ -33,7 +33,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
#include <linux/rculist.h>
#include <linux/rcuwait.h>
#include <linux/types.h>
-@@ -328,6 +329,7 @@ struct nbcon_drvdata {
+@@ -327,6 +328,7 @@ struct nbcon_drvdata {
* @pbufs: Pointer to nbcon private buffer
* @kthread: Printer kthread for this console
* @rcuwait: RCU-safe wait object for @kthread waking
@@ -41,7 +41,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
*/
struct console {
char name[16];
-@@ -460,6 +462,7 @@ struct console {
+@@ -457,6 +459,7 @@ struct console {
struct printk_buffers *pbufs;
struct task_struct *kthread;
struct rcuwait rcuwait;
@@ -61,7 +61,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
* Check if the given console is currently capable and allowed to print
--- a/kernel/printk/nbcon.c
+++ b/kernel/printk/nbcon.c
-@@ -1079,6 +1079,61 @@ static int nbcon_kthread_func(void *__co
+@@ -1056,6 +1056,61 @@ static int nbcon_kthread_func(void *__co
goto wait_for_event;
}
@@ -123,17 +123,17 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/* Track the nbcon emergency nesting per CPU. */
static DEFINE_PER_CPU(unsigned int, nbcon_pcpu_emergency_nesting);
static unsigned int early_nbcon_pcpu_emergency_nesting __initdata;
-@@ -1474,6 +1529,7 @@ void nbcon_init(struct console *con)
+@@ -1451,6 +1506,7 @@ void nbcon_init(struct console *con)
BUG_ON(!con->pbufs);
rcuwait_init(&con->rcuwait);
+ init_irq_work(&con->irq_work, nbcon_irq_work);
nbcon_seq_force(con, 0);
- atomic_long_set(&ACCESS_PRIVATE(con, nbcon_prev_seq), -1UL);
nbcon_state_set(con, &state);
+ }
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
-@@ -2414,6 +2414,8 @@ asmlinkage int vprintk_emit(int facility
+@@ -2415,6 +2415,8 @@ asmlinkage int vprintk_emit(int facility
}
}
@@ -142,7 +142,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (do_trylock_unlock) {
/*
* The caller may be holding system-critical or
-@@ -2720,6 +2722,10 @@ void resume_console(void)
+@@ -2721,6 +2723,10 @@ void resume_console(void)
*/
synchronize_srcu(&console_srcu);
@@ -153,7 +153,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
cookie = console_srcu_read_lock();
for_each_console_srcu(con) {
flags = console_srcu_read_flags(con);
-@@ -4187,6 +4193,7 @@ void defer_console_output(void)
+@@ -4151,6 +4157,7 @@ void defer_console_output(void)
void printk_trigger_flush(void)
{
diff --git a/patches/0048-printk-nbcon-Stop-threads-on-shutdown-reboot.patch b/patches/0037-printk-nbcon-Stop-threads-on-shutdown-reboot.patch
index f663daf58cb81..5833dc73b3ebd 100644
--- a/patches/0048-printk-nbcon-Stop-threads-on-shutdown-reboot.patch
+++ b/patches/0037-printk-nbcon-Stop-threads-on-shutdown-reboot.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Tue, 26 Sep 2023 13:04:15 +0000
-Subject: [PATCH 48/57] printk: nbcon: Stop threads on shutdown/reboot
+Subject: [PATCH 37/48] printk: nbcon: Stop threads on shutdown/reboot
Register a syscore_ops shutdown function to stop all threaded
printers on shutdown/reboot. This allows printk to transition back
@@ -23,7 +23,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
#include <linux/types.h>
#include "internal.h"
#include "printk_ringbuffer.h"
-@@ -1601,3 +1602,33 @@ void nbcon_driver_release(struct console
+@@ -1577,3 +1578,33 @@ void nbcon_driver_release(struct console
nbcon_context_release(ctxt);
}
EXPORT_SYMBOL_GPL(nbcon_driver_release);
diff --git a/patches/0049-printk-nbcon-Start-printing-threads.patch b/patches/0038-printk-nbcon-Start-printing-threads.patch
index b31c041d7ff6c..233b014cdb92c 100644
--- a/patches/0049-printk-nbcon-Start-printing-threads.patch
+++ b/patches/0038-printk-nbcon-Start-printing-threads.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Tue, 5 Dec 2023 14:09:31 +0000
-Subject: [PATCH 49/57] printk: nbcon: Start printing threads
+Subject: [PATCH 38/48] printk: nbcon: Start printing threads
If there are no boot consoles, the printing threads are started
in early_initcall.
@@ -51,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/**
* nbcon_context_try_acquire_direct - Try to acquire directly
* @ctxt: The context of the caller
-@@ -1459,7 +1461,7 @@ void nbcon_kthread_create(struct console
+@@ -1436,7 +1438,7 @@ void nbcon_kthread_create(struct console
if (!(con->flags & CON_NBCON) || !con->write_thread)
return;
@@ -60,7 +60,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
return;
/*
-@@ -1485,6 +1487,19 @@ void nbcon_kthread_create(struct console
+@@ -1462,6 +1464,19 @@ void nbcon_kthread_create(struct console
sched_set_normal(con->kthread, -20);
}
@@ -80,9 +80,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/**
* nbcon_alloc - Allocate buffers needed by the nbcon console
* @con: Console to allocate buffers for
-@@ -1534,6 +1549,7 @@ void nbcon_init(struct console *con)
+@@ -1510,6 +1525,7 @@ void nbcon_init(struct console *con)
+ init_irq_work(&con->irq_work, nbcon_irq_work);
nbcon_seq_force(con, 0);
- atomic_long_set(&ACCESS_PRIVATE(con, nbcon_prev_seq), -1UL);
nbcon_state_set(con, &state);
+ nbcon_kthread_create(con);
}
@@ -90,7 +90,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/**
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
-@@ -2400,6 +2400,9 @@ asmlinkage int vprintk_emit(int facility
+@@ -2402,6 +2402,9 @@ asmlinkage int vprintk_emit(int facility
*
* - When this CPU is in panic.
*
@@ -100,15 +100,15 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
* - During shutdown, since the printing threads may not get
* a chance to print the final messages.
*
-@@ -2409,6 +2412,7 @@ asmlinkage int vprintk_emit(int facility
- * with boot consoles.
+@@ -2410,6 +2413,7 @@ asmlinkage int vprintk_emit(int facility
+ * consoles cannot print simultaneously with boot consoles.
*/
if (is_panic_context ||
+ !printk_threads_enabled ||
(system_state > SYSTEM_RUNNING)) {
nbcon_atomic_flush_pending();
}
-@@ -3760,6 +3764,7 @@ EXPORT_SYMBOL(register_console);
+@@ -3726,6 +3730,7 @@ EXPORT_SYMBOL(register_console);
/* Must be called under console_list_lock(). */
static int unregister_console_locked(struct console *console)
{
@@ -116,7 +116,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
bool found_legacy_con = false;
bool found_nbcon_con = false;
bool found_boot_con = false;
-@@ -3831,6 +3836,15 @@ static int unregister_console_locked(str
+@@ -3797,6 +3802,15 @@ static int unregister_console_locked(str
if (!found_nbcon_con)
have_nbcon_console = found_nbcon_con;
diff --git a/patches/0038-printk-Provide-helper-for-message-prepending.patch b/patches/0039-printk-Provide-helper-for-message-prepending.patch
index a8ab4a259fd6e..3b811002c1316 100644
--- a/patches/0038-printk-Provide-helper-for-message-prepending.patch
+++ b/patches/0039-printk-Provide-helper-for-message-prepending.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Thu, 28 Mar 2024 13:29:10 +0000
-Subject: [PATCH 38/57] printk: Provide helper for message prepending
+Subject: [PATCH 39/48] printk: Provide helper for message prepending
In order to support prepending different texts to printk
messages, split out the prepending code into a helper
@@ -14,7 +14,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
-@@ -2793,30 +2793,25 @@ static void __console_unlock(void)
+@@ -2819,30 +2819,25 @@ static void __console_unlock(void)
#ifdef CONFIG_PRINTK
/*
@@ -51,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/*
* Make sure outbuf is sufficiently large before prepending.
-@@ -2839,6 +2834,27 @@ void console_prepend_dropped(struct prin
+@@ -2865,6 +2860,27 @@ void console_prepend_dropped(struct prin
}
/*
diff --git a/patches/0039-printk-nbcon-show-replay-message-on-takeover.patch b/patches/0040-printk-nbcon-Show-replay-message-on-takeover.patch
index 76f65b1fafa1b..610e9b497fb9e 100644
--- a/patches/0039-printk-nbcon-show-replay-message-on-takeover.patch
+++ b/patches/0040-printk-nbcon-Show-replay-message-on-takeover.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Mon, 25 Mar 2024 21:00:40 +0000
-Subject: [PATCH 39/57] printk: nbcon: show replay message on takeover
+Subject: [PATCH 40/48] printk: nbcon: Show replay message on takeover
An emergency or panic context can takeover console ownership
while the current owner was printing a printk message. The
@@ -33,15 +33,15 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
--- a/include/linux/console.h
+++ b/include/linux/console.h
-@@ -323,6 +323,7 @@ struct nbcon_drvdata {
+@@ -325,6 +325,7 @@ struct nbcon_drvdata {
*
* @nbcon_state: State for nbcon consoles
* @nbcon_seq: Sequence number of the next record for nbcon to print
+ * @nbcon_prev_seq: Seq num the previous nbcon owner was assigned to print
* @pbufs: Pointer to nbcon private buffer
- */
- struct console {
-@@ -416,6 +417,7 @@ struct console {
+ * @kthread: Printer kthread for this console
+ * @rcuwait: RCU-safe wait object for @kthread waking
+@@ -441,6 +442,7 @@ struct console {
atomic_t __private nbcon_state;
atomic_long_t __private nbcon_seq;
@@ -51,7 +51,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
* @nbcon_drvdata:
--- a/kernel/printk/internal.h
+++ b/kernel/printk/internal.h
-@@ -187,4 +187,5 @@ bool printk_get_next_message(struct prin
+@@ -222,4 +222,5 @@ bool printk_get_next_message(struct prin
#ifdef CONFIG_PRINTK
void console_prepend_dropped(struct printk_message *pmsg, unsigned long dropped);
@@ -59,7 +59,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
#endif
--- a/kernel/printk/nbcon.c
+++ b/kernel/printk/nbcon.c
-@@ -861,6 +861,7 @@ static bool nbcon_emit_next_record(struc
+@@ -866,6 +866,7 @@ static bool nbcon_emit_next_record(struc
unsigned long con_dropped;
struct nbcon_state cur;
unsigned long dropped;
@@ -67,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/*
* The printk buffers are filled within an unsafe section. This
-@@ -886,6 +887,28 @@ static bool nbcon_emit_next_record(struc
+@@ -891,6 +892,28 @@ static bool nbcon_emit_next_record(struc
if (dropped && !is_extended)
console_prepend_dropped(&pmsg, dropped);
@@ -96,17 +96,17 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (!nbcon_context_exit_unsafe(ctxt))
return false;
-@@ -1274,6 +1297,7 @@ void nbcon_init(struct console *con)
- BUG_ON(!con->pbufs);
-
+@@ -1524,6 +1547,7 @@ void nbcon_init(struct console *con)
+ rcuwait_init(&con->rcuwait);
+ init_irq_work(&con->irq_work, nbcon_irq_work);
nbcon_seq_force(con, 0);
+ atomic_long_set(&ACCESS_PRIVATE(con, nbcon_prev_seq), -1UL);
nbcon_state_set(con, &state);
+ nbcon_kthread_create(con);
}
-
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
-@@ -2855,6 +2855,25 @@ void console_prepend_dropped(struct prin
+@@ -2881,6 +2881,25 @@ void console_prepend_dropped(struct prin
}
/*
diff --git a/patches/0050-proc-Add-nbcon-support-for-proc-consoles.patch b/patches/0041-proc-Add-nbcon-support-for-proc-consoles.patch
index a122b1867fbcc..2338b19b98dea 100644
--- a/patches/0050-proc-Add-nbcon-support-for-proc-consoles.patch
+++ b/patches/0041-proc-Add-nbcon-support-for-proc-consoles.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Tue, 26 Sep 2023 13:31:00 +0000
-Subject: [PATCH 50/57] proc: Add nbcon support for /proc/consoles
+Subject: [PATCH 41/48] proc: Add nbcon support for /proc/consoles
Update /proc/consoles output to show 'W' if an nbcon write
callback is implemented (write_atomic or write_thread).
diff --git a/patches/0051-tty-sysfs-Add-nbcon-support-for-active.patch b/patches/0042-tty-sysfs-Add-nbcon-support-for-active.patch
index b80d4c086f002..739d086a223ec 100644
--- a/patches/0051-tty-sysfs-Add-nbcon-support-for-active.patch
+++ b/patches/0042-tty-sysfs-Add-nbcon-support-for-active.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Fri, 22 Sep 2023 14:31:09 +0000
-Subject: [PATCH 51/57] tty: sysfs: Add nbcon support for 'active'
+Subject: [PATCH 42/48] tty: sysfs: Add nbcon support for 'active'
Allow the 'active' attribute to list nbcon consoles.
diff --git a/patches/0052-printk-nbcon-Provide-function-to-reacquire-ownership.patch b/patches/0043-printk-nbcon-Provide-function-to-reacquire-ownership.patch
index 11865dfd683e8..a3fb0a6e06055 100644
--- a/patches/0052-printk-nbcon-Provide-function-to-reacquire-ownership.patch
+++ b/patches/0043-printk-nbcon-Provide-function-to-reacquire-ownership.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Fri, 20 Oct 2023 10:01:58 +0000
-Subject: [PATCH 52/57] printk: nbcon: Provide function to reacquire ownership
+Subject: [PATCH 43/48] printk: nbcon: Provide function to reacquire ownership
Contexts may become nbcon owners for various reasons, not just
for printing. Indeed, the port->lock wrapper takes ownership
@@ -44,7 +44,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
* This callback can be called from any context (including NMI).
* Therefore it must avoid usage of any locking and instead rely
* on the console ownership for synchronization.
-@@ -596,12 +601,14 @@ extern void nbcon_cpu_emergency_exit(voi
+@@ -595,12 +600,14 @@ extern void nbcon_cpu_emergency_exit(voi
extern bool nbcon_can_proceed(struct nbcon_write_context *wctxt);
extern bool nbcon_enter_unsafe(struct nbcon_write_context *wctxt);
extern bool nbcon_exit_unsafe(struct nbcon_write_context *wctxt);
diff --git a/patches/0053-serial-8250-Switch-to-nbcon-console.patch b/patches/0044-serial-8250-Switch-to-nbcon-console.patch
index 4b999762b1a10..372bef43b69af 100644
--- a/patches/0053-serial-8250-Switch-to-nbcon-console.patch
+++ b/patches/0044-serial-8250-Switch-to-nbcon-console.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 13 Sep 2023 15:30:36 +0000
-Subject: [PATCH 53/57] serial: 8250: Switch to nbcon console
+Subject: [PATCH 44/48] serial: 8250: Switch to nbcon console
Implement the necessary callbacks to switch the 8250 console driver
to perform as an nbcon console.
diff --git a/patches/0054-serial-8250-Revert-drop-lockdep-annotation-from-seri.patch b/patches/0045-serial-8250-Revert-drop-lockdep-annotation-from-seri.patch
index 3df45c058de5e..cb6ba125ccf0b 100644
--- a/patches/0054-serial-8250-Revert-drop-lockdep-annotation-from-seri.patch
+++ b/patches/0045-serial-8250-Revert-drop-lockdep-annotation-from-seri.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Mon, 2 Oct 2023 15:30:43 +0000
-Subject: [PATCH 54/57] serial: 8250: Revert "drop lockdep annotation from
+Subject: [PATCH 45/48] serial: 8250: Revert "drop lockdep annotation from
serial8250_clear_IER()"
The 8250 driver no longer depends on @oops_in_progress and
diff --git a/patches/0055-printk-Add-kthread-for-all-legacy-consoles.patch b/patches/0046-printk-Add-kthread-for-all-legacy-consoles.patch
index b09df70bc5406..59f0e635b52c5 100644
--- a/patches/0055-printk-Add-kthread-for-all-legacy-consoles.patch
+++ b/patches/0046-printk-Add-kthread-for-all-legacy-consoles.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Fri, 22 Sep 2023 17:35:04 +0000
-Subject: [PATCH 55/57] printk: Add kthread for all legacy consoles
+Subject: [PATCH 46/48] printk: Add kthread for all legacy consoles
The write callback of legacy consoles makes use of spinlocks.
This is not permitted with PREEMPT_RT in atomic contexts.
@@ -184,7 +184,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -468,7 +468,7 @@ static DEFINE_MUTEX(syslog_lock);
- * present, it is necessary to perform the console_lock/console_unlock dance
+ * present, it is necessary to perform the console lock/unlock dance
* whenever console flushing should occur.
*/
-static bool have_legacy_console;
@@ -212,7 +212,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/* All 3 protected by @syslog_lock. */
/* the next printk record to read by syslog(READ) or /proc/kmsg */
static u64 syslog_seq;
-@@ -2356,7 +2351,8 @@ asmlinkage int vprintk_emit(int facility
+@@ -2358,7 +2353,8 @@ asmlinkage int vprintk_emit(int facility
const struct dev_printk_info *dev_info,
const char *fmt, va_list args)
{
@@ -222,7 +222,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
int printed_len;
/* Suppress unimportant messages after panic happens */
-@@ -2480,6 +2476,14 @@ EXPORT_SYMBOL(_printk);
+@@ -2481,6 +2477,14 @@ 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);
@@ -237,7 +237,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
#else /* CONFIG_PRINTK */
#define printk_time false
-@@ -2493,6 +2497,8 @@ static u64 syslog_seq;
+@@ -2494,6 +2498,8 @@ static u64 syslog_seq;
static 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; }
@@ -246,7 +246,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
#endif /* CONFIG_PRINTK */
#ifdef CONFIG_EARLY_PRINTK
-@@ -2738,6 +2744,8 @@ void resume_console(void)
+@@ -2739,6 +2745,8 @@ void resume_console(void)
}
console_srcu_read_unlock(cookie);
@@ -255,7 +255,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
pr_flush(1000, true);
}
-@@ -2752,7 +2760,8 @@ void resume_console(void)
+@@ -2753,7 +2761,8 @@ void resume_console(void)
*/
static int console_cpu_notify(unsigned int cpu)
{
@@ -265,7 +265,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/* If trylock fails, someone else is doing the printing */
if (console_trylock())
console_unlock();
-@@ -3012,31 +3021,43 @@ static bool console_emit_next_record(str
+@@ -3013,31 +3022,43 @@ static bool console_emit_next_record(str
con->dropped = 0;
}
@@ -329,7 +329,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
skip:
return true;
}
-@@ -3100,12 +3121,13 @@ static bool console_flush_all(bool do_co
+@@ -3101,12 +3122,13 @@ static bool console_flush_all(bool do_co
if ((flags & CON_NBCON) && con->kthread)
continue;
@@ -345,7 +345,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
printk_seq = nbcon_seq_read(con);
} else {
progress = console_emit_next_record(con, handover, cookie);
-@@ -3144,19 +3166,7 @@ static bool console_flush_all(bool do_co
+@@ -3145,19 +3167,7 @@ static bool console_flush_all(bool do_co
return false;
}
@@ -366,7 +366,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
{
bool do_cond_resched;
bool handover;
-@@ -3200,6 +3210,32 @@ void console_unlock(void)
+@@ -3201,6 +3211,32 @@ void console_unlock(void)
*/
} while (prb_read_valid(prb, next_seq, NULL) && console_trylock());
}
@@ -399,7 +399,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
EXPORT_SYMBOL(console_unlock);
/**
-@@ -3409,11 +3445,106 @@ void console_start(struct console *conso
+@@ -3410,11 +3446,106 @@ void console_start(struct console *conso
if (flags & CON_NBCON)
nbcon_kthread_wake(console);
@@ -506,7 +506,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
static int __read_mostly keep_bootcon;
static int __init keep_bootcon_setup(char *str)
-@@ -3690,6 +3821,7 @@ void register_console(struct console *ne
+@@ -3691,6 +3822,7 @@ void register_console(struct console *ne
newcon->seq = 0;
} else {
have_legacy_console = true;
@@ -514,7 +514,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
}
if (newcon->flags & CON_BOOT)
-@@ -3845,6 +3977,13 @@ static int unregister_console_locked(str
+@@ -3846,6 +3978,13 @@ static int unregister_console_locked(str
nbcon_kthread_create(c);
}
@@ -543,7 +543,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
console_lock();
console_unlock();
}
-@@ -4120,9 +4263,16 @@ static void wake_up_klogd_work_func(stru
+@@ -4119,9 +4262,16 @@ static void wake_up_klogd_work_func(stru
int pending = this_cpu_xchg(printk_pending, 0);
if (pending & PRINTK_PENDING_OUTPUT) {
diff --git a/patches/0056-printk-Provide-threadprintk-boot-argument.patch b/patches/0047-printk-Provide-threadprintk-boot-argument.patch
index 6a7d107395da6..2d9df0b0735b1 100644
--- a/patches/0056-printk-Provide-threadprintk-boot-argument.patch
+++ b/patches/0047-printk-Provide-threadprintk-boot-argument.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Tue, 6 Feb 2024 14:19:34 +0000
-Subject: [PATCH 56/57] printk: Provide threadprintk boot argument
+Subject: [PATCH 47/48] printk: Provide threadprintk boot argument
For PREEMPT_RT, legacy console printing is performed in a dedicated
kthread. However, this behavior can also be interesting for other
diff --git a/patches/0057-printk-Avoid-false-positive-lockdep-report-for-legac.patch b/patches/0048-printk-Avoid-false-positive-lockdep-report-for-legac.patch
index 4fa84e69bcdb4..2bbfb48a479fd 100644
--- a/patches/0057-printk-Avoid-false-positive-lockdep-report-for-legac.patch
+++ b/patches/0048-printk-Avoid-false-positive-lockdep-report-for-legac.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Mon, 11 Dec 2023 09:34:16 +0000
-Subject: [PATCH 57/57] printk: Avoid false positive lockdep report for legacy
+Subject: [PATCH 48/48] printk: Avoid false positive lockdep report for legacy
printing
Legacy console printing from printk() caller context may invoke
@@ -30,7 +30,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
-@@ -2984,6 +2984,33 @@ bool printk_get_next_message(struct prin
+@@ -2985,6 +2985,33 @@ bool printk_get_next_message(struct prin
}
/*
@@ -64,7 +64,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
* Used as the printk buffers for non-panic, serialized console printing.
* This is for legacy (!CON_NBCON) as well as all boot (CON_BOOT) consoles.
* Its usage requires the console_lock held.
-@@ -3038,7 +3065,7 @@ static bool console_emit_next_record(str
+@@ -3039,7 +3066,7 @@ static bool console_emit_next_record(str
/*
* With forced threading this function is either in a thread
* or panic context. So there is no need for concern about
@@ -73,7 +73,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
*/
con->write(con, outbuf, pmsg.outbuf_len);
-@@ -3060,7 +3087,9 @@ static bool console_emit_next_record(str
+@@ -3061,7 +3088,9 @@ static bool console_emit_next_record(str
/* Do not trace print latency. */
stop_critical_timings();
diff --git a/patches/Add_localversion_for_-RT_release.patch b/patches/Add_localversion_for_-RT_release.patch
index 6b1364508a7ca..34da917f8c9e8 100644
--- a/patches/Add_localversion_for_-RT_release.patch
+++ b/patches/Add_localversion_for_-RT_release.patch
@@ -15,4 +15,4 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
--- /dev/null
+++ b/localversion-rt
@@ -0,0 +1 @@
-+-rt10
++-rt11
diff --git a/patches/PREEMPT_AUTO.patch b/patches/PREEMPT_AUTO.patch
index 989a4f8fadbbc..7f08c036fb830 100644
--- a/patches/PREEMPT_AUTO.patch
+++ b/patches/PREEMPT_AUTO.patch
@@ -665,7 +665,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
return;
}
hrtick_start(rq, delta);
-@@ -8298,7 +8314,7 @@ static void check_preempt_wakeup_fair(st
+@@ -8304,7 +8320,7 @@ static void check_preempt_wakeup_fair(st
* prevents us from potentially nominating it as a false LAST_BUDDY
* below.
*/
@@ -674,7 +674,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
return;
/* Idle tasks are by definition preempted by non-idle tasks. */
-@@ -8340,7 +8356,7 @@ static void check_preempt_wakeup_fair(st
+@@ -8346,7 +8362,7 @@ static void check_preempt_wakeup_fair(st
return;
preempt:
@@ -683,7 +683,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
}
#ifdef CONFIG_SMP
-@@ -12510,7 +12526,7 @@ static inline void task_tick_core(struct
+@@ -12516,7 +12532,7 @@ static inline void task_tick_core(struct
*/
if (rq->core->core_forceidle_count && rq->cfs.nr_running == 1 &&
__entity_slice_used(&curr->se, MIN_NR_TASKS_DURING_FORCEIDLE))
@@ -692,7 +692,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
}
/*
-@@ -12675,7 +12691,7 @@ prio_changed_fair(struct rq *rq, struct
+@@ -12681,7 +12697,7 @@ prio_changed_fair(struct rq *rq, struct
*/
if (task_current(rq, p)) {
if (p->prio > oldprio)
diff --git a/patches/series b/patches/series
index c336707f1ee06..8c377299081e4 100644
--- a/patches/series
+++ b/patches/series
@@ -74,54 +74,54 @@ zram-Replace-bit-spinlocks-with-spinlock_t-for-PREEM.patch
###########################################################################
# John's printk queue
###########################################################################
-0005-printk-ringbuffer-Clarify-special-lpos-values.patch
-0006-printk-For-suppress_panic_printk-check-for-other-CPU.patch
-0012-printk-Avoid-non-panic-CPUs-writing-to-ringbuffer.patch
-0013-panic-Flush-kernel-log-buffer-at-the-end.patch
-0014-dump_stack-Do-not-get-cpu_sync-for-panic-CPU.patch
-0015-printk-Add-notation-to-console_srcu-locking.patch
-0016-printk-Properly-deal-with-nbcon-consoles-on-seq-init.patch
-0017-printk-nbcon-Remove-return-value-for-write_atomic.patch
-0018-printk-Check-printk_deferred_enter-_exit-usage.patch
-0019-serial-core-Provide-low-level-functions-to-port-lock.patch
-0020-printk-nbcon-Add-detailed-doc-for-write_atomic.patch
-0021-printk-nbcon-Add-callbacks-to-synchronize-with-drive.patch
-0022-printk-nbcon-Add-consoles-with-driver-synchronizatio.patch
-0023-printk-nbcon-Implement-processing-in-port-lock-wrapp.patch
-0024-printk-nbcon-Do-not-rely-on-proxy-headers.patch
-0025-printk-nbcon-Fix-kerneldoc-for-enums.patch
-0026-printk-Make-console_is_usable-available-to-nbcon.patch
-0027-printk-Let-console_is_usable-handle-nbcon.patch
-0028-printk-Add-flags-argument-for-console_is_usable.patch
-0029-printk-nbcon-Provide-function-to-flush-using-write_a.patch
-0030-printk-Track-registered-boot-consoles.patch
-0031-printk-nbcon-Use-nbcon-consoles-in-console_flush_all.patch
-0032-printk-nbcon-Assign-priority-based-on-CPU-state.patch
-0033-printk-nbcon-Add-unsafe-flushing-on-panic.patch
-0034-printk-Avoid-console_lock-dance-if-no-legacy-or-boot.patch
-0035-printk-Track-nbcon-consoles.patch
-0036-printk-Coordinate-direct-printing-in-panic.patch
-0037-printk-nbcon-Implement-emergency-sections.patch
-0038-printk-Provide-helper-for-message-prepending.patch
-0039-printk-nbcon-show-replay-message-on-takeover.patch
-0040-panic-Mark-emergency-section-in-warn.patch
-0041-panic-Mark-emergency-section-in-oops.patch
-0042-rcu-Mark-emergency-section-in-rcu-stalls.patch
-0043-lockdep-Mark-emergency-sections-in-lockdep-splats.patch
-0044-printk-nbcon-Introduce-printing-kthreads.patch
-0045-printk-Atomic-print-in-printk-context-on-shutdown.patch
-0046-printk-nbcon-Add-context-to-console_is_usable.patch
-0047-printk-nbcon-Add-printer-thread-wakeups.patch
-0048-printk-nbcon-Stop-threads-on-shutdown-reboot.patch
-0049-printk-nbcon-Start-printing-threads.patch
-0050-proc-Add-nbcon-support-for-proc-consoles.patch
-0051-tty-sysfs-Add-nbcon-support-for-active.patch
-0052-printk-nbcon-Provide-function-to-reacquire-ownership.patch
-0053-serial-8250-Switch-to-nbcon-console.patch
-0054-serial-8250-Revert-drop-lockdep-annotation-from-seri.patch
-0055-printk-Add-kthread-for-all-legacy-consoles.patch
-0056-printk-Provide-threadprintk-boot-argument.patch
-0057-printk-Avoid-false-positive-lockdep-report-for-legac.patch
+0001-printk-ringbuffer-Clarify-special-lpos-values.patch
+0002-printk-For-suppress_panic_printk-check-for-other-CPU.patch
+0003-printk-Avoid-non-panic-CPUs-writing-to-ringbuffer.patch
+0004-panic-Flush-kernel-log-buffer-at-the-end.patch
+0005-dump_stack-Do-not-get-cpu_sync-for-panic-CPU.patch
+0006-printk-Add-notation-to-console_srcu-locking.patch
+0007-printk-Properly-deal-with-nbcon-consoles-on-seq-init.patch
+0008-printk-nbcon-Remove-return-value-for-write_atomic.patch
+0009-printk-Check-printk_deferred_enter-_exit-usage.patch
+0010-printk-nbcon-Add-detailed-doc-for-write_atomic.patch
+0011-printk-nbcon-Add-callbacks-to-synchronize-with-drive.patch
+0012-printk-nbcon-Use-driver-synchronization-while-regist.patch
+0013-serial-core-Provide-low-level-functions-to-lock-port.patch
+0014-printk-nbcon-Implement-processing-in-port-lock-wrapp.patch
+0015-printk-nbcon-Do-not-rely-on-proxy-headers.patch
+0016-printk-nbcon-Fix-kerneldoc-for-enums.patch
+0017-printk-Make-console_is_usable-available-to-nbcon.patch
+0018-printk-Let-console_is_usable-handle-nbcon.patch
+0019-printk-Add-flags-argument-for-console_is_usable.patch
+0020-printk-nbcon-Provide-function-to-flush-using-write_a.patch
+0021-printk-Track-registered-boot-consoles.patch
+0022-printk-nbcon-Use-nbcon-consoles-in-console_flush_all.patch
+0023-printk-nbcon-Assign-priority-based-on-CPU-state.patch
+0024-printk-nbcon-Add-unsafe-flushing-on-panic.patch
+0025-printk-Avoid-console_lock-dance-if-no-legacy-or-boot.patch
+0026-printk-Track-nbcon-consoles.patch
+0027-printk-Coordinate-direct-printing-in-panic.patch
+0028-printk-nbcon-Implement-emergency-sections.patch
+0029-panic-Mark-emergency-section-in-warn.patch
+0030-panic-Mark-emergency-section-in-oops.patch
+0031-rcu-Mark-emergency-sections-in-rcu-stalls.patch
+0032-lockdep-Mark-emergency-sections-in-lockdep-splats.patch
+0033-printk-nbcon-Introduce-printing-kthreads.patch
+0034-printk-Atomic-print-in-printk-context-on-shutdown.patch
+0035-printk-nbcon-Add-context-to-console_is_usable.patch
+0036-printk-nbcon-Add-printer-thread-wakeups.patch
+0037-printk-nbcon-Stop-threads-on-shutdown-reboot.patch
+0038-printk-nbcon-Start-printing-threads.patch
+0039-printk-Provide-helper-for-message-prepending.patch
+0040-printk-nbcon-Show-replay-message-on-takeover.patch
+0041-proc-Add-nbcon-support-for-proc-consoles.patch
+0042-tty-sysfs-Add-nbcon-support-for-active.patch
+0043-printk-nbcon-Provide-function-to-reacquire-ownership.patch
+0044-serial-8250-Switch-to-nbcon-console.patch
+0045-serial-8250-Revert-drop-lockdep-annotation-from-seri.patch
+0046-printk-Add-kthread-for-all-legacy-consoles.patch
+0047-printk-Provide-threadprintk-boot-argument.patch
+0048-printk-Avoid-false-positive-lockdep-report-for-legac.patch
###########################################################################
# DRM: