Skip to contentSkip to conversation

ARM: Add config option DEBUG_DECOMPRESS_KERNEL

PATCH New Maximilian Schwerin 7 participants 14 messages Sep 17, 2012 – Sep 18, 2012 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: Add config option DEBUG_DECOMPRESS_KERNEL

This change allows preventing the message "Uncompressing Linux..." from being sent to serial port. This is necessary if the primary serial port is used for something other than kernel debugging (e.g. some external device controlled by serial commands).

---
 arch/arm/Kconfig.debug          |    9 +++++++++
 arch/arm/boot/compressed/misc.c |    4 ++++
 2 files changed, 13 insertions(+), 0 deletions(-)
arch/arm/Kconfig.debug +9 -0
index e968a52..96e90dc 100644
@@ -46,6 +46,15 @@ config OLD_MCOUNT
 	depends on FUNCTION_TRACER && FRAME_POINTER
 	default y
 
+config DEBUG_DECOMPRESS_KERNEL
+	bool "Using serial port during decompressing kernel"
+	depends on DEBUG_KERNEL
+	default n
+	help
+	  If you say Y here you will confirm the start and the end of
+	  decompressing Linux seeing "Uncompressing Linux... " and
+	  " done, booting the kernel.\n" on console.
+
 config DEBUG_USER
 	bool "Verbose user fault messages"
 	help
arch/arm/boot/compressed/misc.c +4 -0
index 8e2a8fc..edf4a35 100644
@@ -144,11 +144,15 @@ decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p,
 
 	arch_decomp_setup();
 
+#ifdef CONFIG_DEBUG_DECOMPRESS_KERNEL
 	putstr("Uncompressing Linux...");
+#endif /* CONFIG_DEBUG_DECOMPRESS_KERNEL */
 	ret = do_decompress(input_data, input_data_end - input_data,
 			    output_data, error);
 	if (ret)
 		error("decompressor returned an error");
+#ifdef CONFIG_DEBUG_DECOMPRESS_KERNEL
 	else
 		putstr(" done, booting the kernel.\n");
+#endif /* CONFIG_DEBUG_DECOMPRESS_KERNEL */
 }
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 1/1 ARM: Add config option DEBUG_DECOMPRESS_KERNEL

Quoted 4 lines · Maximilian Schwerin

This change allows preventing the message "Uncompressing Linux..." from being sent to serial port. This is necessary if the primary serial port is used for something other than kernel debugging (e.g. some external device controlled by serial commands).

Disabling CONFIG_DEBUG_LL doesn't work?

Regards,
Domenico

#2 lore raw
Quoted 14 lines

-----Urspr?ngliche Nachricht-----
Von: Domenico Andreoli
[mailto:domenico.andreoli.it at gmail.com] Im Auftrag von Domenico Andreoli
Gesendet: Montag, 17. September 2012 15:17
An: Maximilian Schwerin
Cc: linux-arm-kernel at lists.infradead.org
Betreff: Re: [PATCH] ARM: Add config option DEBUG_DECOMPRESS_KERNEL

Quoted 1 line · Maximilian Schwerin

This change allows preventing the message "Uncompressing

Linux..." from

Quoted 1 line

being sent to serial port. This is necessary if the primary

serial port is

Quoted 9 lines
Quoted 1 line

used for something other than kernel debugging (e.g. some

external device

Quoted 1 line

controlled by serial commands).

Disabling CONFIG_DEBUG_LL doesn't work?

Regards,
Domenico

No (never had that enabled), but that may be a bug or omission in the platform (omap3) code?!

Regards, m.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120917/101b00c3/attachment.sig>

#3 lore raw

How to disable message "Uncompressing linux..." on kernel start?

Hi all,

I have been convinced that my patch for disabling the message "Uncompressing linux..." on kernel start was not all that good an idea. As the problem still remains an issue for me and I'd like to find a fix for everyone I'd like to ask for pointers where or how to fix this.

