Re: [PATCH 17/17] RISC-V: Build Infastructure

From: Michael Ellerman
Date: Tue Jul 11 2017 - 02:31:31 EST

Palmer Dabbelt <palmer@xxxxxxxxxxx> writes:

> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> new file mode 100644
> index 000000000000..366f5f2cf106
> --- /dev/null
> +++ b/arch/riscv/Kconfig
> @@ -0,0 +1,294 @@
> +
> +config EARLY_PRINTK
> + bool "Early printk"
> + default n
> + help
> + This option enables special console drivers which allow the kernel
> + to print messages very early in the bootup process.
> +
> + This is useful for kernel debugging when your machine crashes very
> + early before the console code is initialized. For normal operation
> + it is not recommended because it looks ugly and doesn't cooperate
> + with klogd/syslogd or the X server. You should normally N here,
> + unless you want to debug such a crash.

Looks like you copied this text from x86? I think the comment about it
being ugly refers to the VGA early console which you don't have, so
that's not really accurate.

And the part about it not cooperating with klogs/syslogd is true, early
printk output doesn't go to syslog. But if you turn EARLY_PRINTK off
then early printk output goes nowhere at all:

extern asmlinkage __printf(1, 2)
void early_printk(const char *fmt, ...);
static inline __printf(1, 2) __cold
void early_printk(const char *s, ...) { }

So if you have a functional early console (which I think you do) then
you might be better off just making this def_bool y.