linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] tty/serial: to support 8250 earlycon can be enabled independently
@ 2016-05-16 11:35 Zhen Lei
  2016-05-16 15:40 ` Peter Hurley
  0 siblings, 1 reply; 4+ messages in thread
From: Zhen Lei @ 2016-05-16 11:35 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, linux-serial, linux-kernel
  Cc: Zefan Li, Xinwei Hu, Tianhong Ding, Hanjun Guo, Kefeng Wang, Zhen Lei

Sometimes, we may only use SSH to login, and build 8250 uart driver as a
ko(insmod if needed). But the earlycon may still be necessary, because
the kernel boot process may take a long time. It's not good to display
nothing but ask people to wait patiently.

In addition, the 8250.ko can not be worked if we have not opened any
other serial drivers, because SERIAL_CORE would not be selected.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 drivers/tty/serial/8250/Kconfig  | 9 +++++++--
 drivers/tty/serial/8250/Makefile | 1 -
 drivers/tty/serial/Makefile      | 1 +
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
index 4d7cb9c..2992f0a 100644
--- a/drivers/tty/serial/8250/Kconfig
+++ b/drivers/tty/serial/8250/Kconfig
@@ -3,6 +3,12 @@
 # you somehow have an implicit or explicit dependency on SERIAL_8250.
 #

+config SERIAL_8250_EARLYCON
+	bool "Early console using 8250"
+	select SERIAL_CORE
+	select SERIAL_CORE_CONSOLE
+	select SERIAL_EARLYCON
+
 config SERIAL_8250
 	tristate "8250/16550 and compatible serial support"
 	select SERIAL_CORE
@@ -60,8 +66,7 @@ config SERIAL_8250_PNP
 config SERIAL_8250_CONSOLE
 	bool "Console on 8250/16550 and compatible serial port"
 	depends on SERIAL_8250=y
-	select SERIAL_CORE_CONSOLE
-	select SERIAL_EARLYCON
+	select SERIAL_8250_EARLYCON
 	---help---
 	  If you say Y here, it will be possible to use a serial port as the
 	  system console (the system console is the device which receives all
diff --git a/drivers/tty/serial/8250/Makefile b/drivers/tty/serial/8250/Makefile
index c9a2d6e..1f24c74 100644
--- a/drivers/tty/serial/8250/Makefile
+++ b/drivers/tty/serial/8250/Makefile
@@ -13,7 +13,6 @@ obj-$(CONFIG_SERIAL_8250_HP300)		+= 8250_hp300.o
 obj-$(CONFIG_SERIAL_8250_CS)		+= serial_cs.o
 obj-$(CONFIG_SERIAL_8250_ACORN)		+= 8250_acorn.o
 obj-$(CONFIG_SERIAL_8250_BCM2835AUX)	+= 8250_bcm2835aux.o
-obj-$(CONFIG_SERIAL_8250_CONSOLE)	+= 8250_early.o
 obj-$(CONFIG_SERIAL_8250_FOURPORT)	+= 8250_fourport.o
 obj-$(CONFIG_SERIAL_8250_ACCENT)	+= 8250_accent.o
 obj-$(CONFIG_SERIAL_8250_BOCA)		+= 8250_boca.o
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index 8c261ad..cd84181 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -19,6 +19,7 @@ obj-$(CONFIG_SERIAL_SUNSAB) += sunsab.o

 # Now bring in any enabled 8250/16450/16550 type drivers.
 obj-$(CONFIG_SERIAL_8250) += 8250/
+obj-$(CONFIG_SERIAL_8250_EARLYCON) += 8250/8250_early.o

 obj-$(CONFIG_SERIAL_AMBA_PL010) += amba-pl010.o
 obj-$(CONFIG_SERIAL_AMBA_PL011) += amba-pl011.o
--
2.5.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] tty/serial: to support 8250 earlycon can be enabled independently
  2016-05-16 11:35 [PATCH 1/1] tty/serial: to support 8250 earlycon can be enabled independently Zhen Lei
@ 2016-05-16 15:40 ` Peter Hurley
  2016-05-17  6:11   ` Leizhen (ThunderTown)
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Hurley @ 2016-05-16 15:40 UTC (permalink / raw)
  To: Zhen Lei, Greg Kroah-Hartman, Jiri Slaby, linux-serial, linux-kernel
  Cc: Zefan Li, Xinwei Hu, Tianhong Ding, Hanjun Guo, Kefeng Wang

On 05/16/2016 04:35 AM, Zhen Lei wrote:
> Sometimes, we may only use SSH to login, and build 8250 uart driver as a
> ko(insmod if needed). But the earlycon may still be necessary, because
> the kernel boot process may take a long time. It's not good to display
> nothing but ask people to wait patiently.

I'm confused; you want the possibility of earlycon but _not_ a normal
serial console?

This configuration is unsafe because nothing prevents the 8250 driver
and 8250 earlycon from concurrently accessing the hardware.


> In addition, the 8250.ko can not be worked if we have not opened any
> other serial drivers, because SERIAL_CORE would not be selected.

I don't understand what this means.

Regards,
Peter Hurley


> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
>  drivers/tty/serial/8250/Kconfig  | 9 +++++++--
>  drivers/tty/serial/8250/Makefile | 1 -
>  drivers/tty/serial/Makefile      | 1 +
>  3 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
> index 4d7cb9c..2992f0a 100644
> --- a/drivers/tty/serial/8250/Kconfig
> +++ b/drivers/tty/serial/8250/Kconfig
> @@ -3,6 +3,12 @@
>  # you somehow have an implicit or explicit dependency on SERIAL_8250.
>  #
> 
> +config SERIAL_8250_EARLYCON
> +	bool "Early console using 8250"
> +	select SERIAL_CORE
> +	select SERIAL_CORE_CONSOLE
> +	select SERIAL_EARLYCON
> +
>  config SERIAL_8250
>  	tristate "8250/16550 and compatible serial support"
>  	select SERIAL_CORE
> @@ -60,8 +66,7 @@ config SERIAL_8250_PNP
>  config SERIAL_8250_CONSOLE
>  	bool "Console on 8250/16550 and compatible serial port"
>  	depends on SERIAL_8250=y
> -	select SERIAL_CORE_CONSOLE
> -	select SERIAL_EARLYCON
> +	select SERIAL_8250_EARLYCON
>  	---help---
>  	  If you say Y here, it will be possible to use a serial port as the
>  	  system console (the system console is the device which receives all
> diff --git a/drivers/tty/serial/8250/Makefile b/drivers/tty/serial/8250/Makefile
> index c9a2d6e..1f24c74 100644
> --- a/drivers/tty/serial/8250/Makefile
> +++ b/drivers/tty/serial/8250/Makefile
> @@ -13,7 +13,6 @@ obj-$(CONFIG_SERIAL_8250_HP300)		+= 8250_hp300.o
>  obj-$(CONFIG_SERIAL_8250_CS)		+= serial_cs.o
>  obj-$(CONFIG_SERIAL_8250_ACORN)		+= 8250_acorn.o
>  obj-$(CONFIG_SERIAL_8250_BCM2835AUX)	+= 8250_bcm2835aux.o
> -obj-$(CONFIG_SERIAL_8250_CONSOLE)	+= 8250_early.o
>  obj-$(CONFIG_SERIAL_8250_FOURPORT)	+= 8250_fourport.o
>  obj-$(CONFIG_SERIAL_8250_ACCENT)	+= 8250_accent.o
>  obj-$(CONFIG_SERIAL_8250_BOCA)		+= 8250_boca.o
> diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
> index 8c261ad..cd84181 100644
> --- a/drivers/tty/serial/Makefile
> +++ b/drivers/tty/serial/Makefile
> @@ -19,6 +19,7 @@ obj-$(CONFIG_SERIAL_SUNSAB) += sunsab.o
> 
>  # Now bring in any enabled 8250/16450/16550 type drivers.
>  obj-$(CONFIG_SERIAL_8250) += 8250/
> +obj-$(CONFIG_SERIAL_8250_EARLYCON) += 8250/8250_early.o
> 
>  obj-$(CONFIG_SERIAL_AMBA_PL010) += amba-pl010.o
>  obj-$(CONFIG_SERIAL_AMBA_PL011) += amba-pl011.o
> --
> 2.5.0
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-serial" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] tty/serial: to support 8250 earlycon can be enabled independently
  2016-05-16 15:40 ` Peter Hurley
