diff mbox

[v2,5/5] ARM: use early console instead of early debug in allmodconfig kernels

Message ID 1414503095-25986-6-git-send-email-kaixu.xia@linaro.org
State New
Headers show

Commit Message

Xia Kaixu Oct. 28, 2014, 1:31 p.m. UTC
The early debug could break something when booting 'allmodconfig'
kernels. So we use early console instead of early debug.

The early console didn't work yet on OMAP4460 because of missing
earlycon support and I am working on that.

Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
---
 arch/arm/Kconfig.debug | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

Comments

Russell King - ARM Linux Oct. 28, 2014, 2:05 p.m. UTC | #1
On Tue, Oct 28, 2014 at 09:31:35PM +0800, Xia Kaixu wrote:
> The early debug could break something when booting 'allmodconfig'
> kernels. So we use early console instead of early debug.
> 
> The early console didn't work yet on OMAP4460 because of missing
> earlycon support and I am working on that.

No. bloody. way.

> @@ -78,7 +78,7 @@ config DEBUG_USER
>  # These options are only for real kernel hackers who want to get their hands dirty.
>  config DEBUG_LL
>  	bool "Kernel low-level debugging functions (read help!)"
> -	depends on DEBUG_KERNEL
> +	depends on DEBUG_KERNEL && !ARCH_MULTIPLATFORM_STRICT

Firstly, this is well advertised that it can only be applied to a single
configuration.  So I don't think we need this dependency here.  Even if
you want to build a strict multiplatform kernel, it should still be
possible to enable this for a specific platform.

It's a developer option, one which requires the developer to engage their
brain before using.

> @@ -1297,6 +1297,29 @@ config EARLY_PRINTK
>  	  kernel low-level debugging functions. Add earlyprintk to your
>  	  kernel parameters to enable this console.
>  
> +config FORCE_EARLY_CONSOLE
> +	bool "Enable all early console drivers"
> +	depends on DEBUG_KERNEL && ARCH_MULTIPLATFORM_STRICT
> +	select TTY
> +	select SERIAL_8250
> +	select SERIAL_8250_CONSOLE
> +	select SERIAL_AMBA_PL011
> +	select SERIAL_AMBA_PL011_CONSOLE
> +	select SERIAL_EARLYCON_ARM_SEMIHOST
> +	select SERIAL_MSM
> +	select SERIAL_MSM_CONSOLE
> +	select SERIAL_XILINX_PS_UART
> +	select SERIAL_XILINX_PS_UART_CONSOLE

Not only will this be a for-ever expanding list, but it'll also continually
suffer from various problems with dependencies.  I absolutely *HATE* the
idea of selecting user visible options like this.
Arnd Bergmann Oct. 28, 2014, 2:29 p.m. UTC | #2
On Tuesday 28 October 2014 14:05:36 Russell King - ARM Linux wrote:
> On Tue, Oct 28, 2014 at 09:31:35PM +0800, Xia Kaixu wrote:
> > The early debug could break something when booting 'allmodconfig'
> > kernels. So we use early console instead of early debug.
> > 
> > The early console didn't work yet on OMAP4460 because of missing
> > earlycon support and I am working on that.
> 
> No. bloody. way.
> 
> > @@ -78,7 +78,7 @@ config DEBUG_USER
> >  # These options are only for real kernel hackers who want to get their hands dirty.
> >  config DEBUG_LL
> >       bool "Kernel low-level debugging functions (read help!)"
> > -     depends on DEBUG_KERNEL
> > +     depends on DEBUG_KERNEL && !ARCH_MULTIPLATFORM_STRICT
> 
> Firstly, this is well advertised that it can only be applied to a single
> configuration.  So I don't think we need this dependency here.  Even if
> you want to build a strict multiplatform kernel, it should still be
> possible to enable this for a specific platform.

I've asked Kaixu to do this patch. This is one of the most fundamental
uses of ARCH_MULTIPLATFORM_STRICT: as soon as you turn on DEBUG_LL, the
kernel no longer runs on any other platform, so it can still be built
as a multiplatform kernel, but not a "strict" one that is known to
work on all hardware that is enabled.
 
> It's a developer option, one which requires the developer to engage their
> brain before using.

Exactly, and I think it's not asking too much from a developer to turn
off ARCH_MULTIPLATFORM_STRICT if they want to turn on DEBUG_LL. Nothing
else should change if you do that.

