The patch titled Subject: printk: add interface for disabling recursion check has been removed from the -mm tree. Its filename was printk-add-interface-for-disabling-recursion-check.patch This patch was dropped because an updated version will be merged The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ From: ShuoX Liu <shuox.liu@xxxxxxxxx> Subject: printk: add interface for disabling recursion check In some special scenarios such as Machine Check Exception happening during a printk, we want to bypass the printk recursion check to print some important information. So we add these interfaces to printk. 1) printk_recursion_check_disable() for disabling recursion check 2) printk_recursion_check_enable() for enabling recursion check Signed-off-by: Yanmin Zhang <yanmin_zhang@xxxxxxxxxxxxxxx> Signed-off-by: ShuoX Liu <shuox.liu@xxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Cc: "H. Peter Anvin" <hpa@xxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxx> Cc: "Luck, Tony" <tony.luck@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/printk.h | 3 +++ kernel/printk.c | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff -puN include/linux/printk.h~printk-add-interface-for-disabling-recursion-check include/linux/printk.h --- a/include/linux/printk.h~printk-add-interface-for-disabling-recursion-check +++ a/include/linux/printk.h @@ -49,6 +49,9 @@ static inline void console_verbose(void) console_loglevel = 15; } +void printk_recursion_check_disable(void); +void printk_recursion_check_enable(void); + struct va_format { const char *fmt; va_list *va; diff -puN kernel/printk.c~printk-add-interface-for-disabling-recursion-check kernel/printk.c --- a/kernel/printk.c~printk-add-interface-for-disabling-recursion-check +++ a/kernel/printk.c @@ -78,6 +78,19 @@ int console_printk[4] = { int oops_in_progress; EXPORT_SYMBOL(oops_in_progress); +static atomic_t recursion_check_disabled = ATOMIC_INIT(0); + +void printk_recursion_check_disable(void) +{ + atomic_inc(&recursion_check_disabled); +} + +void printk_recursion_check_enable(void) +{ + WARN_ON(atomic_read(&recursion_check_disabled) < 1); + atomic_dec(&recursion_check_disabled); +} + /* * console_sem protects the console_drivers list, and also * provides serialisation for access to the entire console @@ -1310,7 +1323,9 @@ asmlinkage int vprintk_emit(int facility * recursion and return - but flag the recursion so that * it can be printed at the next appropriate moment: */ - if (!oops_in_progress && !lockdep_recursing(current)) { + if (!atomic_read(&recursion_check_disabled) + && !oops_in_progress + && !lockdep_recursing(current)) { recursion_bug = 1; goto out_restore_irqs; } _ Patches currently in -mm which might be from shuox.liu@xxxxxxxxx are cpuidle-move-field-disable-from-per-driver-to-per-cpu.patch x86-mce-use-new-printk-recursion-disabling-interface.patch x86-mce-use-new-printk-recursion-disabling-interface-fix.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html