Skip to content

Commit

Permalink
Merge tag 'printk-for-6.6' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/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
  • Loading branch information
torvalds committed Sep 4, 2023
2 parents 4accdb9 + f0f6923 commit 3c31041
Show file tree
Hide file tree
Showing 9 changed files with 167 additions and 81 deletions.
9 changes: 5 additions & 4 deletions Documentation/core-api/printk-formats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ Integer types

If variable is of Type, use printk format specifier:
------------------------------------------------------------
char %d or %x
signed char %d or %hhx
unsigned char %u or %x
short int %d or %x
char %u or %x
short int %d or %hx
unsigned short int %u or %x
int %d or %x
unsigned int %u or %x
Expand All @@ -27,9 +28,9 @@ Integer types
unsigned long long %llu or %llx
size_t %zu or %zx
ssize_t %zd or %zx
s8 %d or %x
s8 %d or %hhx
u8 %u or %x
s16 %d or %x
s16 %d or %hx
u16 %u or %x
s32 %d or %x
u32 %u or %x
Expand Down
4 changes: 2 additions & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -17176,9 +17176,9 @@ F: kernel/sched/psi.c

PRINTK
M: Petr Mladek <[email protected]>
M: Sergey Senozhatsky <[email protected]>
R: Steven Rostedt <[email protected]>
R: John Ogness <[email protected]>
R: Sergey Senozhatsky <[email protected]>
S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git
F: include/linux/printk.h
Expand Down Expand Up @@ -23072,9 +23072,9 @@ F: drivers/net/vrf.c
VSPRINTF
M: Petr Mladek <[email protected]>
M: Steven Rostedt <[email protected]>
M: Sergey Senozhatsky <[email protected]>
R: Andy Shevchenko <[email protected]>
R: Rasmus Villemoes <[email protected]>
R: Sergey Senozhatsky <[email protected]>
S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git
F: Documentation/core-api/printk-formats.rst
Expand Down
3 changes: 3 additions & 0 deletions include/linux/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ static inline int con_debug_leave(void)
* receiving the printk spam for obvious reasons.
* @CON_EXTENDED: The console supports the extended output format of
* /dev/kmesg which requires a larger output buffer.
* @CON_SUSPENDED: Indicates if a console is suspended. If true, the
* printing callbacks must not be called.
*/
enum cons_flags {
CON_PRINTBUFFER = BIT(0),
Expand All @@ -163,6 +165,7 @@ enum cons_flags {
CON_ANYTIME = BIT(4),
CON_BRL = BIT(5),
CON_EXTENDED = BIT(6),
CON_SUSPENDED = BIT(7),
};

/**
Expand Down
2 changes: 2 additions & 0 deletions kernel/debug/kdb/kdb_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,8 @@ static void kdb_msg_write(const char *msg, int msg_len)
continue;
if (c == dbg_io_ops->cons)
continue;
if (!c->write)
continue;
/*
* Set oops_in_progress to encourage the console drivers to
* disregard their internal spin locks: in the current calling
Expand Down
2 changes: 2 additions & 0 deletions kernel/printk/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,5 @@ struct printk_message {
u64 seq;
unsigned long dropped;
};

bool other_cpu_in_panic(void);
Loading

0 comments on commit 3c31041

Please sign in to comment.