To sum up my problem: I'm using the primary serial port on an OMAP3 as a debug console for development. In production we set the u-boot silent option which disables all kernel logging to this serial port. The only kernel message that remains is "Uncompressing linux..." at the very beginning. As we connect an external device via this port in production environments this is not acceptable.

Cheers, m.

#4 lore raw

Re: How to disable message "Uncompressing linux..." on kernel start?

Hi,

Quoted 11 lines · Maximilian Schwerin

I have been convinced that my patch for disabling the message "Uncompressing linux..." on kernel start was not all that good an idea. As the problem still remains an issue for me and I'd like to find a fix for everyone I'd like to ask for pointers where or how to fix this.

To sum up my problem: I'm using the primary serial port on an OMAP3 as a debug console for development. In production we set the u-boot silent option which disables all kernel logging to this serial port. The only kernel message that remains is "Uncompressing linux..." at the very beginning. As we connect an external device via this port in production environments this is not acceptable.

I don't think that would be an acceptable patch upstream, but you can hold a local patch to remove that print from your own kernel. I'd still try to get the production environment to ignore that "Uncompressing Linux..." string, otherwise you will have to keep patching the kernel for every release you try to use. Anyway, this should do:

arch/arm/boot/compressed/misc.c +0 -3
index 8e2a8fc..e7c8ff3 100644
@@ -144,11 +144,8 @@ decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p,
 
 	arch_decomp_setup();
 
-	putstr("Uncompressing Linux...");
 	ret = do_decompress(input_data, input_data_end - input_data,
 			    output_data, error);
 	if (ret)
 		error("decompressor returned an error");
-	else
-		putstr(" done, booting the kernel.\n");
 }
Signature · 1 line
balbi
#5 lore raw

AW: How to disable message "Uncompressing linux..." on kernel start?

Quoted 53 lines

-----Ursprüngliche Nachricht-----
Von: Felipe Balbi [mailto:[email protected]]
Gesendet: Dienstag, 18. September 2012 10:50
An: Maximilian Schwerin
Cc: [email protected]
Betreff: Re: How to disable message "Uncompressing linux..." on kernel start? (PGP: Plain, Unable to verify signature)

Hi,

Quoted 2 lines · Maximilian Schwerin

I have been convinced that my patch for disabling the message "Uncompressing linux..." on kernel start was not all that

good an idea.

Quoted 1 line

As the problem still remains an issue for me and I'd like

to find a fix

Quoted 3 lines

for everyone I'd like to ask for pointers where or how to fix this.

To sum up my problem: I'm using the primary serial port on

an OMAP3 as a

Quoted 1 line

debug console for development. In production we set the

u-boot silent

Quoted 1 line

option which disables all kernel logging to this serial

port. The only

Quoted 2 lines

kernel message that remains is "Uncompressing linux..." at the very beginning. As we connect an external device via this port

in production

Quoted 1 line

environments this is not acceptable.

I don't think that would be an acceptable patch upstream, but you can hold a local patch to remove that print from your own kernel. I'd still
try to get the production environment to ignore that "Uncompressing Linux..." string, otherwise you will have to keep patching the kernel for every release you try to use. Anyway, this should do:

arch/arm/boot/compressed/misc.c +0 -3
index 8e2a8fc..e7c8ff3 100644
@@ -144,11 +144,8 @@ decompress_kernel(unsigned long 
 output_start, unsigned long free_mem_ptr_p,
 
 	arch_decomp_setup();
 
-	putstr("Uncompressing Linux...");
 	ret = do_decompress(input_data, input_data_end - input_data,
 			    output_data, error);
 	if (ret)
 		error("decompressor returned an error");
-	else
-		putstr(" done, booting the kernel.\n");
Quoted 5 lines

}

Signature · 1 line
balbi

