diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 40a0fe0a4e05..97526024c962 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -403,7 +403,11 @@ static void pstore_console_write(struct console *con, const char *s, unsigned c) static struct console pstore_console = { .name = "pstore", .write = pstore_console_write, +#ifdef CON_PSTORE + .flags = CON_PRINTBUFFER | CON_ENABLED | CON_ANYTIME | CON_PSTORE, +#else .flags = CON_PRINTBUFFER | CON_ENABLED | CON_ANYTIME, +#endif .index = -1, }; diff --git a/include/linux/console.h b/include/linux/console.h index ea731af2451e..67cc09b887de 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -116,6 +116,9 @@ static inline int con_debug_leave(void) #define CON_ANYTIME (16) /* Safe to call when cpu is offline */ #define CON_BRL (32) /* Used for a braille device */ #define CON_EXTENDED (64) /* Use the extended output format a la /dev/kmsg */ +#if defined(CONFIG_ARCH_ROCKCHIP) && defined(CONFIG_PSTORE_CONSOLE) +#define CON_PSTORE (128) /* Print to pstore console anyway */ +#endif struct console { char name[16]; diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index b4573b55b435..f30a876531f0 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -1442,12 +1442,19 @@ static void call_console_drivers(int level, trace_console_rcuidle(text, len); +#ifndef CON_PSTORE if (level >= console_loglevel && !ignore_loglevel) return; +#endif if (!console_drivers) return; for_each_console(con) { +#ifdef CON_PSTORE + if (!(con->flags & CON_PSTORE) && + level >= console_loglevel && !ignore_loglevel) + continue; +#endif if (exclusive_console && con != exclusive_console) continue; if (!(con->flags & CON_ENABLED))