The main use of the symbol is really to avoid turning on DEBUG_LL is
allmodconfig kernels, which will always enable ARCH_MULTIPLATFORM_STRICT.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Russell King - ARM Linux Oct. 28, 2014, 2:35 p.m. UTC | #3
On Tue, Oct 28, 2014 at 03:29:01PM +0100, Arnd Bergmann wrote:
> On Tuesday 28 October 2014 14:05:36 Russell King - ARM Linux wrote:
> > On Tue, Oct 28, 2014 at 09:31:35PM +0800, Xia Kaixu wrote:
> > > The early debug could break something when booting 'allmodconfig'
> > > kernels. So we use early console instead of early debug.
> > > 
> > > The early console didn't work yet on OMAP4460 because of missing
> > > earlycon support and I am working on that.
> > 
> > No. bloody. way.
> > 
> > > @@ -78,7 +78,7 @@ config DEBUG_USER
> > >  # These options are only for real kernel hackers who want to get their hands dirty.
> > >  config DEBUG_LL
> > >       bool "Kernel low-level debugging functions (read help!)"
> > > -     depends on DEBUG_KERNEL
> > > +     depends on DEBUG_KERNEL && !ARCH_MULTIPLATFORM_STRICT
> > 
> > Firstly, this is well advertised that it can only be applied to a single
> > configuration.  So I don't think we need this dependency here.  Even if
> > you want to build a strict multiplatform kernel, it should still be
> > possible to enable this for a specific platform.
> 
> I've asked Kaixu to do this patch. This is one of the most fundamental
> uses of ARCH_MULTIPLATFORM_STRICT: as soon as you turn on DEBUG_LL, the
> kernel no longer runs on any other platform, so it can still be built
> as a multiplatform kernel, but not a "strict" one that is known to
> work on all hardware that is enabled.

No, that is not correct.  You can turn on DEBUG_LL, and a multiplatform
kernel will still run.

The point at which it won't run is if you call the DEBUG_LL function on
a platform it wasn't configured for.  That happens if you start using
the printascii() et.al. functions, or (against my better judgement) the
early console support is enabled.

So, as the early console support went against my wishes there, I see
this problem as more of an early console problem than a DEBUG_LL problem.

> Exactly, and I think it's not asking too much from a developer to turn
> off ARCH_MULTIPLATFORM_STRICT if they want to turn on DEBUG_LL. Nothing
> else should change if you do that.
> 
> The main use of the symbol is really to avoid turning on DEBUG_LL is
> allmodconfig kernels, which will always enable ARCH_MULTIPLATFORM_STRICT.

It's pointless if that's all that ARCH_MULTIPLATFORM_STRICT ends up
doing.  It just needlessly adds extra configuration options.  There's
already thousands of kernel options, we don't need any more stupid
idiotic options to clutter the already densely populated forest, and
make it yet harder to work out wtf we're doing with all these options.
diff mbox

Patch

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 03dc4c1..897e4ab 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -78,7 +78,7 @@  config DEBUG_USER
 # These options are only for real kernel hackers who want to get their hands dirty.
 config DEBUG_LL
 	bool "Kernel low-level debugging functions (read help!)"
-	depends on DEBUG_KERNEL
+	depends on DEBUG_KERNEL && !ARCH_MULTIPLATFORM_STRICT
 	help
 	  Say Y here to include definitions of printascii, printch, printhex
 	  in the kernel.  This is helpful if you are debugging code that
@@ -1297,6 +1297,29 @@  config EARLY_PRINTK
 	  kernel low-level debugging functions. Add earlyprintk to your
 	  kernel parameters to enable this console.
 
+config FORCE_EARLY_CONSOLE
+	bool "Enable all early console drivers"
+	depends on DEBUG_KERNEL && ARCH_MULTIPLATFORM_STRICT
+	select TTY
+	select SERIAL_8250
+	select SERIAL_8250_CONSOLE
+	select SERIAL_AMBA_PL011
+	select SERIAL_AMBA_PL011_CONSOLE
+	select SERIAL_EARLYCON_ARM_SEMIHOST
+	select SERIAL_MSM
+	select SERIAL_MSM_CONSOLE
+	select SERIAL_XILINX_PS_UART
+	select SERIAL_XILINX_PS_UART_CONSOLE
+	help
+	  On strict multiplatform configurations, the early debug code
+	  is not available, so the early console code should be used
+	  for debugging the startup code.
+	  This option ensures that all of the earlycon drivers are enabled,
+	  which is mainly useful for booting 'allmodconfig' kernels.
+
+	  It is always safe to say 'N' here for a smaller kernel and to
+	  select the required options individually.
+
 config OC_ETM
 	bool "On-chip ETM and ETB"
 	depends on ARM_AMBA