summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2022-04-29 16:56:11 +0200
committerSebastian Andrzej Siewior <bigeasy@linutronix.de>2022-04-29 16:56:11 +0200
commit380fa9136bcc8baa44030164305239a0f41a6b0b (patch)
tree49ea73e6060e9789d686f343cb4176cfbee38637
parente18f374c9f24f135a4ec660d587bfd3209bec8bb (diff)
downloadlinux-rt-380fa9136bcc8baa44030164305239a0f41a6b0b.tar.gz
[ANNOUNCE] v5.18-rc4-rt3v5.18-rc4-rt3-patches
Dear RT folks! I'm pleased to announce the v5.18-rc4-rt3 patch set. Changes since v5.18-rc4-rt2: - Update John's printk series to v4. Known issues - Valentin Schneider reported a few splats on ARM64, see https://lkml.kernel.org/r/20210810134127.1394269-1-valentin.schneider@arm.com The delta patch against v5.18-rc4-rt2 is appended below and can be found here: https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.18/incr/patch-5.18-rc4-rt2-rt3.patch.xz You can get this release via the git tree at: git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git v5.18-rc4-rt3 The RT patch against v5.18-rc4 can be found here: https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.18/older/patch-5.18-rc4-rt3.patch.xz The split quilt queue is available at: https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.18/older/patches-5.18-rc4-rt3.tar.xz Sebastian Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
-rw-r--r--patches/0001-printk-rename-cpulock-functions.patch3
-rw-r--r--patches/0002-printk-cpu-sync-always-disable-interrupts.patch3
-rw-r--r--patches/0003-printk-add-missing-memory-barrier-to-wake_up_klogd.patch3
-rw-r--r--patches/0004-printk-wake-up-all-waiters.patch3
-rw-r--r--patches/0005-printk-wake-waiters-for-safe-and-NMI-contexts.patch3
-rw-r--r--patches/0006-printk-get-caller_id-timestamp-after-migration-disab.patch3
-rw-r--r--patches/0007-printk-call-boot_delay_msec-in-printk_delay.patch3
-rw-r--r--patches/0008-printk-add-con_printk-macro-for-console-details.patch3
-rw-r--r--patches/0009-printk-refactor-and-rework-printing-logic.patch3
-rw-r--r--patches/0010-printk-move-buffer-definitions-into-console_emit_nex.patch3
-rw-r--r--patches/0011-printk-add-pr_flush.patch3
-rw-r--r--patches/0012-printk-add-functions-to-prefer-direct-printing.patch3
-rw-r--r--patches/0013-printk-add-kthread-console-printers.patch3
-rw-r--r--patches/0014-printk-extend-console_lock-for-per-console-locking.patch (renamed from patches/0014-printk-extend-console_lock-for-proper-kthread-suppor.patch)261
-rw-r--r--patches/0015-printk-remove-console_locked.patch29
-rw-r--r--patches/0016-printk-add-infrastucture-for-atomic-consoles.patch (renamed from patches/0001-printk-add-infrastucture-for-atomic-consoles.patch)75
-rw-r--r--patches/0017-serial-8250-implement-write_atomic.patch (renamed from patches/0002-serial-8250-implement-write_atomic.patch)75
-rw-r--r--patches/0018-printk-avoid-preempt_disable-for-PREEMPT_RT.patch (renamed from patches/0003-printk-avoid-preempt_disable-for-PREEMPT_RT.patch)4
-rw-r--r--patches/Add_localversion_for_-RT_release.patch2
-rw-r--r--patches/series9
20 files changed, 186 insertions, 308 deletions
diff --git a/patches/0001-printk-rename-cpulock-functions.patch b/patches/0001-printk-rename-cpulock-functions.patch
index 88c05b2c1f13..dd8a16c132cf 100644
--- a/patches/0001-printk-rename-cpulock-functions.patch
+++ b/patches/0001-printk-rename-cpulock-functions.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 20 Apr 2022 01:52:23 +0206
-Subject: [PATCH 01/15] printk: rename cpulock functions
+Subject: [PATCH 01/18] printk: rename cpulock functions
Since the printk cpulock is CPU-reentrant and since it is used
in all contexts, its usage must be carefully considered and
@@ -18,6 +18,7 @@ Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20220419234637.357112-2-john.ogness@linutronix.de
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/printk.h | 54 ++++++++++++++++++++++---------------
kernel/printk/printk.c | 71 ++++++++++++++++++++++++-------------------------
diff --git a/patches/0002-printk-cpu-sync-always-disable-interrupts.patch b/patches/0002-printk-cpu-sync-always-disable-interrupts.patch
index 79b7662a92d0..f52b200ef603 100644
--- a/patches/0002-printk-cpu-sync-always-disable-interrupts.patch
+++ b/patches/0002-printk-cpu-sync-always-disable-interrupts.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 20 Apr 2022 01:52:24 +0206
-Subject: [PATCH 02/15] printk: cpu sync always disable interrupts
+Subject: [PATCH 02/18] printk: cpu sync always disable interrupts
The CPU sync functions are a NOP for !CONFIG_SMP. But for
!CONFIG_SMP they still need to disable interrupts in order to
@@ -11,6 +11,7 @@ Reviewed-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20220419234637.357112-3-john.ogness@linutronix.de
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/printk.h | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/patches/0003-printk-add-missing-memory-barrier-to-wake_up_klogd.patch b/patches/0003-printk-add-missing-memory-barrier-to-wake_up_klogd.patch
index f284c6344df1..f12d17680c71 100644
--- a/patches/0003-printk-add-missing-memory-barrier-to-wake_up_klogd.patch
+++ b/patches/0003-printk-add-missing-memory-barrier-to-wake_up_klogd.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 20 Apr 2022 01:52:25 +0206
-Subject: [PATCH 03/15] printk: add missing memory barrier to wake_up_klogd()
+Subject: [PATCH 03/18] printk: add missing memory barrier to wake_up_klogd()
It is important that any new records are visible to preparing
waiters before the waker checks if the wait queue is empty.
@@ -19,6 +19,7 @@ includes the necessary full memory barrier.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20220419234637.357112-4-john.ogness@linutronix.de
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/printk/printk.c | 39 ++++++++++++++++++++++++++++++++++++---
1 file changed, 36 insertions(+), 3 deletions(-)
diff --git a/patches/0004-printk-wake-up-all-waiters.patch b/patches/0004-printk-wake-up-all-waiters.patch
index 640a0ba4c84e..d4e52e5cf4fc 100644
--- a/patches/0004-printk-wake-up-all-waiters.patch
+++ b/patches/0004-printk-wake-up-all-waiters.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 20 Apr 2022 01:52:26 +0206
-Subject: [PATCH 04/15] printk: wake up all waiters
+Subject: [PATCH 04/18] printk: wake up all waiters
There can be multiple tasks waiting for new records. They should
all be woken. Use wake_up_interruptible_all() instead of
@@ -9,6 +9,7 @@ wake_up_interruptible().
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20220419234637.357112-5-john.ogness@linutronix.de
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/printk/printk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/patches/0005-printk-wake-waiters-for-safe-and-NMI-contexts.patch b/patches/0005-printk-wake-waiters-for-safe-and-NMI-contexts.patch
index 357164da0fd7..51681069edfe 100644
--- a/patches/0005-printk-wake-waiters-for-safe-and-NMI-contexts.patch
+++ b/patches/0005-printk-wake-waiters-for-safe-and-NMI-contexts.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 20 Apr 2022 01:52:27 +0206
-Subject: [PATCH 05/15] printk: wake waiters for safe and NMI contexts
+Subject: [PATCH 05/18] printk: wake waiters for safe and NMI contexts
When printk() is called from safe or NMI contexts, it will directly
store the record (vprintk_store()) and then defer the console output.
@@ -14,6 +14,7 @@ Fixes: 03fc7f9c99c1 ("printk/nmi: Prevent deadlock when accessing the main log b
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20220419234637.357112-6-john.ogness@linutronix.de
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/printk/printk.c | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/patches/0006-printk-get-caller_id-timestamp-after-migration-disab.patch b/patches/0006-printk-get-caller_id-timestamp-after-migration-disab.patch
index 1ef9f1a3dff8..063b4589c1f1 100644
--- a/patches/0006-printk-get-caller_id-timestamp-after-migration-disab.patch
+++ b/patches/0006-printk-get-caller_id-timestamp-after-migration-disab.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 20 Apr 2022 01:52:28 +0206
-Subject: [PATCH 06/15] printk: get caller_id/timestamp after migration disable
+Subject: [PATCH 06/18] printk: get caller_id/timestamp after migration disable
Currently the local CPU timestamp and caller_id for the record are
collected while migration is enabled. Since this information is
@@ -15,6 +15,7 @@ Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20220419234637.357112-7-john.ogness@linutronix.de
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/printk/printk.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/patches/0007-printk-call-boot_delay_msec-in-printk_delay.patch b/patches/0007-printk-call-boot_delay_msec-in-printk_delay.patch
index ce20eb0bc3fe..ce6ce26e4a24 100644
--- a/patches/0007-printk-call-boot_delay_msec-in-printk_delay.patch
+++ b/patches/0007-printk-call-boot_delay_msec-in-printk_delay.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 20 Apr 2022 01:52:29 +0206
-Subject: [PATCH 07/15] printk: call boot_delay_msec() in printk_delay()
+Subject: [PATCH 07/18] printk: call boot_delay_msec() in printk_delay()
boot_delay_msec() is always called immediately before printk_delay()
so just call it from within printk_delay().
@@ -10,6 +10,7 @@ Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20220419234637.357112-8-john.ogness@linutronix.de
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/printk/printk.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/patches/0008-printk-add-con_printk-macro-for-console-details.patch b/patches/0008-printk-add-con_printk-macro-for-console-details.patch
index 8ef4569e0731..5a854e15ff73 100644
--- a/patches/0008-printk-add-con_printk-macro-for-console-details.patch
+++ b/patches/0008-printk-add-con_printk-macro-for-console-details.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 20 Apr 2022 01:52:30 +0206
-Subject: [PATCH 08/15] printk: add con_printk() macro for console details
+Subject: [PATCH 08/18] printk: add con_printk() macro for console details
It is useful to generate log messages that include details about
the related console. Rather than duplicate the code to assemble
@@ -12,6 +12,7 @@ users.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20220419234637.357112-9-john.ogness@linutronix.de
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/printk/printk.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/patches/0009-printk-refactor-and-rework-printing-logic.patch b/patches/0009-printk-refactor-and-rework-printing-logic.patch
index 6e3d8b8400de..42c448f373a9 100644
--- a/patches/0009-printk-refactor-and-rework-printing-logic.patch
+++ b/patches/0009-printk-refactor-and-rework-printing-logic.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 20 Apr 2022 01:52:31 +0206
-Subject: [PATCH 09/15] printk: refactor and rework printing logic
+Subject: [PATCH 09/18] printk: refactor and rework printing logic
Refactor/rework printing logic in order to prepare for moving to
threaded console printing.
@@ -28,6 +28,7 @@ newly added console is still replaying.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20220419234637.357112-10-john.ogness@linutronix.de
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/console.h | 2
kernel/printk/printk.c | 441 ++++++++++++++++++++++++------------------------
diff --git a/patches/0010-printk-move-buffer-definitions-into-console_emit_nex.patch b/patches/0010-printk-move-buffer-definitions-into-console_emit_nex.patch
index 56b3e26672b8..272ef33df02c 100644
--- a/patches/0010-printk-move-buffer-definitions-into-console_emit_nex.patch
+++ b/patches/0010-printk-move-buffer-definitions-into-console_emit_nex.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 20 Apr 2022 01:52:32 +0206
-Subject: [PATCH 10/15] printk: move buffer definitions into
+Subject: [PATCH 10/18] printk: move buffer definitions into
console_emit_next_record() caller
Extended consoles print extended messages and do not print messages about
@@ -27,6 +27,7 @@ Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20220419234637.357112-11-john.ogness@linutronix.de
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/printk/printk.c | 60 +++++++++++++++++++++++++++++++++++--------------
1 file changed, 43 insertions(+), 17 deletions(-)
diff --git a/patches/0011-printk-add-pr_flush.patch b/patches/0011-printk-add-pr_flush.patch
index 042c619867ee..f7ebf3bbc231 100644
--- a/patches/0011-printk-add-pr_flush.patch
+++ b/patches/0011-printk-add-pr_flush.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 20 Apr 2022 01:52:33 +0206
-Subject: [PATCH 11/15] printk: add pr_flush()
+Subject: [PATCH 11/18] printk: add pr_flush()
Provide a might-sleep function to allow waiting for console printers
to catch up to the latest logged message.
@@ -12,6 +12,7 @@ console_stop(), console_start(), console_unblank().
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20220419234637.357112-12-john.ogness@linutronix.de
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/printk.h | 7 ++++
kernel/printk/printk.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++++
diff --git a/patches/0012-printk-add-functions-to-prefer-direct-printing.patch b/patches/0012-printk-add-functions-to-prefer-direct-printing.patch
index 2533e3afa26f..73591bbdd0d2 100644
--- a/patches/0012-printk-add-functions-to-prefer-direct-printing.patch
+++ b/patches/0012-printk-add-functions-to-prefer-direct-printing.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 20 Apr 2022 01:52:34 +0206
-Subject: [PATCH 12/15] printk: add functions to prefer direct printing
+Subject: [PATCH 12/18] printk: add functions to prefer direct printing
Once kthread printing is available, console printing will no longer
occur in the context of the printk caller. However, there are some
@@ -44,6 +44,7 @@ Reviewed-by: Petr Mladek <pmladek@suse.com>
Acked-by: Paul E. McKenney <paulmck@kernel.org> # for RCU
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20220419234637.357112-13-john.ogness@linutronix.de
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
drivers/tty/sysrq.c | 2 ++
include/linux/printk.h | 11 +++++++++++
diff --git a/patches/0013-printk-add-kthread-console-printers.patch b/patches/0013-printk-add-kthread-console-printers.patch
index 8e813ebc60a7..e4972b11c211 100644
--- a/patches/0013-printk-add-kthread-console-printers.patch
+++ b/patches/0013-printk-add-kthread-console-printers.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 20 Apr 2022 01:52:35 +0206
-Subject: [PATCH 13/15] printk: add kthread console printers
+Subject: [PATCH 13/18] printk: add kthread console printers
Create a kthread for each console to perform console printing. During
normal operation (@system_state == SYSTEM_RUNNING), the kthread
@@ -42,6 +42,7 @@ is stopped before exit() is called.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20220419234637.357112-14-john.ogness@linutronix.de
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/console.h | 2
kernel/printk/printk.c | 303 ++++++++++++++++++++++++++++++++++++++++++++----
diff --git a/patches/0014-printk-extend-console_lock-for-proper-kthread-suppor.patch b/patches/0014-printk-extend-console_lock-for-per-console-locking.patch
index cd47ef70bc95..13ba352f449e 100644
--- a/patches/0014-printk-extend-console_lock-for-proper-kthread-suppor.patch
+++ b/patches/0014-printk-extend-console_lock-for-per-console-locking.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
-Date: Wed, 20 Apr 2022 01:52:36 +0206
-Subject: [PATCH 14/15] printk: extend console_lock for proper kthread support
+Date: Mon, 25 Apr 2022 23:04:28 +0206
+Subject: [PATCH 14/18] printk: extend console_lock for per-console locking
Currently threaded console printers synchronize against each
other using console_lock(). However, different console drivers
@@ -11,33 +11,22 @@ speed.
But the threaded consoles printers do still need to synchronize
against console_lock() callers. Introduce a per-console mutex
-and a new console flag CON_THD_BLOCKED to provide this
+and a new console boolean field @blocked to provide this
synchronization.
console_lock() is modified so that it must acquire the mutex
-of each console in order to set the CON_THD_BLOCKED flag.
-Console printing threads will acquire their mutex while
-printing a record. If CON_THD_BLOCKED was set, the thread will
-go back to sleep instead of printing.
+of each console in order to set the @blocked field. Console
+printing threads will acquire their mutex while printing a
+record. If @blocked was set, the thread will go back to sleep
+instead of printing.
-The reason for the CON_THD_BLOCKED flag is so that
+The reason for the @blocked boolean field is so that
console_lock() callers do not need to acquire multiple console
mutexes simultaneously, which would introduce unnecessary
-complexity due to nested mutex locking.
-
-The per-console mutex is also used to synchronize setting and
-checking the CON_ENABLED flag. A new console_lock() variant is
-introduced, console_lock_single_hold(), that allows acquiring
-@console_sem but only locking (and holding) the mutex of a
-single console. This allows safely enabling and disabling
-consoles without disturbing the other kthread printers. The
-mutex and @console_sem are released with
-console_unlock_single_release().
-
-Console unregistering now uses console_lock_single_hold() to
-stop the kthread. Thus con->thread is now synchronized by
-the per-console mutex. This allows consoles to be unregistered
-without disturbing the other kthread printers.
+complexity due to nested mutex locking. Also, a new field
+was chosen instead of adding a new @flags value so that the
+blocked status could be checked without concern of reading
+inconsistent values due to @flags updates from other contexts.
Threaded console printers also need to synchronize against
console_trylock() callers. Since console_trylock() may be
@@ -59,7 +48,7 @@ console_lock()
down(&console_sem);
for_each_console(con) {
mutex_lock(&con->lock);
- con->flags |= CON_THD_BLOCKED;
+ con->blocked = true;
mutex_unlock(&con->lock);
}
/* console_lock acquired */
@@ -77,7 +66,7 @@ console_trylock()
threaded_printer()
{
mutex_lock(&con->lock);
- if (!(con->flags & CON_THD_BLOCKED)) {
+ if (!con->blocked) {
/* console_lock() callers blocked */
if (atomic_inc_unless_negative(&console_kthreads_active)) {
@@ -109,17 +98,16 @@ This means wake_up_klogd() calls following a console_unlock() are
no longer necessary and are removed.
Also note that threaded printers no longer need to check
-@console_suspended. The check for the CON_THD_BLOCKED flag
-implicitly covers the suspended console case.
+@console_suspended. The check for the @blocked field implicitly
+covers the suspended console case.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
-Reported-by: kernel test robot <lkp@intel.com>
+Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
-Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.de
---
include/linux/console.h | 15 ++
- kernel/printk/printk.c | 295 ++++++++++++++++++++++++++++++++++++------------
- 2 files changed, 242 insertions(+), 68 deletions(-)
+ kernel/printk/printk.c | 261 +++++++++++++++++++++++++++++++++++++-----------
+ 2 files changed, 220 insertions(+), 56 deletions(-)
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -131,23 +119,17 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
struct vc_data;
struct console_font_op;
-@@ -136,6 +137,7 @@ static inline int con_debug_leave(void)
- #define CON_ANYTIME (16) /* Safe to call when cpu is offline */
- #define CON_BRL (32) /* Used for a braille device */
- #define CON_EXTENDED (64) /* Use the extended output format a la /dev/kmsg */
-+#define CON_THD_BLOCKED (128) /* Thread blocked because console is locked */
-
- struct console {
- char name[16];
-@@ -155,6 +157,19 @@ struct console {
+@@ -154,6 +155,20 @@ struct console {
+ u64 seq;
unsigned long dropped;
struct task_struct *thread;
-
++ bool blocked;
++
+ /*
+ * The per-console lock is used by printing kthreads to synchronize
+ * this console with callers of console_lock(). This is necessary in
+ * order to allow printing kthreads to run in parallel to each other,
-+ * while each safely accessing their own @flags and synchronizing
++ * while each safely accessing the @blocked field and synchronizing
+ * against direct printing via console_lock/console_unlock.
+ *
+ * Note: For synchronizing against direct printing via
@@ -155,10 +137,9 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
+ * variable @console_kthreads_active.
+ */
+ struct mutex lock;
-+
+
void *data;
struct console *next;
- };
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -224,6 +224,33 @@ int devkmsg_sysctl_set_loglvl(struct ctl
@@ -201,7 +182,7 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
/*
+ * Tracks whether kthread printers are all blocked. A value of true implies
+ * that the console is locked via console_lock() or the console is suspended.
-+ * Reading and writing to this variable requires holding @console_sem.
++ * Writing to this variable requires holding @console_sem.
+ */
+static bool console_kthreads_blocked;
+
@@ -216,7 +197,7 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
+
+ for_each_console(con) {
+ mutex_lock(&con->lock);
-+ con->flags |= CON_THD_BLOCKED;
++ con->blocked = true;
+ mutex_unlock(&con->lock);
+ }
+
@@ -234,7 +215,7 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
+
+ for_each_console(con) {
+ mutex_lock(&con->lock);
-+ con->flags &= ~CON_THD_BLOCKED;
++ con->blocked = false;
+ mutex_unlock(&con->lock);
+ }
+
@@ -259,7 +240,7 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
pr_flush(1000, true);
}
-@@ -2603,9 +2666,10 @@ static int console_cpu_notify(unsigned i
+@@ -2603,9 +2666,14 @@ static int console_cpu_notify(unsigned i
/* If trylock fails, someone else is doing the printing */
if (console_trylock())
console_unlock();
@@ -267,13 +248,17 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
- /* Wake kthread printers. Some may have become usable. */
- wake_up_klogd();
+ else {
-+ /* Some kthread printers may have become usable. */
++ /*
++ * If a new CPU comes online, the conditions for
++ * printer_should_wake() may have changed for some
++ * kthread printer with !CON_ANYTIME.
++ */
+ wake_up_klogd();
+ }
}
return 0;
}
-@@ -2625,11 +2689,33 @@ void console_lock(void)
+@@ -2625,6 +2693,7 @@ void console_lock(void)
down_console_sem();
if (console_suspended)
return;
@@ -281,33 +266,7 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
console_locked = 1;
console_may_schedule = 1;
}
- EXPORT_SYMBOL(console_lock);
-
-+/*
-+ * Lock the console_lock, but rather than blocking all the kthread printers,
-+ * lock a specified kthread printer and hold the lock. This is useful if
-+ * console flags for a particular console need to be updated.
-+ */
-+static void console_lock_single_hold(struct console *con)
-+{
-+ might_sleep();
-+ down_console_sem();
-+ mutex_lock(&con->lock);
-+ console_locked = 1;
-+ console_may_schedule = 1;
-+}
-+
-+static void console_unlock_single_release(struct console *con)
-+{
-+ console_locked = 0;
-+ mutex_unlock(&con->lock);
-+ up_console_sem();
-+}
-+
- /**
- * console_trylock - try to lock the console system for exclusive use.
- *
-@@ -2646,6 +2732,10 @@ int console_trylock(void)
+@@ -2646,6 +2715,10 @@ int console_trylock(void)
up_console_sem();
return 0;
}
@@ -318,7 +277,7 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
console_locked = 1;
console_may_schedule = 0;
return 1;
-@@ -2654,7 +2744,7 @@ EXPORT_SYMBOL(console_trylock);
+@@ -2654,7 +2727,7 @@ EXPORT_SYMBOL(console_trylock);
int is_console_locked(void)
{
@@ -327,16 +286,16 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
}
EXPORT_SYMBOL(is_console_locked);
-@@ -2698,7 +2788,7 @@ static inline bool __console_is_usable(s
+@@ -2698,7 +2771,7 @@ static inline bool __console_is_usable(s
* Check if the given console is currently capable and allowed to print
* records.
*
- * Requires the console_lock.
-+ * Requires holding the console_lock or con->lock.
++ * Requires holding the console_lock.
*/
static inline bool console_is_usable(struct console *con)
{
-@@ -2711,6 +2801,22 @@ static inline bool console_is_usable(str
+@@ -2711,6 +2784,22 @@ static inline bool console_is_usable(str
static void __console_unlock(void)
{
console_locked = 0;
@@ -359,7 +318,7 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
up_console_sem();
}
-@@ -2728,17 +2834,18 @@ static void __console_unlock(void)
+@@ -2728,17 +2817,19 @@ static void __console_unlock(void)
*
* @handover will be set to true if a printk waiter has taken over the
* console_lock, in which case the caller is no longer holding the
@@ -372,6 +331,7 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
*
- * Requires the console_lock.
+ * Requires the console_lock if @handover is non-NULL.
++ * Requires con->lock otherwise.
*/
-static bool console_emit_next_record(struct console *con, char *text, char *ext_text,
- char *dropped_text, bool *handover)
@@ -383,7 +343,7 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
struct printk_info info;
struct printk_record r;
unsigned long flags;
-@@ -2747,7 +2854,8 @@ static bool console_emit_next_record(str
+@@ -2747,7 +2838,8 @@ static bool console_emit_next_record(str
prb_rec_init_rd(&r, &info, text, CONSOLE_LOG_MAX);
@@ -393,7 +353,7 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
if (!prb_read_valid(prb, con->seq, &r))
return false;
-@@ -2755,7 +2863,8 @@ static bool console_emit_next_record(str
+@@ -2755,7 +2847,8 @@ static bool console_emit_next_record(str
if (con->seq != r.info->seq) {
con->dropped += r.info->seq - con->seq;
con->seq = r.info->seq;
@@ -403,7 +363,7 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
suppress_panic_printk = 1;
pr_warn_once("Too many dropped messages. Suppress messages on non-panic CPUs to prevent livelock.\n");
}
-@@ -2777,32 +2886,62 @@ static bool console_emit_next_record(str
+@@ -2777,32 +2870,62 @@ static bool console_emit_next_record(str
len = record_print_text(&r, console_msg_format & MSG_FORMAT_SYSLOG, printk_time);
}
@@ -482,7 +442,7 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
* Print out all remaining records to all consoles.
*
* @do_cond_resched is set by the caller. It can be true only in schedulable
-@@ -2853,13 +2992,11 @@ static bool console_flush_all(bool do_co
+@@ -2853,13 +2976,11 @@ static bool console_flush_all(bool do_co
if (con->flags & CON_EXTENDED) {
/* Extended consoles do not print "dropped messages". */
@@ -500,7 +460,7 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
}
if (*handover)
return false;
-@@ -2974,6 +3111,10 @@ void console_unblank(void)
+@@ -2974,6 +3095,10 @@ void console_unblank(void)
if (oops_in_progress) {
if (down_trylock_console_sem() != 0)
return;
@@ -511,80 +471,27 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
} else
console_lock();
-@@ -3045,21 +3186,20 @@ struct tty_driver *console_device(int *i
- void console_stop(struct console *console)
- {
- __pr_flush(console, 1000, true);
-- console_lock();
-+ console_lock_single_hold(console);
- console->flags &= ~CON_ENABLED;
-- console_unlock();
-+ console_unlock_single_release(console);
- }
- EXPORT_SYMBOL(console_stop);
-
-+
- void console_start(struct console *console)
- {
-- console_lock();
-+ console_lock_single_hold(console);
+@@ -3056,10 +3181,6 @@ void console_start(struct console *conso
+ console_lock();
console->flags |= CON_ENABLED;
-- console_unlock();
+ console_unlock();
-
-+ console_unlock_single_release(console);
- /* Wake the newly enabled kthread printer. */
- wake_up_klogd();
+- /* Wake the newly enabled kthread printer. */
+- wake_up_klogd();
-
__pr_flush(console, 1000, true);
}
EXPORT_SYMBOL(console_start);
-@@ -3261,6 +3401,8 @@ void register_console(struct console *ne
+@@ -3261,6 +3382,8 @@ void register_console(struct console *ne
newcon->dropped = 0;
newcon->thread = NULL;
-+ newcon->flags |= CON_THD_BLOCKED;
++ newcon->blocked = true;
+ mutex_init(&newcon->lock);
if (newcon->flags & CON_PRINTBUFFER) {
/* Get a consistent copy of @syslog_seq. */
-@@ -3314,7 +3456,7 @@ int unregister_console(struct console *c
- return 0;
-
- res = -ENODEV;
-- console_lock();
-+ console_lock_single_hold(console);
- if (console_drivers == console) {
- console_drivers=console->next;
- res = 0;
-@@ -3344,14 +3486,14 @@ int unregister_console(struct console *c
- console->flags &= ~CON_ENABLED;
-
- /*
-- * console->thread can only be cleared under the console lock. But
-- * stopping the thread must be done without the console lock. The
-- * task that clears @thread is the task that stops the kthread.
-+ * console->thread can only be cleared while holding con->lock. But
-+ * stopping the thread must be done without con->lock. The task that
-+ * clears @thread is the task that stops the kthread.
- */
- thd = console->thread;
- console->thread = NULL;
-
-- console_unlock();
-+ console_unlock_single_release(console);
-
- if (thd)
- kthread_stop(thd);
-@@ -3365,7 +3507,7 @@ int unregister_console(struct console *c
-
- out_disable_unlock:
- console->flags &= ~CON_ENABLED;
-- console_unlock();
-+ console_unlock_single_release(console);
-
- return res;
- }
-@@ -3561,6 +3703,19 @@ static void printk_fallback_preferred_di
+@@ -3561,6 +3684,19 @@ static void printk_fallback_preferred_di
console_unlock();
}
@@ -604,29 +511,19 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
static bool printer_should_wake(struct console *con, u64 seq)
{
short flags;
-@@ -3568,9 +3723,6 @@ static bool printer_should_wake(struct c
+@@ -3568,8 +3704,10 @@ static bool printer_should_wake(struct c
if (kthread_should_stop() || !printk_kthreads_available)
return true;
- if (console_suspended)
-- return false;
--
- /*
- * This is an unsafe read from con->flags, but a false positive is
- * not a problem. Worst case it would allow the printer to wake up
-@@ -3582,6 +3734,11 @@ static bool printer_should_wake(struct c
- if (!__console_is_usable(flags))
- return false;
-
-+ if ((flags & CON_THD_BLOCKED) ||
++ if (con->blocked ||
+ console_kthreads_atomically_blocked()) {
-+ return false;
+ return false;
+ }
-+
- return prb_read_valid(prb, seq, NULL);
- }
-@@ -3590,7 +3747,6 @@ static int printk_kthread_func(void *dat
+ /*
+ * This is an unsafe read from con->flags, but a false positive is
+@@ -3590,7 +3728,6 @@ static int printk_kthread_func(void *dat
struct console *con = data;
char *dropped_text = NULL;
char *ext_text = NULL;
@@ -634,7 +531,7 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
u64 seq = 0;
char *text;
int error;
-@@ -3640,15 +3796,18 @@ static int printk_kthread_func(void *dat
+@@ -3640,15 +3777,27 @@ static int printk_kthread_func(void *dat
if (error)
continue;
@@ -645,20 +542,29 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
- if (console_suspended) {
- up_console_sem();
-+ if (!console_is_usable(con)) {
++ if (con->blocked ||
++ !console_kthread_printing_tryenter()) {
++ /* Another context has locked the console_lock. */
+ mutex_unlock(&con->lock);
continue;
}
- if (!console_is_usable(con)) {
- __console_unlock();
-+ if ((con->flags & CON_THD_BLOCKED) ||
-+ !console_kthread_printing_tryenter()) {
++ /*
++ * Although this context has not locked the console_lock, it
++ * is known that the console_lock is not locked and it is not
++ * possible for any other context to lock the console_lock.
++ * Therefore it is safe to read con->flags.
++ */
++
++ if (!__console_is_usable(con->flags)) {
++ console_kthread_printing_exit();
+ mutex_unlock(&con->lock);
continue;
}
-@@ -3661,13 +3820,13 @@ static int printk_kthread_func(void *dat
+@@ -3661,13 +3810,13 @@ static int printk_kthread_func(void *dat
* which can conditionally invoke cond_resched().
*/
console_may_schedule = 0;
@@ -676,20 +582,3 @@ Link: https://lore.kernel.org/r/20220419234637.357112-15-john.ogness@linutronix.
}
con_printk(KERN_INFO, con, "printing thread stopped\n");
-@@ -3676,14 +3835,14 @@ static int printk_kthread_func(void *dat
- kfree(ext_text);
- kfree(text);
-
-- console_lock();
-+ mutex_lock(&con->lock);
- /*
- * If this kthread is being stopped by another task, con->thread will
- * already be NULL. That is fine. The important thing is that it is
- * NULL after the kthread exits.
- */
- con->thread = NULL;
-- console_unlock();
-+ mutex_unlock(&con->lock);
-
- return 0;
- }
diff --git a/patches/0015-printk-remove-console_locked.patch b/patches/0015-printk-remove-console_locked.patch
index fa4d4d21ccbc..edf30819d3d1 100644
--- a/patches/0015-printk-remove-console_locked.patch
+++ b/patches/0015-printk-remove-console_locked.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 20 Apr 2022 01:52:37 +0206
-Subject: [PATCH 15/15] printk: remove @console_locked
+Subject: [PATCH 15/18] printk: remove @console_locked
The static global variable @console_locked is used to help debug
VT code to make sure that certain code paths are running with
@@ -16,9 +16,10 @@ Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20220419234637.357112-16-john.ogness@linutronix.de
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
- kernel/printk/printk.c | 31 ++++++++++++++-----------------
- 1 file changed, 14 insertions(+), 17 deletions(-)
+ kernel/printk/printk.c | 29 ++++++++++++++---------------
+ 1 file changed, 14 insertions(+), 15 deletions(-)
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -39,7 +40,7 @@ Link: https://lore.kernel.org/r/20220419234637.357112-16-john.ogness@linutronix.
/*
* Array of consoles built from command line options (console=)
-@@ -2690,7 +2682,6 @@ void console_lock(void)
+@@ -2694,7 +2686,6 @@ void console_lock(void)
if (console_suspended)
return;
console_kthreads_block();
@@ -47,21 +48,7 @@ Link: https://lore.kernel.org/r/20220419234637.357112-16-john.ogness@linutronix.
console_may_schedule = 1;
}
EXPORT_SYMBOL(console_lock);
-@@ -2705,13 +2696,11 @@ static void console_lock_single_hold(str
- might_sleep();
- down_console_sem();
- mutex_lock(&con->lock);
-- console_locked = 1;
- console_may_schedule = 1;
- }
-
- static void console_unlock_single_release(struct console *con)
- {
-- console_locked = 0;
- mutex_unlock(&con->lock);
- up_console_sem();
- }
-@@ -2736,15 +2725,26 @@ int console_trylock(void)
+@@ -2719,15 +2710,26 @@ int console_trylock(void)
up_console_sem();
return 0;
}
@@ -90,7 +77,7 @@ Link: https://lore.kernel.org/r/20220419234637.357112-16-john.ogness@linutronix.
}
EXPORT_SYMBOL(is_console_locked);
-@@ -2800,8 +2800,6 @@ static inline bool console_is_usable(str
+@@ -2783,8 +2785,6 @@ static inline bool console_is_usable(str
static void __console_unlock(void)
{
@@ -99,7 +86,7 @@ Link: https://lore.kernel.org/r/20220419234637.357112-16-john.ogness@linutronix.
/*
* Depending on whether console_lock() or console_trylock() was used,
* appropriately allow the kthread printers to continue.
-@@ -3118,7 +3116,6 @@ void console_unblank(void)
+@@ -3102,7 +3102,6 @@ void console_unblank(void)
} else
console_lock();
diff --git a/patches/0001-printk-add-infrastucture-for-atomic-consoles.patch b/patches/0016-printk-add-infrastucture-for-atomic-consoles.patch
index 790faebfa9b7..f61250c2c520 100644
--- a/patches/0001-printk-add-infrastucture-for-atomic-consoles.patch
+++ b/patches/0016-printk-add-infrastucture-for-atomic-consoles.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Fri, 4 Feb 2022 16:01:17 +0106
-Subject: [PATCH 1/3] printk: add infrastucture for atomic consoles
+Subject: [PATCH 16/18] printk: add infrastucture for atomic consoles
Many times it is not possible to see the console output on
panic because printing threads cannot be scheduled and/or the
@@ -28,14 +28,14 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
include/linux/console.h | 16 ++
init/Kconfig | 4
kernel/panic.c | 6
- kernel/printk/printk.c | 297 +++++++++++++++++++++++++++++++++++++++++++-----
- 4 files changed, 293 insertions(+), 30 deletions(-)
+ kernel/printk/printk.c | 293 +++++++++++++++++++++++++++++++++++++++++++-----
+ 4 files changed, 290 insertions(+), 29 deletions(-)
--- a/include/linux/console.h
+++ b/include/linux/console.h
-@@ -139,9 +139,19 @@ static inline int con_debug_leave(void)
+@@ -138,9 +138,19 @@ static inline int con_debug_leave(void)
+ #define CON_BRL (32) /* Used for a braille device */
#define CON_EXTENDED (64) /* Use the extended output format a la /dev/kmsg */
- #define CON_THD_BLOCKED (128) /* Thread blocked because console is locked */
+#ifdef CONFIG_HAVE_ATOMIC_CONSOLE
+struct console_atomic_data {
@@ -53,7 +53,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
int (*read)(struct console *, char *, unsigned);
struct tty_driver *(*device)(struct console *, int *);
void (*unblank)(void);
-@@ -154,7 +164,10 @@ struct console {
+@@ -153,7 +163,10 @@ struct console {
uint ispeed;
uint ospeed;
u64 seq;
@@ -63,8 +63,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+ struct console_atomic_data *atomic_data;
+#endif
struct task_struct *thread;
+ bool blocked;
- /*
@@ -184,6 +197,7 @@ extern int console_set_on_cmdline;
extern struct console *early_console;
@@ -250,9 +250,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
{
}
static bool suppress_message_printing(int level) { return false; }
-@@ -2790,10 +2872,20 @@ static inline bool __console_is_usable(s
+@@ -2775,10 +2857,20 @@ static inline bool __console_is_usable(s
*
- * Requires holding the console_lock or con->lock.
+ * Requires holding the console_lock.
*/
-static inline bool console_is_usable(struct console *con)
+static inline bool console_is_usable(struct console *con, bool atomic_printing)
@@ -265,15 +265,15 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+ if (!con->atomic_data)
+ return false;
+#else
- return false;
++ return false;
+#endif
+ } else if (!con->write) {
-+ return false;
+ return false;
+ }
return __console_is_usable(con->flags);
}
-@@ -2818,6 +2910,66 @@ static void __console_unlock(void)
+@@ -2803,6 +2895,66 @@ static void __console_unlock(void)
up_console_sem();
}
@@ -340,7 +340,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/*
* Print one record for the given console. The record printed is whatever
* record is the next available record for the given console.
-@@ -2830,6 +2982,8 @@ static void __console_unlock(void)
+@@ -2815,6 +2967,8 @@ static void __console_unlock(void)
* If dropped messages should be printed, @dropped_text is a buffer of size
* DROPPED_TEXT_MAX. Otherwise @dropped_text must be NULL.
*
@@ -349,8 +349,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
* @handover will be set to true if a printk waiter has taken over the
* console_lock, in which case the caller is no longer holding the
* console_lock. Otherwise it is set to false. A NULL pointer may be provided
-@@ -2841,7 +2995,8 @@ static void __console_unlock(void)
- * Requires the console_lock if @handover is non-NULL.
+@@ -2827,7 +2981,8 @@ static void __console_unlock(void)
+ * Requires con->lock otherwise.
*/
static bool __console_emit_next_record(struct console *con, char *text, char *ext_text,
- char *dropped_text, bool *handover)
@@ -359,7 +359,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
{
static atomic_t panic_console_dropped = ATOMIC_INIT(0);
struct printk_info info;
-@@ -2849,18 +3004,22 @@ static bool __console_emit_next_record(s
+@@ -2835,18 +2990,22 @@ static bool __console_emit_next_record(s
unsigned long flags;
char *write_text;
size_t len;
@@ -386,7 +386,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (panic_in_progress() &&
atomic_fetch_inc_relaxed(&panic_console_dropped) > 10) {
suppress_panic_printk = 1;
-@@ -2870,7 +3029,7 @@ static bool __console_emit_next_record(s
+@@ -2856,7 +3015,7 @@ static bool __console_emit_next_record(s
/* Skip record that has level above the console loglevel. */
if (suppress_message_printing(r.info->level)) {
@@ -395,7 +395,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
goto skip;
}
-@@ -2902,9 +3061,9 @@ static bool __console_emit_next_record(s
+@@ -2888,9 +3047,9 @@ static bool __console_emit_next_record(s
stop_critical_timings();
}
@@ -407,7 +407,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (handover) {
start_critical_timings();
-@@ -2936,7 +3095,7 @@ static bool console_emit_next_record_tra
+@@ -2922,7 +3081,7 @@ static bool console_emit_next_record_tra
handover = NULL;
}
@@ -416,7 +416,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
}
/*
-@@ -2984,7 +3143,7 @@ static bool console_flush_all(bool do_co
+@@ -2970,7 +3129,7 @@ static bool console_flush_all(bool do_co
for_each_console(con) {
bool progress;
@@ -425,17 +425,16 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
continue;
any_usable = true;
-@@ -3019,6 +3178,70 @@ static bool console_flush_all(bool do_co
+@@ -3005,6 +3164,68 @@ static bool console_flush_all(bool do_co
return any_usable;
}
-+#ifdef CONFIG_HAVE_ATOMIC_CONSOLE
++#if defined(CONFIG_HAVE_ATOMIC_CONSOLE) && defined(CONFIG_PRINTK)
+static bool console_emit_next_record(struct console *con, char *text, char *ext_text,
+ char *dropped_text, bool atomic_printing);
+
+static void atomic_console_flush_all(void)
+{
-+ bool any_usable = false;
+ unsigned long flags;
+ struct console *con;
+ bool any_progress;
@@ -459,7 +458,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+
+ if (!console_is_usable(con, true))
+ continue;
-+ any_usable = true;
+
+ if (con->flags & CON_EXTENDED) {
+ /* Extended consoles do not print "dropped messages". */
@@ -489,14 +487,14 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+
+ printk_cpu_sync_put_irqrestore(flags);
+}
-+#else /* CONFIG_HAVE_ATOMIC_CONSOLE */
++#else /* CONFIG_HAVE_ATOMIC_CONSOLE && CONFIG_PRINTK */
+#define atomic_console_flush_all()
+#endif
+
/**
* console_unlock - unlock the console system
*
-@@ -3134,6 +3357,11 @@ void console_unblank(void)
+@@ -3120,6 +3341,11 @@ void console_unblank(void)
*/
void console_flush_on_panic(enum con_flush_mode mode)
{
@@ -508,7 +506,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/*
* If someone else is holding the console lock, trylock will fail
* and may_schedule may be set. Ignore and proceed to unlock so
-@@ -3150,7 +3378,7 @@ void console_flush_on_panic(enum con_flu
+@@ -3136,7 +3362,7 @@ void console_flush_on_panic(enum con_flu
seq = prb_first_valid_seq(prb);
for_each_console(c)
@@ -517,14 +515,14 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
}
console_unlock();
}
-@@ -3396,19 +3624,22 @@ void register_console(struct console *ne
+@@ -3379,19 +3605,22 @@ void register_console(struct console *ne
if (newcon->flags & CON_EXTENDED)
nr_ext_console_drivers++;
- newcon->dropped = 0;
+ atomic_long_set(&newcon->dropped, 0);
newcon->thread = NULL;
- newcon->flags |= CON_THD_BLOCKED;
+ newcon->blocked = true;
mutex_init(&newcon->lock);
+#ifdef CONFIG_HAVE_ATOMIC_CONSOLE
+ newcon->atomic_data = NULL;
@@ -543,7 +541,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
}
if (printk_kthreads_available)
-@@ -3497,6 +3728,10 @@ int unregister_console(struct console *c
+@@ -3480,6 +3709,10 @@ int unregister_console(struct console *c
console_sysfs_notify();
@@ -554,7 +552,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (console->exit)
res = console->exit(console);
-@@ -3626,7 +3861,7 @@ static bool __pr_flush(struct console *c
+@@ -3609,7 +3842,7 @@ static bool __pr_flush(struct console *c
for_each_console(c) {
if (con && con != c)
continue;
@@ -563,7 +561,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
continue;
printk_seq = c->seq;
if (printk_seq < seq)
-@@ -3708,9 +3943,10 @@ static void printk_fallback_preferred_di
+@@ -3691,9 +3924,10 @@ static void printk_fallback_preferred_di
* See __console_emit_next_record() for argument and return details.
*/
static bool console_emit_next_record(struct console *con, char *text, char *ext_text,
@@ -576,7 +574,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
}
static bool printer_should_wake(struct console *con, u64 seq)
-@@ -3748,6 +3984,11 @@ static int printk_kthread_func(void *dat
+@@ -3731,6 +3965,11 @@ static int printk_kthread_func(void *dat
char *text;
int error;
@@ -588,16 +586,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
text = kmalloc(CONSOLE_LOG_MAX, GFP_KERNEL);
if (!text) {
con_printk(KERN_ERR, con, "failed to allocate text buffer\n");
-@@ -3797,7 +4038,7 @@ static int printk_kthread_func(void *dat
- if (error)
- continue;
-
-- if (!console_is_usable(con)) {
-+ if (!console_is_usable(con, false)) {
- mutex_unlock(&con->lock);
- continue;
- }
-@@ -3817,7 +4058,7 @@ static int printk_kthread_func(void *dat
+@@ -3809,7 +4048,7 @@ static int printk_kthread_func(void *dat
* which can conditionally invoke cond_resched().
*/
console_may_schedule = 0;
diff --git a/patches/0002-serial-8250-implement-write_atomic.patch b/patches/0017-serial-8250-implement-write_atomic.patch
index 5d89cfe3b30b..7c9b0da1ffda 100644
--- a/patches/0002-serial-8250-implement-write_atomic.patch
+++ b/patches/0017-serial-8250-implement-write_atomic.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Fri, 4 Feb 2022 16:01:17 +0106
-Subject: [PATCH 2/3] serial: 8250: implement write_atomic
+Subject: [PATCH 17/18] serial: 8250: implement write_atomic
Implement a non-sleeping NMI-safe write_atomic() console function in
order to support atomic console printing during a panic.
@@ -28,10 +28,10 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
drivers/tty/serial/8250/8250_ingenic.c | 3
drivers/tty/serial/8250/8250_mtk.c | 32 +++++
drivers/tty/serial/8250/8250_omap.c | 20 +--
- drivers/tty/serial/8250/8250_port.c | 152 +++++++++++++++++++---------
+ drivers/tty/serial/8250/8250_port.c | 151 +++++++++++++++++++---------
drivers/tty/serial/8250/Kconfig | 1
include/linux/serial_8250.h | 5
- 12 files changed, 268 insertions(+), 65 deletions(-)
+ 12 files changed, 267 insertions(+), 65 deletions(-)
--- a/drivers/tty/serial/8250/8250.h
+++ b/drivers/tty/serial/8250/8250.h
@@ -510,20 +510,21 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/*
* We distinguish between 16550A and U6 16550A by counting
* how many bytes are in the FIFO.
-@@ -1215,6 +1226,7 @@ static void autoconfig(struct uart_8250_
+@@ -1213,8 +1224,10 @@ static void autoconfig(struct uart_8250_
+ unsigned char status1, scratch, scratch2, scratch3;
+ unsigned char save_lcr, save_mcr;
struct uart_port *port = &up->port;
++ unsigned long cs_flags;
unsigned long flags;
unsigned int old_capabilities;
+ bool is_console;
if (!port->iobase && !port->mapbase && !port->membase)
return;
-@@ -1232,6 +1244,13 @@ static void autoconfig(struct uart_8250_
+@@ -1232,6 +1245,11 @@ static void autoconfig(struct uart_8250_
up->bugs = 0;
if (!(port->flags & UPF_BUGGY_UART)) {
-+ unsigned long cs_flags;
-+
+ is_console = uart_console(port);
+
+ if (is_console)
@@ -532,7 +533,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/*
* Do a simple existence test first; if we fail this,
* there's no point trying anything else.
-@@ -1261,6 +1280,10 @@ static void autoconfig(struct uart_8250_
+@@ -1261,6 +1279,10 @@ static void autoconfig(struct uart_8250_
#endif
scratch3 = serial_in(up, UART_IER) & 0x0f;
serial_out(up, UART_IER, scratch);
@@ -543,7 +544,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (scratch2 != 0 || scratch3 != 0x0F) {
/*
* We failed; there's nothing here
-@@ -1358,10 +1381,7 @@ static void autoconfig(struct uart_8250_
+@@ -1358,10 +1380,7 @@ static void autoconfig(struct uart_8250_
serial8250_out_MCR(up, save_mcr);
serial8250_clear_fifos(up);
serial_in(up, UART_RX);
@@ -555,7 +556,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
out_unlock:
spin_unlock_irqrestore(&port->lock, flags);
-@@ -1387,7 +1407,9 @@ static void autoconfig_irq(struct uart_8
+@@ -1387,7 +1406,9 @@ static void autoconfig_irq(struct uart_8
unsigned char save_mcr, save_ier;
unsigned char save_ICP = 0;
unsigned int ICP = 0;
@@ -565,7 +566,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
int irq;
if (port->flags & UPF_FOURPORT) {
-@@ -1397,8 +1419,12 @@ static void autoconfig_irq(struct uart_8
+@@ -1397,8 +1418,12 @@ static void autoconfig_irq(struct uart_8
inb_p(ICP);
}
@@ -579,7 +580,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/* forget possible initially masked and pending IRQ */
probe_irq_off(probe_irq_on());
-@@ -1430,8 +1456,10 @@ static void autoconfig_irq(struct uart_8
+@@ -1430,8 +1455,10 @@ static void autoconfig_irq(struct uart_8
if (port->flags & UPF_FOURPORT)
outb_p(save_ICP, ICP);
@@ -591,7 +592,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
port->irq = (irq > 0) ? irq : 0;
}
-@@ -1444,7 +1472,7 @@ static void serial8250_stop_rx(struct ua
+@@ -1444,7 +1471,7 @@ static void serial8250_stop_rx(struct ua
up->ier &= ~(UART_IER_RLSI | UART_IER_RDI);
up->port.read_status_mask &= ~UART_LSR_DR;
@@ -600,7 +601,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
serial8250_rpm_put(up);
}
-@@ -1474,7 +1502,7 @@ void serial8250_em485_stop_tx(struct uar
+@@ -1474,7 +1501,7 @@ void serial8250_em485_stop_tx(struct uar
serial8250_clear_and_reinit_fifos(p);
p->ier |= UART_IER_RLSI | UART_IER_RDI;
@@ -609,7 +610,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
}
}
EXPORT_SYMBOL_GPL(serial8250_em485_stop_tx);
-@@ -1711,7 +1739,7 @@ static void serial8250_disable_ms(struct
+@@ -1711,7 +1738,7 @@ static void serial8250_disable_ms(struct
mctrl_gpio_disable_ms(up->gpios);
up->ier &= ~UART_IER_MSI;
@@ -618,7 +619,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
}
static void serial8250_enable_ms(struct uart_port *port)
-@@ -1727,7 +1755,7 @@ static void serial8250_enable_ms(struct
+@@ -1727,7 +1754,7 @@ static void serial8250_enable_ms(struct
up->ier |= UART_IER_MSI;
serial8250_rpm_get(up);
@@ -627,7 +628,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
serial8250_rpm_put(up);
}
-@@ -2146,14 +2174,7 @@ static void serial8250_put_poll_char(str
+@@ -2146,14 +2173,7 @@ static void serial8250_put_poll_char(str
struct uart_8250_port *up = up_to_u8250p(port);
serial8250_rpm_get(up);
@@ -643,7 +644,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
wait_for_xmitr(up, BOTH_EMPTY);
/*
-@@ -2166,7 +2187,7 @@ static void serial8250_put_poll_char(str
+@@ -2166,7 +2186,7 @@ static void serial8250_put_poll_char(str
* and restore the IER
*/
wait_for_xmitr(up, BOTH_EMPTY);
@@ -652,7 +653,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
serial8250_rpm_put(up);
}
-@@ -2175,8 +2196,10 @@ static void serial8250_put_poll_char(str
+@@ -2175,8 +2195,10 @@ static void serial8250_put_poll_char(str
int serial8250_do_startup(struct uart_port *port)
{
struct uart_8250_port *up = up_to_u8250p(port);
@@ -663,7 +664,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
int retval;
if (!port->fifosize)
-@@ -2196,7 +2219,7 @@ int serial8250_do_startup(struct uart_po
+@@ -2196,7 +2218,7 @@ int serial8250_do_startup(struct uart_po
up->acr = 0;
serial_port_out(port, UART_LCR, UART_LCR_CONF_MODE_B);
serial_port_out(port, UART_EFR, UART_EFR_ECB);
@@ -672,7 +673,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
serial_port_out(port, UART_LCR, 0);
serial_icr_write(up, UART_CSR, 0); /* Reset the UART */
serial_port_out(port, UART_LCR, UART_LCR_CONF_MODE_B);
-@@ -2206,7 +2229,7 @@ int serial8250_do_startup(struct uart_po
+@@ -2206,7 +2228,7 @@ int serial8250_do_startup(struct uart_po
if (port->type == PORT_DA830) {
/* Reset the port */
@@ -681,7 +682,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
serial_port_out(port, UART_DA830_PWREMU_MGMT, 0);
mdelay(10);
-@@ -2301,6 +2324,8 @@ int serial8250_do_startup(struct uart_po
+@@ -2301,6 +2323,8 @@ int serial8250_do_startup(struct uart_po
if (port->irq && (up->port.flags & UPF_SHARE_IRQ))
up->port.irqflags |= IRQF_SHARED;
@@ -690,7 +691,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (port->irq && !(up->port.flags & UPF_NO_THRE_TEST)) {
unsigned char iir1;
-@@ -2317,6 +2342,9 @@ int serial8250_do_startup(struct uart_po
+@@ -2317,6 +2341,9 @@ int serial8250_do_startup(struct uart_po
*/
spin_lock_irqsave(&port->lock, flags);
@@ -700,7 +701,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
wait_for_xmitr(up, UART_LSR_THRE);
serial_port_out_sync(port, UART_IER, UART_IER_THRI);
udelay(1); /* allow THRE to set */
-@@ -2327,6 +2355,9 @@ int serial8250_do_startup(struct uart_po
+@@ -2327,6 +2354,9 @@ int serial8250_do_startup(struct uart_po
iir = serial_port_in(port, UART_IIR);
serial_port_out(port, UART_IER, 0);
@@ -710,7 +711,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
spin_unlock_irqrestore(&port->lock, flags);
if (port->irqflags & IRQF_SHARED)
-@@ -2383,10 +2414,14 @@ int serial8250_do_startup(struct uart_po
+@@ -2383,10 +2413,14 @@ int serial8250_do_startup(struct uart_po
* Do a quick test to see if we receive an interrupt when we enable
* the TX irq.
*/
@@ -725,7 +726,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (lsr & UART_LSR_TEMT && iir & UART_IIR_NO_INT) {
if (!(up->bugs & UART_BUG_TXEN)) {
-@@ -2418,7 +2453,7 @@ int serial8250_do_startup(struct uart_po
+@@ -2418,7 +2452,7 @@ int serial8250_do_startup(struct uart_po
if (up->dma) {
const char *msg = NULL;
@@ -734,7 +735,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
msg = "forbid DMA for kernel console";
else if (serial8250_request_dma(up))
msg = "failed to request DMA";
-@@ -2469,7 +2504,7 @@ void serial8250_do_shutdown(struct uart_
+@@ -2469,7 +2503,7 @@ void serial8250_do_shutdown(struct uart_
*/
spin_lock_irqsave(&port->lock, flags);
up->ier = 0;
@@ -743,7 +744,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
spin_unlock_irqrestore(&port->lock, flags);
synchronize_irq(port->irq);
-@@ -2837,7 +2872,7 @@ serial8250_do_set_termios(struct uart_po
+@@ -2837,7 +2871,7 @@ serial8250_do_set_termios(struct uart_po
if (up->capabilities & UART_CAP_RTOIE)
up->ier |= UART_IER_RTOIE;
@@ -752,7 +753,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (up->capabilities & UART_CAP_EFR) {
unsigned char efr = 0;
-@@ -3303,7 +3338,7 @@ EXPORT_SYMBOL_GPL(serial8250_set_default
+@@ -3303,7 +3337,7 @@ EXPORT_SYMBOL_GPL(serial8250_set_default
#ifdef CONFIG_SERIAL_8250_CONSOLE
@@ -761,7 +762,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
{
struct uart_8250_port *up = up_to_u8250p(port);
-@@ -3311,6 +3346,18 @@ static void serial8250_console_putchar(s
+@@ -3311,6 +3345,18 @@ static void serial8250_console_putchar(s
serial_port_out(port, UART_TX, ch);
}
@@ -780,7 +781,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/*
* Restore serial console when h/w power-off detected
*/
-@@ -3332,6 +3379,32 @@ static void serial8250_console_restore(s
+@@ -3332,6 +3378,32 @@ static void serial8250_console_restore(s
serial8250_out_MCR(up, UART_MCR_DTR | UART_MCR_RTS);
}
@@ -813,7 +814,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/*
* Print a string to the serial port trying not to disturb
* any possible real use of the port...
-@@ -3348,24 +3421,12 @@ void serial8250_console_write(struct uar
+@@ -3348,24 +3420,12 @@ void serial8250_console_write(struct uar
struct uart_port *port = &up->port;
unsigned long flags;
unsigned int ier;
@@ -840,7 +841,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/* check scratch reg to see if port powered off during system sleep */
if (up->canary && (up->canary != serial_port_in(port, UART_SCR))) {
-@@ -3379,7 +3440,9 @@ void serial8250_console_write(struct uar
+@@ -3379,7 +3439,9 @@ void serial8250_console_write(struct uar
mdelay(port->rs485.delay_rts_before_send);
}
@@ -850,7 +851,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/*
* Finally, wait for transmitter to become empty
-@@ -3392,8 +3455,7 @@ void serial8250_console_write(struct uar
+@@ -3392,8 +3454,7 @@ void serial8250_console_write(struct uar
if (em485->tx_stopped)
up->rs485_stop_tx(up);
}
@@ -860,7 +861,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/*
* The receive handling will happen properly because the
-@@ -3405,8 +3467,7 @@ void serial8250_console_write(struct uar
+@@ -3405,8 +3466,7 @@ void serial8250_console_write(struct uar
if (up->msr_saved_flags)
serial8250_modem_status(up);
@@ -870,7 +871,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
}
static unsigned int probe_baud(struct uart_port *port)
-@@ -3426,6 +3487,7 @@ static unsigned int probe_baud(struct ua
+@@ -3426,6 +3486,7 @@ static unsigned int probe_baud(struct ua
int serial8250_console_setup(struct uart_port *port, char *options, bool probe)
{
@@ -878,7 +879,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
int baud = 9600;
int bits = 8;
int parity = 'n';
-@@ -3435,6 +3497,8 @@ int serial8250_console_setup(struct uart
+@@ -3435,6 +3496,8 @@ int serial8250_console_setup(struct uart
if (!port->iobase && !port->membase)
return -ENODEV;
diff --git a/patches/0003-printk-avoid-preempt_disable-for-PREEMPT_RT.patch b/patches/0018-printk-avoid-preempt_disable-for-PREEMPT_RT.patch
index d85419106920..196b31fdf845 100644
--- a/patches/0003-printk-avoid-preempt_disable-for-PREEMPT_RT.patch
+++ b/patches/0018-printk-avoid-preempt_disable-for-PREEMPT_RT.patch
@@ -1,6 +1,6 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Fri, 4 Feb 2022 16:01:17 +0106
-Subject: [PATCH 3/3] printk: avoid preempt_disable() for PREEMPT_RT
+Subject: [PATCH 18/18] printk: avoid preempt_disable() for PREEMPT_RT
During non-normal operation, printk() calls will attempt to
write the messages directly to the consoles. This involves
@@ -73,7 +73,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
}
wake_up_klogd();
-@@ -3089,8 +3104,12 @@ static bool console_emit_next_record_tra
+@@ -3075,8 +3090,12 @@ static bool console_emit_next_record_tra
/*
* Handovers are only supported if threaded printers are atomically
* blocked. The context taking over the console_lock may be atomic.
diff --git a/patches/Add_localversion_for_-RT_release.patch b/patches/Add_localversion_for_-RT_release.patch
index d960d516454d..53b69a97ca19 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 @@
-+-rt2
++-rt3
diff --git a/patches/series b/patches/series
index 00fe288c17ad..bcd24103969a 100644
--- a/patches/series
+++ b/patches/series
@@ -16,12 +16,11 @@
0011-printk-add-pr_flush.patch
0012-printk-add-functions-to-prefer-direct-printing.patch
0013-printk-add-kthread-console-printers.patch
-0014-printk-extend-console_lock-for-proper-kthread-suppor.patch
+0014-printk-extend-console_lock-for-per-console-locking.patch
0015-printk-remove-console_locked.patch
-#
-0001-printk-add-infrastucture-for-atomic-consoles.patch
-0002-serial-8250-implement-write_atomic.patch
-0003-printk-avoid-preempt_disable-for-PREEMPT_RT.patch
+0016-printk-add-infrastucture-for-atomic-consoles.patch
+0017-serial-8250-implement-write_atomic.patch
+0018-printk-avoid-preempt_disable-for-PREEMPT_RT.patch
###########################################################################
# Posted and applied