linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tty: serial: 8250: add CON_CONSDEV to flags
@ 2016-06-21 15:19 Matthew Leach
  2016-10-18 16:15 ` Jiri Slaby
  0 siblings, 1 reply; 4+ messages in thread
From: Matthew Leach @ 2016-06-21 15:19 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby
  Cc: linux-serial, linux-kernel, linux-kernel, Matthew Leach

When using the 8250 as a boot console and the main console results in
messages being printed twice.  The console framework will only
unregister boot consoles if a new console is registered with the
CON_CONSDEV flag set.

Set this flag for the univ8250 console to prevent double-registration.

Signed-off-by: Matthew Leach <matthew.leach@codethink.co.uk>
---
 drivers/tty/serial/8250/8250_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index 2f4f5ee..7a7453d 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -675,7 +675,7 @@ static struct console univ8250_console = {
 	.device		= uart_console_device,
 	.setup		= univ8250_console_setup,
 	.match		= univ8250_console_match,
-	.flags		= CON_PRINTBUFFER | CON_ANYTIME,
+	.flags		= CON_PRINTBUFFER | CON_ANYTIME | CON_CONSDEV,
 	.index		= -1,
 	.data		= &serial8250_reg,
 };
-- 
2.8.2

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

* Re: [PATCH] tty: serial: 8250: add CON_CONSDEV to flags
  2016-06-21 15:19 [PATCH] tty: serial: 8250: add CON_CONSDEV to flags Matthew Leach
@ 2016-10-18 16:15 ` Jiri Slaby
  2016-10-18 16:23   ` [Linux-kernel] " Ben Dooks
  0 siblings, 1 reply; 4+ messages in thread
From: Jiri Slaby @ 2016-10-18 16:15 UTC (permalink / raw)
  To: Matthew Leach, Greg Kroah-Hartman, Jiri Slaby
  Cc: linux-serial, linux-kernel, linux-kernel

On 06/21/2016, 05:19 PM, Matthew Leach wrote:
> When using the 8250 as a boot console and the main console results in
> messages being printed twice.  The console framework will only
> unregister boot consoles if a new console is registered with the
> CON_CONSDEV flag set.
> 
> Set this flag for the univ8250 console to prevent double-registration.
> 
> Signed-off-by: Matthew Leach <matthew.leach@codethink.co.uk>
> ---
>  drivers/tty/serial/8250/8250_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
> index 2f4f5ee..7a7453d 100644
> --- a/drivers/tty/serial/8250/8250_core.c
> +++ b/drivers/tty/serial/8250/8250_core.c
> @@ -675,7 +675,7 @@ static struct console univ8250_console = {
>  	.device		= uart_console_device,
>  	.setup		= univ8250_console_setup,
>  	.match		= univ8250_console_match,
> -	.flags		= CON_PRINTBUFFER | CON_ANYTIME,
> +	.flags		= CON_PRINTBUFFER | CON_ANYTIME | CON_CONSDEV,

This patch breaks console= parameter handling. Passing:
  console=ttyS0 console=tty0
no longer means /dev/console is tty0 and it should be as is documented.

I have not investigated further yet.

thanks,
-- 
js
suse labs

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

* Re: [Linux-kernel] [PATCH] tty: serial: 8250: add CON_CONSDEV to flags
  2016-10-18 16:15 ` Jiri Slaby
@ 2016-10-18 16:23   ` Ben Dooks
  2016-10-18 16:57     ` Jiri Slaby
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Dooks @ 2016-10-18 16:23 UTC (permalink / raw)
  To: Jiri Slaby, Matthew Leach, Greg Kroah-Hartman, Jiri Slaby
  Cc: linux-kernel, linux-kernel, linux-serial