This is more or less what I proposed in my patch (see http://www.spinics.net/lists/arm-kernel/msg195787.html) and what I have been doing up to now.

Cheers, m.

#6 lore raw

Re: How to disable message "Uncompressing linux..." on kernel start?

In reply to Maximilian Schwerin
Quoted 7 lines · Maximilian Schwerin

Hi all,

I have been convinced that my patch for disabling the message "Uncompressing linux..." on kernel start was not all that good an idea. As the problem still remains an issue for me and I'd like to find a fix for everyone I'd like to ask for pointers where or how to fix this.

Quoted 7 lines

To sum up my problem: I'm using the primary serial port on an OMAP3 as a debug console for development. In production we set the u-boot silent option which disables all kernel logging to this serial port. The only kernel message that remains is "Uncompressing linux..." at the very beginning. As we connect an external device via this port in production environments this is not acceptable.

Perhaps adding config choice under "Kernel low-level debugging port", to select the UART port to direct the early prints to, would help. Like some platforms already do. See DEBUG_CLPS711X_UART1/2 , DEBUG_MSM_UART1/2/3 etc.

#7 lore raw

Re: How to disable message "Uncompressing linux..." on kernel start?

Quoted 16 lines · Jassi Brar
Quoted 7 lines · Maximilian Schwerin

Hi all,

I have been convinced that my patch for disabling the message "Uncompressing linux..." on kernel start was not all that good an idea. As the problem still remains an issue for me and I'd like to find a fix for everyone I'd like to ask for pointers where or how to fix this.

Quoted 7 lines

To sum up my problem: I'm using the primary serial port on an OMAP3 as a debug console for development. In production we set the u-boot silent option which disables all kernel logging to this serial port. The only kernel message that remains is "Uncompressing linux..." at the very beginning. As we connect an external device via this port in production environments this is not acceptable.

Quoted 4 lines

Perhaps adding config choice under "Kernel low-level debugging port", to select the UART port to direct the early prints to, would help. Like some platforms already do. See DEBUG_CLPS711X_UART1/2 , DEBUG_MSM_UART1/2/3 etc.

On a second thought, I think we need a new config independent of DEBUG_LL. Something like what Samsung code does with symbol S3C_LOWLEVEL_UART_PORT in arch/arm/plat-samsung/Kconfig

#8 lore raw

AW: How to disable message "Uncompressing linux..." on kernel start?

Quoted 35 lines

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] Im Auftrag von Jassi Brar
Gesendet: Dienstag, 18. September 2012 12:23
An: Maximilian Schwerin
Cc: [email protected]
Betreff: Re: How to disable message "Uncompressing linux..." on kernel start?

Quoted 6 lines · Jassi Brar
Quoted 4 lines · Maximilian Schwerin

Hi all,

I have been convinced that my patch for disabling the message "Uncompressing linux..." on kernel start was not all that

good an idea.

Quoted 1 line
Quoted 1 line

As the problem still remains an issue for me and I'd like

to find a fix

Quoted 3 lines
Quoted 3 lines

for everyone I'd like to ask for pointers where or how to fix this.

To sum up my problem: I'm using the primary serial port on

an OMAP3 as a

Quoted 1 line
Quoted 1 line

debug console for development. In production we set the

u-boot silent

Quoted 1 line
Quoted 1 line

option which disables all kernel logging to this serial

port. The only

Quoted 2 lines
Quoted 2 lines

kernel message that remains is "Uncompressing linux..." at the very beginning. As we connect an external device via this port

in production

Quoted 3 lines
Quoted 2 lines

environments this is not acceptable.

Perhaps adding config choice under "Kernel low-level

debugging port",

Quoted 8 lines
Quoted 3 lines

to select the UART port to direct the early prints to, would help. Like some platforms already do. See DEBUG_CLPS711X_UART1/2 , DEBUG_MSM_UART1/2/3 etc.

On a second thought, I think we need a new config independent of DEBUG_LL.
Something like what Samsung code does with symbol S3C_LOWLEVEL_UART_PORT in arch/arm/plat-samsung/Kconfig

In my case I need to be able to disable it completely.

#9 lore raw

Re: How to disable message "Uncompressing linux..." on kernel start?

