mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
printk: always use deferred printk when flush printk_safe lines
Always use printk_deferred() in printk_safe_flush_line(). Flushing can be done from NMI or printk_safe contexts (when we are in panic), so we can't call console drivers, yet still want to store the messages in the logbuf buffer. Therefore we use a deferred printk version. Link: http://lkml.kernel.org/r/[email protected] Cc: Andrew Morton <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Jan Kara <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Calvin Owens <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Peter Hurley <[email protected]> Cc: [email protected] Signed-off-by: Sergey Senozhatsky <[email protected]> Suggested-by: Petr Mladek <[email protected]> Signed-off-by: Petr Mladek <[email protected]> Reviewed-by: Steven Rostedt (VMware) <[email protected]>
This commit is contained in:
parent
099f1c84c0
commit
7acac3445a
1 changed files with 6 additions and 8 deletions
|
|
@ -110,17 +110,15 @@ again:
|
|||
return add;
|
||||
}
|
||||
|
||||
static void printk_safe_flush_line(const char *text, int len)
|
||||
static inline void printk_safe_flush_line(const char *text, int len)
|
||||
{
|
||||
/*
|
||||
* The buffers are flushed in NMI only on panic. The messages must
|
||||
* go only into the ring buffer at this stage. Consoles will get
|
||||
* explicitly called later when a crashdump is not generated.
|
||||
* Avoid any console drivers calls from here, because we may be
|
||||
* in NMI or printk_safe context (when in panic). The messages
|
||||
* must go only into the ring buffer at this stage. Consoles will
|
||||
* get explicitly called later when a crashdump is not generated.
|
||||
*/
|
||||
if (in_nmi())
|
||||
printk_deferred("%.*s", len, text);
|
||||
else
|
||||
printk("%.*s", len, text);
|
||||
printk_deferred("%.*s", len, text);
|
||||
}
|
||||
|
||||
/* printk part of the temporary buffer line by line */
|
||||
|
|
|
|||
Loading…
Reference in a new issue