summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0006-printk-nbcon-Add-callbacks-to-synchronize-with-drive.patch
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--debian/patches-rt/0006-printk-nbcon-Add-callbacks-to-synchronize-with-drive.patch (renamed from debian/patches-rt/0011-printk-nbcon-Add-callbacks-to-synchronize-with-drive.patch)46
1 files changed, 29 insertions, 17 deletions
diff --git a/debian/patches-rt/0011-printk-nbcon-Add-callbacks-to-synchronize-with-drive.patch b/debian/patches-rt/0006-printk-nbcon-Add-callbacks-to-synchronize-with-drive.patch
index d6239d704b..0323d580c4 100644
--- a/debian/patches-rt/0011-printk-nbcon-Add-callbacks-to-synchronize-with-drive.patch
+++ b/debian/patches-rt/0006-printk-nbcon-Add-callbacks-to-synchronize-with-drive.patch
@@ -1,27 +1,38 @@
From: John Ogness <john.ogness@linutronix.de>
Date: Mon, 18 Mar 2024 10:11:56 +0000
-Subject: [PATCH 11/48] printk: nbcon: Add callbacks to synchronize with driver
-Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/6.8/older/patches-6.8.2-rt11.tar.xz
+Subject: [PATCH 06/46] printk: nbcon: Add callbacks to synchronize with driver
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/6.9/older/patches-6.9-rt5.tar.xz
Console drivers typically must deal with access to the hardware
via user input/output (such as an interactive login shell) and
-output of kernel messages via printk() calls.
+output of kernel messages via printk() calls. To provide the
+necessary synchronization, usually some driver-specific locking
+mechanism is used (for example, the port spinlock for uart
+serial consoles).
-Follow-up commits require that the printk subsystem is able to
-synchronize with the driver. Require nbcon consoles to implement
-two new callbacks (device_lock(), device_unlock()) that will
-use whatever synchronization mechanism the driver is using for
-itself (for example, the port lock for uart serial consoles).
+Until now, usage of this driver-specific locking has been hidden
+from the printk-subsystem and implemented within the various
+console callbacks. However, for nbcon consoles, it is necessary
+that the printk-subsystem uses the driver-specific locking so
+that nbcon console ownership can be acquired _after_ the
+driver-specific locking has succeeded. This allows for lock
+contention to exist on the more context-friendly driver-specific
+locking rather than nbcon console ownership (for non-emergency
+and non-panic cases).
+
+Require nbcon consoles to implement two new callbacks
+(device_lock(), device_unlock()) that will use whatever
+synchronization mechanism the driver is using for itself.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
- include/linux/console.h | 42 ++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 42 insertions(+)
+ include/linux/console.h | 43 +++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 43 insertions(+)
--- a/include/linux/console.h
+++ b/include/linux/console.h
-@@ -352,6 +352,48 @@ struct console {
+@@ -372,6 +372,49 @@ struct console {
*/
void (*write_atomic)(struct console *con, struct nbcon_write_context *wctxt);
@@ -38,12 +49,13 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+ * use whatever synchronization mechanism the driver is using for
+ * itself (for example, the port lock for uart serial consoles).
+ *
-+ * This callback is always called from task context. It may use any
-+ * synchronization method required by the driver. BUT this callback
-+ * MUST also disable migration. The console driver may be using a
-+ * synchronization mechanism that already takes care of this (such as
-+ * spinlocks). Otherwise this function must explicitly call
-+ * migrate_disable().
++ * The callback is always called from task context. It may use any
++ * synchronization method required by the driver.
++ *
++ * IMPORTANT: The callback MUST disable migration. The console driver
++ * may be using a synchronization mechanism that already takes
++ * care of this (such as spinlocks). Otherwise this function must
++ * explicitly call migrate_disable().
+ *
+ * The flags argument is provided as a convenience to the driver. It
+ * will be passed again to device_unlock(). It can be ignored if the