Quoted 28 lines
Quoted 28 lines
Quoted 6 lines
Quoted 4 lines · Maximilian Schwerin

Hi all,

I have been convinced that my patch for disabling the message "Uncompressing linux..." on kernel start was not all that

good an idea.

Quoted 1 line
Quoted 1 line

As the problem still remains an issue for me and I'd like

to find a fix

Quoted 3 lines
Quoted 3 lines

for everyone I'd like to ask for pointers where or how to fix this.

To sum up my problem: I'm using the primary serial port on

an OMAP3 as a

Quoted 1 line
Quoted 1 line

debug console for development. In production we set the

u-boot silent

Quoted 1 line
Quoted 1 line

option which disables all kernel logging to this serial

port. The only

Quoted 2 lines
Quoted 2 lines

kernel message that remains is "Uncompressing linux..." at the very beginning. As we connect an external device via this port

in production

Quoted 3 lines
Quoted 2 lines

environments this is not acceptable.

Perhaps adding config choice under "Kernel low-level

debugging port",

Quoted 3 lines

to select the UART port to direct the early prints to, would help. Like some platforms already do. See DEBUG_CLPS711X_UART1/2 , DEBUG_MSM_UART1/2/3 etc.

Quoted 7 lines
Quoted 4 lines

On a second thought, I think we need a new config independent of DEBUG_LL.
Something like what Samsung code does with symbol S3C_LOWLEVEL_UART_PORT in arch/arm/plat-samsung/Kconfig

In my case I need to be able to disable it completely.

The idea is to direct the output to some other (unused) UART port.

Also if one doesn't select DEBUG_LL, I wonder if it makes sense to expect the "Uncompressing .... " message, which too is just dumping raw data onto UART. So another option might be to simply use CONFIG_DEBUG_LL instead of CONFIG_DEBUG_DECOMPRESS_KERNEL ?

#10 lore raw

AW: How to disable message "Uncompressing linux..." on kernel start?

Quoted 45 lines

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] Im Auftrag von Jassi Brar
Gesendet: Dienstag, 18. September 2012 13:54
An: Maximilian Schwerin
Cc: [email protected]
Betreff: Re: How to disable message "Uncompressing linux..." on kernel start?

Quoted 10 lines
Quoted 10 lines
Quoted 6 lines
Quoted 4 lines · Maximilian Schwerin

Hi all,

I have been convinced that my patch for disabling the message "Uncompressing linux..." on kernel start was not all that

good an idea.

Quoted 1 line
Quoted 1 line

As the problem still remains an issue for me and I'd like

to find a fix

Quoted 1 line
Quoted 1 line

for everyone I'd like to ask for pointers where or how

to fix this.

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

To sum up my problem: I'm using the primary serial port on

an OMAP3 as a

Quoted 1 line
Quoted 1 line

debug console for development. In production we set the

u-boot silent

Quoted 1 line
Quoted 1 line

option which disables all kernel logging to this serial

port. The only

Quoted 1 line
Quoted 1 line

kernel message that remains is "Uncompressing linux..."

at the very

Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line

beginning. As we connect an external device via this port

in production

Quoted 3 lines
Quoted 2 lines

environments this is not acceptable.

Perhaps adding config choice under "Kernel low-level

debugging port",

Quoted 1 line

to select the UART port to direct the early prints to,

would help.

Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

Like some platforms already do. See DEBUG_CLPS711X_UART1/2 , DEBUG_MSM_UART1/2/3 etc.

On a second thought, I think we need a new config independent of DEBUG_LL.
Something like what Samsung code does with symbol S3C_LOWLEVEL_UART_PORT in arch/arm/plat-samsung/Kconfig

Quoted 8 lines
Quoted 2 lines

In my case I need to be able to disable it completely.

The idea is to direct the output to some other (unused) UART port.