@ 2016-05-17  6:11   ` Leizhen (ThunderTown)
  2016-05-17 10:11     ` Alan
  0 siblings, 1 reply; 4+ messages in thread
From: Leizhen (ThunderTown) @ 2016-05-17  6:11 UTC (permalink / raw)
  To: Peter Hurley, Greg Kroah-Hartman, Jiri Slaby, linux-serial, linux-kernel
  Cc: Zefan Li, Xinwei Hu, Tianhong Ding, Hanjun Guo, Kefeng Wang



On 2016/5/16 23:40, Peter Hurley wrote:
> On 05/16/2016 04:35 AM, Zhen Lei wrote:
>> Sometimes, we may only use SSH to login, and build 8250 uart driver as a
>> ko(insmod if needed). But the earlycon may still be necessary, because
>> the kernel boot process may take a long time. It's not good to display
>> nothing but ask people to wait patiently.
> 
> I'm confused; you want the possibility of earlycon but _not_ a normal
> serial console?
Our downstream customers want add some private functions into 8250.ko. So that, we can not pre-build the 8250 driver into Image.

> 
> This configuration is unsafe because nothing prevents the 8250 driver
> and 8250 earlycon from concurrently accessing the hardware.
earlycon is a boot console, it will be disabled in printk_late_init(suppose we have not set keep_bootcon).

> 
> 
>> In addition, the 8250.ko can not be worked if we have not opened any
>> other serial drivers, because SERIAL_CORE would not be selected.
> 
> I don't understand what this means.

