Skip to content

Commit 3c31041

Browse files
committed
Merge tag 'printk-for-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux
Pull printk updates from Petr Mladek: - Do not try to get the console lock when it is not need or useful in panic() - Replace the global console_suspended state by a per-console flag - Export symbols needed for dumping the raw printk buffer in panic() - Fix documentation of printf formats for integer types - Moved Sergey Senozhatsky to the reviewer role - Misc cleanups * tag 'printk-for-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: printk: export symbols for debug modules lib: test_scanf: Add explicit type cast to result initialization in test_number_prefix() printk: ringbuffer: Fix truncating buffer size min_t cast printk: Rename abandon_console_lock_in_panic() to other_cpu_in_panic() printk: Add per-console suspended state printk: Consolidate console deferred printing printk: Do not take console lock for console_flush_on_panic() printk: Keep non-panic-CPUs out of console lock printk: Reduce console_unblank() usage in unsafe scenarios kdb: Do not assume write() callback available docs: printk-formats: Treat char as always unsigned docs: printk-formats: Fix hex printing of signed values MAINTAINERS: adjust printk/vsprintf entries
2 parents 4accdb9 + f0f6923 commit 3c31041

File tree

9 files changed

+167
-81
lines changed

9 files changed

+167
-81
lines changed

Documentation/core-api/printk-formats.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ Integer types
1515

1616
If variable is of Type, use printk format specifier:
1717
------------------------------------------------------------
18-
char %d or %x
18+
signed char %d or %hhx
1919
unsigned char %u or %x
20-
short int %d or %x
20+
char %u or %x
21+
short int %d or %hx
2122
unsigned short int %u or %x
2223
int %d or %x
2324
unsigned int %u or %x
@@ -27,9 +28,9 @@ Integer types
2728
unsigned long long %llu or %llx
2829
size_t %zu or %zx
2930
ssize_t %zd or %zx
30-
s8 %d or %x
31+
s8 %d or %hhx
3132
u8 %u or %x
32-
s16 %d or %x
33+
s16 %d or %hx
3334
u16 %u or %x
3435
s32 %d or %x
3536
u32 %u or %x

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17176,9 +17176,9 @@ F: kernel/sched/psi.c
1717617176

1717717177
PRINTK
1717817178
M: Petr Mladek <pmladek@suse.com>
17179-
M: Sergey Senozhatsky <senozhatsky@chromium.org>
1718017179
R: Steven Rostedt <rostedt@goodmis.org>
1718117180
R: John Ogness <john.ogness@linutronix.de>
17181+
R: Sergey Senozhatsky <senozhatsky@chromium.org>
1718217182
S: Maintained
1718317183
T: git git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git
1718417184
F: include/linux/printk.h
@@ -23072,9 +23072,9 @@ F: drivers/net/vrf.c
2307223072
VSPRINTF
2307323073
M: Petr Mladek <pmladek@suse.com>
2307423074
M: Steven Rostedt <rostedt@goodmis.org>
23075-
M: Sergey Senozhatsky <senozhatsky@chromium.org>
2307623075
R: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2307723076
R: Rasmus Villemoes <linux@rasmusvillemoes.dk>
23077+
R: Sergey Senozhatsky <senozhatsky@chromium.org>
2307823078
S: Maintained
2307923079
T: git git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git
2308023080
F: Documentation/core-api/printk-formats.rst

include/linux/console.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ static inline int con_debug_leave(void)
154154
* receiving the printk spam for obvious reasons.
155155
* @CON_EXTENDED: The console supports the extended output format of
156156
* /dev/kmesg which requires a larger output buffer.
157+
* @CON_SUSPENDED: Indicates if a console is suspended. If true, the
158+
* printing callbacks must not be called.
157159
*/
158160
enum cons_flags {
159161
CON_PRINTBUFFER = BIT(0),
@@ -163,6 +165,7 @@ enum cons_flags {
163165
CON_ANYTIME = BIT(4),
164166
CON_BRL = BIT(5),
165167
CON_EXTENDED = BIT(6),
168+
CON_SUSPENDED = BIT(7),
166169
};
167170

168171
/**

kernel/debug/kdb/kdb_io.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,8 @@ static void kdb_msg_write(const char *msg, int msg_len)
590590
continue;
591591
if (c == dbg_io_ops->cons)
592592
continue;
593+
if (!c->write)
594+
continue;
593595
/*
594596
* Set oops_in_progress to encourage the console drivers to
595597
* disregard their internal spin locks: in the current calling

kernel/printk/internal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,5 @@ struct printk_message {
103103
u64 seq;
104104
unsigned long dropped;
105105
};
106+
107+
bool other_cpu_in_panic(void);

0 commit comments

Comments
 (0)