Also if one doesn't select DEBUG_LL, I wonder if it makes sense to expect the "Uncompressing .... " message, which too is just dumping raw data onto UART. So another option might be to simply use CONFIG_DEBUG_LL instead of CONFIG_DEBUG_DECOMPRESS_KERNEL ?

In http://www.spinics.net/lists/arm-kernel/msg195871.html Russell King pointed out that the message goes to fb on some platforms. So the ideal solution would be to assure, that this message is not printed if the kernel parameter console is not set.

#11 lore raw

PATCH 1/1 ARM: Add config option DEBUG_DECOMPRESS_KERNEL

In reply to Maximilian Schwerin
Quoted 17 lines · Maximilian Schwerin

This change allows preventing the message "Uncompressing Linux..." from being sent to serial port. This is necessary if the primary serial port is used for something other than kernel debugging (e.g. some external device controlled by serial commands).

---
 arch/arm/Kconfig.debug          |    9 +++++++++
 arch/arm/boot/compressed/misc.c |    4 ++++
 2 files changed, 13 insertions(+), 0 deletions(-)
arch/arm/Kconfig.debug +0 -0
index e968a52..96e90dc 100644
@@ -46,6 +46,15 @@ config OLD_MCOUNT
 	depends on FUNCTION_TRACER && FRAME_POINTER

arch/arm/Kconfig.debug config OLD_MCOUNT · line 56

Quoted 10 lines
arch/arm/Kconfig.debug +8 -0
 	default y
 
+config DEBUG_DECOMPRESS_KERNEL
+	bool "Using serial port during decompressing kernel"
+	depends on DEBUG_KERNEL
+	default n
+	help
+	  If you say Y here you will confirm the start and the end of
+	  decompressing Linux seeing "Uncompressing Linux... " and
+	  " done, booting the kernel.\n" on console.

First, "default n" is the default already, so you don't need to provide it.

Next, this is going to disable the output by default for everyone which is an unwelcome change. You should make sure that the default behavior is like before, and that the option allows you to disable the output.

And then the DEBUG_DECOMPRESS_KERNEL option is a rather bad name. This output has not been considered "debugging" before. What about "INHIBIT_DECOMPRESSOR_OUTPUT" instead?

Quoted 9 lines
arch/arm/boot/compressed/misc.c +1 -0
index 8e2a8fc..edf4a35 100644
@@ -144,11 +144,15 @@ decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p,
 
 	arch_decomp_setup();
 
+#ifdef CONFIG_DEBUG_DECOMPRESS_KERNEL

arch/arm/boot/compressed/misc.c decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p, · line 157

Quoted 10 lines
arch/arm/boot/compressed/misc.c +3 -0
 	putstr("Uncompressing Linux...");
+#endif /* CONFIG_DEBUG_DECOMPRESS_KERNEL */
 	ret = do_decompress(input_data, input_data_end - input_data,
 			    output_data, error);
 	if (ret)
 		error("decompressor returned an error");
+#ifdef CONFIG_DEBUG_DECOMPRESS_KERNEL
 	else
 		putstr(" done, booting the kernel.\n");
+#endif /* CONFIG_DEBUG_DECOMPRESS_KERNEL */

That would be cleaner if you simply redefined putstr() to an empty stub. Similarly for error() which still can output to the same UART.

Nicolas

#12 lore raw
Quoted 31 lines

-----Urspr?ngliche Nachricht-----
Von: Nicolas Pitre [mailto:nico at fluxnic.net]
Gesendet: Montag, 17. September 2012 19:30
An: Maximilian Schwerin
Cc: linux-arm-kernel at lists.infradead.org
Betreff: Re: [PATCH] ARM: Add config option DEBUG_DECOMPRESS_KERNEL

Quoted 1 line · Maximilian Schwerin

This change allows preventing the message "Uncompressing

Linux..." from

Quoted 1 line

being sent to serial port. This is necessary if the primary

serial port is

Quoted 1 line

used for something other than kernel debugging (e.g. some

external device

Quoted 16 lines

controlled by serial commands).