Before I opened CONFIG_SERIAL_AMBA_PL011_CONSOLE(only built 8250 as a module, this case can not be worked):
CONFIG_SERIAL_CORE=m

After I opened CONFIG_SERIAL_AMBA_PL011_CONSOLE:
CONFIG_SERIAL_EARLYCON=y
CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y

> 
> Regards,
> Peter Hurley
> 
> 
>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
>> ---
>>  drivers/tty/serial/8250/Kconfig  | 9 +++++++--
>>  drivers/tty/serial/8250/Makefile | 1 -
>>  drivers/tty/serial/Makefile      | 1 +
>>  3 files changed, 8 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
>> index 4d7cb9c..2992f0a 100644
>> --- a/drivers/tty/serial/8250/Kconfig
>> +++ b/drivers/tty/serial/8250/Kconfig
>> @@ -3,6 +3,12 @@
>>  # you somehow have an implicit or explicit dependency on SERIAL_8250.
>>  #
>>
>> +config SERIAL_8250_EARLYCON
>> +	bool "Early console using 8250"
>> +	select SERIAL_CORE
>> +	select SERIAL_CORE_CONSOLE
>> +	select SERIAL_EARLYCON
>> +
>>  config SERIAL_8250
>>  	tristate "8250/16550 and compatible serial support"
>>  	select SERIAL_CORE
>> @@ -60,8 +66,7 @@ config SERIAL_8250_PNP
>>  config SERIAL_8250_CONSOLE
>>  	bool "Console on 8250/16550 and compatible serial port"
>>  	depends on SERIAL_8250=y
>> -	select SERIAL_CORE_CONSOLE
>> -	select SERIAL_EARLYCON
>> +	select SERIAL_8250_EARLYCON
>>  	---help---
>>  	  If you say Y here, it will be possible to use a serial port as the
>>  	  system console (the system console is the device which receives all
>> diff --git a/drivers/tty/serial/8250/Makefile b/drivers/tty/serial/8250/Makefile
>> index c9a2d6e..1f24c74 100644
>> --- a/drivers/tty/serial/8250/Makefile
>> +++ b/drivers/tty/serial/8250/Makefile
>> @@ -13,7 +13,6 @@ obj-$(CONFIG_SERIAL_8250_HP300)		+= 8250_hp300.o
>>  obj-$(CONFIG_SERIAL_8250_CS)		+= serial_cs.o
>>  obj-$(CONFIG_SERIAL_8250_ACORN)		+= 8250_acorn.o
>>  obj-$(CONFIG_SERIAL_8250_BCM2835AUX)	+= 8250_bcm2835aux.o
>> -obj-$(CONFIG_SERIAL_8250_CONSOLE)	+= 8250_early.o
>>  obj-$(CONFIG_SERIAL_8250_FOURPORT)	+= 8250_fourport.o
>>  obj-$(CONFIG_SERIAL_8250_ACCENT)	+= 8250_accent.o
>>  obj-$(CONFIG_SERIAL_8250_BOCA)		+= 8250_boca.o
>> diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
>> index 8c261ad..cd84181 100644
>> --- a/drivers/tty/serial/Makefile
>> +++ b/drivers/tty/serial/Makefile
>> @@ -19,6 +19,7 @@ obj-$(CONFIG_SERIAL_SUNSAB) += sunsab.o
>>
>>  # Now bring in any enabled 8250/16450/16550 type drivers.
>>  obj-$(CONFIG_SERIAL_8250) += 8250/
>> +obj-$(CONFIG_SERIAL_8250_EARLYCON) += 8250/8250_early.o
>>
>>  obj-$(CONFIG_SERIAL_AMBA_PL010) += amba-pl010.o
>>  obj-$(CONFIG_SERIAL_AMBA_PL011) += amba-pl011.o
>> --
>> 2.5.0
>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-serial" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
> 
> 
> .
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] tty/serial: to support 8250 earlycon can be enabled independently
  2016-05-17  6:11   ` Leizhen (ThunderTown)
@ 2016-05-17 10:11     ` Alan
  0 siblings, 0 replies; 4+ messages in thread
From: Alan @ 2016-05-17 10:11 UTC (permalink / raw)
  To: Leizhen (ThunderTown)
  Cc: Peter Hurley, Greg Kroah-Hartman, Jiri Slaby, linux-serial,
	linux-kernel, Zefan Li, Xinwei Hu, Tianhong Ding, Hanjun Guo,
	Kefeng Wang

> > I'm confused; you want the possibility of earlycon but _not_ a
> > normal serial console?  
> Our downstream customers want add some private functions into
> 8250.ko. So that, we can not pre-build the 8250 driver into Image.

The starting point would be to share that functionality with the
community and look at how it can be merged nicely. 

Alan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-17 10:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-16 11:35 [PATCH 1/1] tty/serial: to support 8250 earlycon can be enabled independently Zhen Lei
2016-05-16 15:40 ` Peter Hurley
2016-05-17  6:11   ` Leizhen (ThunderTown)
2016-05-17 10:11     ` Alan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).