All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@mips.com>
To: Jonas Gorski <jonas.gorski@gmail.com>
Cc: <linux-mips@linux-mips.org>, <linux-serial@vger.kernel.org>,
	Ralf Baechle <ralf@linux-mips.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Nicolas Schichan <nschichan@freebox.fr>
Subject: Re: [PATCH RFC 3/3] MIPS: AR7: ensure the port type's FCR value is used
Date: Tue, 14 Nov 2017 11:02:11 +0000	[thread overview]
Message-ID: <20171114110211.GA5823@jhogan-linux.mipstec.com> (raw)
In-Reply-To: <20171029152721.6770-4-jonas.gorski@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2135 bytes --]

On Sun, Oct 29, 2017 at 04:27:21PM +0100, Jonas Gorski wrote:
> Since commit aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt
> trigger I/F of FIFO buffers"), the port's default FCR value isn't used
> in serial8250_do_set_termios anymore, but copied over once in
> serial8250_config_port and then modified as needed.
> 
> Unfortunately, serial8250_config_port will never be called if the port
> is shared between kernel and userspace, and the port's flag doesn't have
> UPF_BOOT_AUTOCONF, which would trigger a serial8250_config_port as well.
> 
> This causes garbled output from userspace:
> 
> [    5.220000] random: procd urandom read with 49 bits of entropy available
> ers
>    [kee
> 
> Fix this by forcing it to be configured on boot, resulting in the
> expected output:
> 
> [    5.250000] random: procd urandom read with 50 bits of entropy available
> Press the [f] key and hit [enter] to enter failsafe mode
> Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
> 
> Fixes: aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt trigger I/F of FIFO buffers")
> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
> ---
> I'm not sure if this is just AR7's issue, or if this points to a general
> issue for UARTs used as kernel console and login console with the "fixed"
> commit.

Thanks. Given nobody seems to have objected, I've applied to my
mips-fixes branch, with stable tag for 3.17+.

Cheers
James

> 
>  arch/mips/ar7/platform.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c
> index 4674f1efbe7a..e1675c25d5d4 100644
> --- a/arch/mips/ar7/platform.c
> +++ b/arch/mips/ar7/platform.c
> @@ -575,7 +575,7 @@ static int __init ar7_register_uarts(void)
>  	uart_port.type		= PORT_AR7;
>  	uart_port.uartclk	= clk_get_rate(bus_clk) / 2;
>  	uart_port.iotype	= UPIO_MEM32;
> -	uart_port.flags		= UPF_FIXED_TYPE;
> +	uart_port.flags		= UPF_FIXED_TYPE | UPF_BOOT_AUTOCONF;
>  	uart_port.regshift	= 2;
>  
>  	uart_port.line		= 0;
> -- 
> 2.13.2
> 
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: James Hogan <james.hogan@mips.com>
To: Jonas Gorski <jonas.gorski@gmail.com>
Cc: linux-mips@linux-mips.org, linux-serial@vger.kernel.org,
	Ralf Baechle <ralf@linux-mips.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Nicolas Schichan <nschichan@freebox.fr>
Subject: Re: [PATCH RFC 3/3] MIPS: AR7: ensure the port type's FCR value is used
Date: Tue, 14 Nov 2017 11:02:11 +0000	[thread overview]
Message-ID: <20171114110211.GA5823@jhogan-linux.mipstec.com> (raw)
Message-ID: <20171114110211.HgIYxp-YfsVxGPvGTx8HP3UCxWsVPMdzSZByStrSq_M@z> (raw)
In-Reply-To: <20171029152721.6770-4-jonas.gorski@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2135 bytes --]

On Sun, Oct 29, 2017 at 04:27:21PM +0100, Jonas Gorski wrote:
> Since commit aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt
> trigger I/F of FIFO buffers"), the port's default FCR value isn't used
> in serial8250_do_set_termios anymore, but copied over once in
> serial8250_config_port and then modified as needed.
> 
> Unfortunately, serial8250_config_port will never be called if the port
> is shared between kernel and userspace, and the port's flag doesn't have
> UPF_BOOT_AUTOCONF, which would trigger a serial8250_config_port as well.
> 
> This causes garbled output from userspace:
> 
> [    5.220000] random: procd urandom read with 49 bits of entropy available
> ers
>    [kee
> 
> Fix this by forcing it to be configured on boot, resulting in the
> expected output:
> 
> [    5.250000] random: procd urandom read with 50 bits of entropy available
> Press the [f] key and hit [enter] to enter failsafe mode
> Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
> 
> Fixes: aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt trigger I/F of FIFO buffers")
> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
> ---
> I'm not sure if this is just AR7's issue, or if this points to a general
> issue for UARTs used as kernel console and login console with the "fixed"
> commit.

Thanks. Given nobody seems to have objected, I've applied to my
mips-fixes branch, with stable tag for 3.17+.

Cheers
James

> 
>  arch/mips/ar7/platform.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c
> index 4674f1efbe7a..e1675c25d5d4 100644
> --- a/arch/mips/ar7/platform.c
> +++ b/arch/mips/ar7/platform.c
> @@ -575,7 +575,7 @@ static int __init ar7_register_uarts(void)
>  	uart_port.type		= PORT_AR7;
>  	uart_port.uartclk	= clk_get_rate(bus_clk) / 2;
>  	uart_port.iotype	= UPIO_MEM32;
> -	uart_port.flags		= UPF_FIXED_TYPE;
> +	uart_port.flags		= UPF_FIXED_TYPE | UPF_BOOT_AUTOCONF;
>  	uart_port.regshift	= 2;
>  
>  	uart_port.line		= 0;
> -- 
> 2.13.2
> 
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-11-14 11:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-29 15:27 [PATCH 0/3] MIPS: AR7: assorted fixes Jonas Gorski
2017-10-29 15:27 ` [PATCH 1/3] MIPS: AR7: defer registration of GPIO Jonas Gorski
2017-10-29 17:33   ` Florian Fainelli
2017-10-29 15:27 ` [PATCH 2/3] MIPS: AR7: ensure that serial ports are properly set up Jonas Gorski
2017-10-29 17:33   ` Florian Fainelli
2017-10-29 15:27 ` [PATCH RFC 3/3] MIPS: AR7: ensure the port type's FCR value is used Jonas Gorski
2017-11-14 11:02   ` James Hogan [this message]
2017-11-14 11:02     ` James Hogan
2017-12-28 15:38     ` Jonas Gorski
2018-01-02  8:40       ` James Hogan
2018-01-02  8:40         ` James Hogan
2018-01-22 13:07   ` James Hogan
2018-01-22 13:34     ` Greg Kroah-Hartman
2017-11-08 22:03 ` [PATCH 0/3] MIPS: AR7: assorted fixes James Hogan
2017-11-08 22:03   ` James Hogan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171114110211.GA5823@jhogan-linux.mipstec.com \
    --to=james.hogan@mips.com \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jonas.gorski@gmail.com \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=nschichan@freebox.fr \
    --cc=ralf@linux-mips.org \
    --cc=yoshihiro.yunomae.ez@hitachi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.