Skip to contentSkip to conversation

tty/serial: make early console depend on SERIAL_CORE=y

PATCH In review Paul Gortmaker 3 participants 4 messages Oct 18, 2015 – Oct 19, 2015 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tty/serial: make early console depend on SERIAL_CORE=y

On an powerpc allmodconfig build, the following is seen:

paul@builder:~/git/linux-head$ make O=../ppc-build -j30 > /dev/null
drivers/built-in.o: In function `.setup_earlycon':
(.init.text+0x5b00): undefined reference to `.uart_parse_earlycon'
make[1]: *** [vmlinux] Error 1

Since uart_parse_earlycon lives in serial_core.c we need to ensure it is built in if early console is to be used.

Cc Arnd Bergmann <[email protected]>
Cc Peter Hurley <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Jiri Slaby <[email protected]>

---

[A google shows this cropped up in April of this year; I guess it wasn't
completely fixed?
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-April/336954.html
FWIW, I was testing on tty/tty-testing pulled today, from Greg ]

 drivers/tty/serial/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/tty/serial/Kconfig +1 -0
index 1aec4404062d..a646047e4051 100644
@@ -9,6 +9,7 @@ menu "Serial drivers"
 
 config SERIAL_EARLYCON
 	bool
+	depends on SERIAL_CORE=y
 	help
 	  Support for early consoles with the earlycon parameter. This enables
 	  the console before standard serial driver is probed. The console is
Signature · 1 line
2.6.1
#1 lore raw
Quoted 9 lines · On Sunday 18 October 2015 18:06:48 Paul Gortmaker wrote:

On an powerpc allmodconfig build, the following is seen:

paul@builder:~/git/linux-head$ make O=../ppc-build -j30 > /dev/null
drivers/built-in.o: In function `.setup_earlycon':
(.init.text+0x5b00): undefined reference to `.uart_parse_earlycon'
make[1]: *** [vmlinux] Error 1

Since uart_parse_earlycon lives in serial_core.c we need to ensure it is built in if early console is to be used.

I saw the same thing and came up with a different fix

Quoted 6 lines
Cc Arnd Bergmann <[email protected]>
Cc Peter Hurley <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Jiri Slaby <[email protected]>
Quoted 6 lines

---

[A google shows this cropped up in April of this year; I guess it wasn't
completely fixed?
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-April/336954.html
FWIW, I was testing on tty/tty-testing pulled today, from Greg ]

The new problem was clearly caused by 1d59b382f1c4 ("serial: fsl_lpuart:
add earlycon support"), which selects SERIAL_EARLYCON but not SERIAL_CORE_CONSOLE.

However, the way I read Peter's patch from the URL you provided, it seems that it is supposed to work without my patch, so I'm not sure.

Arnd

Quoted 1 line

From 8b8704525b47ba3287de2d7ff89a53e3e335f9d8 Mon Sep 17 00:00:00 2001

From: Arnd Bergmann <[email protected]>
Date: Mon, 19 Oct 2015 13:02:08 +0200
Subject: [PATCH] serial: fsl-lpuart: select SERIAL_CORE_CONSOLE

drivers/built-in.o: In function `setup_earlycon':
:(.init.text+0x2c4c): undefined reference to `uart_parse_earlycon'

drivers/tty/serial/Kconfig +1 -0
index 1aec4404062d..f1a4f9eccc44 100644
@@ -1540,6 +1540,7 @@ config SERIAL_FSL_LPUART
 	depends on HAS_DMA
 	select SERIAL_CORE
 	select SERIAL_EARLYCON
+	select SERIAL_CORE_CONSOLE
 	help
 	  Support for the on-chip lpuart on some Freescale SOCs.
 
#2 lore raw
Quoted 51 lines · [Re: [PATCH] tty/serial: make early console depend on SERIAL_CORE=y] On…
Quoted 9 lines · On Sunday 18 October 2015 18:06:48 Paul Gortmaker wrote:

On an powerpc allmodconfig build, the following is seen:

paul@builder:~/git/linux-head$ make O=../ppc-build -j30 > /dev/null
drivers/built-in.o: In function `.setup_earlycon':
(.init.text+0x5b00): undefined reference to `.uart_parse_earlycon'
make[1]: *** [vmlinux] Error 1

Since uart_parse_earlycon lives in serial_core.c we need to ensure it is built in if early console is to be used.

I saw the same thing and came up with a different fix

Quoted 6 lines
Cc Arnd Bergmann <[email protected]>
Cc Peter Hurley <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Jiri Slaby <[email protected]>
Quoted 6 lines

---

[A google shows this cropped up in April of this year; I guess it wasn't
completely fixed?
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-April/336954.html
FWIW, I was testing on tty/tty-testing pulled today, from Greg ]

The new problem was clearly caused by 1d59b382f1c4 ("serial: fsl_lpuart:
add earlycon support"), which selects SERIAL_EARLYCON but not SERIAL_CORE_CONSOLE.

However, the way I read Peter's patch from the URL you provided, it seems that it is supposed to work without my patch, so I'm not sure.

Arnd

From 8b8704525b47ba3287de2d7ff89a53e3e335f9d8 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <[email protected]>
Date: Mon, 19 Oct 2015 13:02:08 +0200
Subject: [PATCH] serial: fsl-lpuart: select SERIAL_CORE_CONSOLE

drivers/built-in.o: In function `setup_earlycon':
:(.init.text+0x2c4c): undefined reference to `uart_parse_earlycon'

drivers/tty/serial/Kconfig +0 -0
index 1aec4404062d..f1a4f9eccc44 100644

drivers/tty/serial/Kconfig config SERIAL_FSL_LPUART · line 1543

Quoted 4 lines
drivers/tty/serial/Kconfig +1 -0
@@ -1540,6 +1540,7 @@ config SERIAL_FSL_LPUART
 	depends on HAS_DMA
 	select SERIAL_CORE
 	select SERIAL_EARLYCON
+	select SERIAL_CORE_CONSOLE

So the next uart that is not FSL that selects EARLYCON will fail in the same way. Isn't it better to have EARLYCON select it or depend on it; i.e. go to the root of the problem?

Paul.
--

Quoted 4 lines
drivers/tty/serial/Kconfig +0 -0
 	help
 	  Support for the on-chip lpuart on some Freescale SOCs.
 
#3 lore raw
In reply to Arnd Bergmann
Quoted 1 line · Arnd Bergmann

On Sunday 18 October 2015 18:06:48 Paul Gortmaker wrote:

[...]

Quoted 5 lines
Quoted 4 lines

[A google shows this cropped up in April of this year; I guess it wasn't
completely fixed?
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-April/336954.html
FWIW, I was testing on tty/tty-testing pulled today, from Greg ]

Quoted 7 lines

The new problem was clearly caused by 1d59b382f1c4 ("serial: fsl_lpuart:
add earlycon support"), which selects SERIAL_EARLYCON but not SERIAL_CORE_CONSOLE.

However, the way I read Peter's patch from the URL you provided, it seems that it is supposed to work without my patch, so I'm not sure.

Looks like my patch never got applied; I'll resend it.

Regards,
Peter Hurley