---
 arch/arm/Kconfig.debug          |    9 +++++++++
 arch/arm/boot/compressed/misc.c |    4 ++++
 2 files changed, 13 insertions(+), 0 deletions(-)
arch/arm/Kconfig.debug +0 -0
index e968a52..96e90dc 100644
@@ -46,6 +46,15 @@ config OLD_MCOUNT
 	depends on FUNCTION_TRACER && FRAME_POINTER
 	default y
 
Quoted 12 lines

arch/arm/Kconfig.debug config OLD_MCOUNT · line 56

Quoted 8 lines
arch/arm/Kconfig.debug +8 -0
+config DEBUG_DECOMPRESS_KERNEL
+	bool "Using serial port during decompressing kernel"
+	depends on DEBUG_KERNEL
+	default n
+	help
+	  If you say Y here you will confirm the start and the end of
+	  decompressing Linux seeing "Uncompressing Linux... " and
+	  " done, booting the kernel.\n" on console.

First, "default n" is the default already, so you don't need to provide
it.

Makes sense.

Quoted 10 lines

Next, this is going to disable the output by default for everyone which
is an unwelcome change. You should make sure that the default behavior
is like before, and that the option allows you to disable the output.

And then the DEBUG_DECOMPRESS_KERNEL option is a rather bad name. This
output has not been considered "debugging" before. What about "INHIBIT_DECOMPRESSOR_OUTPUT" instead?

This is something I copied from arch/mn10300/Kconfig.debug (see http://kernel.org/doc/menuconfig/arch-mn10300-Kconfig.debug.html).

Quoted 27 lines

Review

Quoted 1 line
(quoted diff) +0 -0

b/arch/arm/boot/compressed/misc.c

arch/arm/boot/compressed/misc.c decompress_kernel(unsigned long

Quoted 4 lines

index 8e2a8fc..edf4a35 100644

arch/arm/boot/compressed/misc.c +0 -0
@@ -144,11 +144,15 @@ decompress_kernel(unsigned long 

output_start, unsigned long free_mem_ptr_p,

Quoted 4 lines
arch/arm/boot/compressed/misc.c +1 -0
 	arch_decomp_setup();
 
+#ifdef CONFIG_DEBUG_DECOMPRESS_KERNEL

arch/arm/boot/compressed/misc.c decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p, · line 157

Quoted 10 lines
arch/arm/boot/compressed/misc.c +3 -0
 	putstr("Uncompressing Linux...");
+#endif /* CONFIG_DEBUG_DECOMPRESS_KERNEL */
 	ret = do_decompress(input_data, input_data_end - input_data,
 			    output_data, error);
 	if (ret)
 		error("decompressor returned an error");
+#ifdef CONFIG_DEBUG_DECOMPRESS_KERNEL
 	else
 		putstr(" done, booting the kernel.\n");
+#endif /* CONFIG_DEBUG_DECOMPRESS_KERNEL */

That would be cleaner if you simply redefined putstr() to an empty stub.
Similarly for error() which still can output to the same UART.

Quoted 2 lines

Nicolas

Thanks for the feedback both of you. I'll get into contact with the OMAP guys and will try to find a fix on the platform level.

Cheers, m.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120918/ca648346/attachment-0001.sig>

#13 lore raw

PATCH 1/1 ARM: Add config option DEBUG_DECOMPRESS_KERNEL

In reply to Maximilian Schwerin
Quoted 4 lines · Maximilian Schwerin

This change allows preventing the message "Uncompressing Linux..." from being sent to serial port. This is necessary if the primary serial port is used for something other than kernel debugging (e.g. some external device controlled by serial commands).

You know, it doesn't have to go to the serial port. It can go to anything. We have at least one platform where it goes to the framebuffer instead, but getting access to the framebuffer is a whole new load of platform dependence that we don't want here.

In any case, ifdefing out the callsites is not the correct approach. We already have this stuff fairly well abstracted, and there's no reason why this can't be done by defining empty putc() and flush() functions.