Re: [PATCH 2/3] early_printk: Add force_early_printk kernel parameter
From: Petr Mladek
Date: Tue Nov 29 2016 - 09:02:59 EST
On Tue 2016-10-18 19:08:32, Peter Zijlstra wrote:
> Add add the 'force_early_printk' kernel parameter to override printk()
> and force it into early_printk(). This bypasses all the cruft and fail
> from printk() and makes things work again.
IMHO, the patch makes perfect sense and helps with debugging
hard problems.
> --- a/kernel/printk/printk.c
> +++ b/kernel/printk/printk.c
> @@ -1751,10 +1787,13 @@ asmlinkage int vprintk_emit(int facility
> static unsigned int logbuf_cpu = UINT_MAX;
>
> #ifdef CONFIG_KGDB_KDB
> - if (unlikely(kdb_trap_printk)) {
> - r = vkdb_printf(KDB_MSGSRC_PRINTK, fmt, args);
> - return r;
> - }
> + if (unlikely(kdb_trap_printk))
> + return vkdb_printf(KDB_MSGSRC_PRINTK, fmt, args);
> +#endif
Please, find below an updated patch that has also my Reviewed-by.
In particular, the above change was moved to the first patch
to fix bisectability. The result after applying both patches
is still exactly the same.