blob: fec96d79ff47afcdb6d9b06600218ecef60c5928 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
From fc0bb2cf754415add4be3a04a82d7b9c7c6f92de Mon Sep 17 00:00:00 2001
From: John Ogness <john.ogness@linutronix.de>
Date: Wed, 17 Feb 2021 18:28:05 +0100
Subject: [PATCH 095/323] printk: console: remove unnecessary safe buffer usage
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.215-rt107.tar.xz
Upon registering a console, safe buffers are activated when setting
up the sequence number to replay the log. However, these are already
protected by @console_sem and @syslog_lock. Remove the unnecessary
safe buffer usage.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
---
kernel/printk/printk.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 0d233c0573a50..1e7ab017be193 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2999,9 +2999,7 @@ void register_console(struct console *newcon)
/*
* console_unlock(); will print out the buffered messages
* for us.
- */
- printk_safe_enter_irqsave(flags);
- /*
+ *
* We're about to replay the log buffer. Only do this to the
* just-registered console to avoid excessive message spam to
* the already-registered consoles.
@@ -3014,11 +3012,9 @@ void register_console(struct console *newcon)
exclusive_console_stop_seq = console_seq;
/* Get a consistent copy of @syslog_seq. */
- raw_spin_lock(&syslog_lock);
+ raw_spin_lock_irqsave(&syslog_lock, flags);
console_seq = syslog_seq;
- raw_spin_unlock(&syslog_lock);
-
- printk_safe_exit_irqrestore(flags);
+ raw_spin_unlock_irqrestore(&syslog_lock, flags);
}
console_unlock();
console_sysfs_notify();
--
2.44.0
|