On 18/10/16 17:15, Jiri Slaby wrote:
> On 06/21/2016, 05:19 PM, Matthew Leach wrote:
>> When using the 8250 as a boot console and the main console results in
>> messages being printed twice.  The console framework will only
>> unregister boot consoles if a new console is registered with the
>> CON_CONSDEV flag set.
>>
>> Set this flag for the univ8250 console to prevent double-registration.
>>
>> Signed-off-by: Matthew Leach <matthew.leach@codethink.co.uk>
>> ---
>>  drivers/tty/serial/8250/8250_core.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
>> index 2f4f5ee..7a7453d 100644
>> --- a/drivers/tty/serial/8250/8250_core.c
>> +++ b/drivers/tty/serial/8250/8250_core.c
>> @@ -675,7 +675,7 @@ static struct console univ8250_console = {
>>  	.device		= uart_console_device,
>>  	.setup		= univ8250_console_setup,
>>  	.match		= univ8250_console_match,
>> -	.flags		= CON_PRINTBUFFER | CON_ANYTIME,
>> +	.flags		= CON_PRINTBUFFER | CON_ANYTIME | CON_CONSDEV,
>
> This patch breaks console= parameter handling. Passing:
>   console=ttyS0 console=tty0
> no longer means /dev/console is tty0 and it should be as is documented.
>
> I have not investigated further yet.

Ok, thanks.
I'll need to find Matthew Leach's new address as he's moved jobs.

-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

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

* Re: [Linux-kernel] [PATCH] tty: serial: 8250: add CON_CONSDEV to flags
  2016-10-18 16:23   ` [Linux-kernel] " Ben Dooks
@ 2016-10-18 16:57     ` Jiri Slaby
  0 siblings, 0 replies; 4+ messages in thread
From: Jiri Slaby @ 2016-10-18 16:57 UTC (permalink / raw)
  To: Ben Dooks, Matthew Leach, Greg Kroah-Hartman
  Cc: linux-kernel, linux-kernel, linux-serial

On 10/18/2016, 06:23 PM, Ben Dooks wrote:
> On 18/10/16 17:15, Jiri Slaby wrote:
>> On 06/21/2016, 05:19 PM, Matthew Leach wrote:
>>> When using the 8250 as a boot console and the main console results in
>>> messages being printed twice.  The console framework will only
>>> unregister boot consoles if a new console is registered with the
>>> CON_CONSDEV flag set.
>>>
>>> Set this flag for the univ8250 console to prevent double-registration.
>>>
>>> Signed-off-by: Matthew Leach <matthew.leach@codethink.co.uk>
>>> ---
>>>  drivers/tty/serial/8250/8250_core.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/tty/serial/8250/8250_core.c
>>> b/drivers/tty/serial/8250/8250_core.c
>>> index 2f4f5ee..7a7453d 100644
>>> --- a/drivers/tty/serial/8250/8250_core.c
>>> +++ b/drivers/tty/serial/8250/8250_core.c
>>> @@ -675,7 +675,7 @@ static struct console univ8250_console = {
>>>      .device        = uart_console_device,
>>>      .setup        = univ8250_console_setup,
>>>      .match        = univ8250_console_match,
>>> -    .flags        = CON_PRINTBUFFER | CON_ANYTIME,
>>> +    .flags        = CON_PRINTBUFFER | CON_ANYTIME | CON_CONSDEV,
>>
>> This patch breaks console= parameter handling. Passing:
>>   console=ttyS0 console=tty0
>> no longer means /dev/console is tty0 and it should be as is documented.
>>
>> I have not investigated further yet.
> 
> Ok, thanks.
> I'll need to find Matthew Leach's new address as he's moved jobs.

Oh sure:
#define CON_CONSDEV     (2) /* Last on the command line */

Why it should be set in struct console statically? The patch is
obviously incorrect. And I do not understand from the vague commit log
what the problem actually was.

So for the time being, Greg, please revert it (d03516df8375873) and we
can come with something better, when we understand the issue. Please CC
stable (4.8+).

thanks,
-- 
js
suse labs

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

end of thread, other threads:[~2016-10-18 16:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-21 15:19 [PATCH] tty: serial: 8250: add CON_CONSDEV to flags Matthew Leach
2016-10-18 16:15 ` Jiri Slaby
2016-10-18 16:23   ` [Linux-kernel] " Ben Dooks
2016-10-18 16:57     ` Jiri Slaby

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).