All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] MIPS: AR7: assorted fixes
@ 2017-10-29 15:27 Jonas Gorski
  2017-10-29 15:27 ` [PATCH 1/3] MIPS: AR7: defer registration of GPIO Jonas Gorski
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Jonas Gorski @ 2017-10-29 15:27 UTC (permalink / raw)
  To: linux-mips, linux-serial
  Cc: Ralf Baechle, Greg Kroah-Hartman, Yoshihiro YUNOMAE,
	Florian Fainelli, Nicolas Schichan

This patchset fixes a few issues found in AR7 that accumulated in the
past few years. One was fixed for ages in OpenWrt/LEDE and never made
it upstream, the others weren't noticed until now.

Jonas Gorski (2):
  MIPS: AR7: defer registration of GPIO
  MIPS: AR7: ensure the port type's FCR value is used

Oswald Buddenhagen (1):
  MIPS: AR7: ensure that serial ports are properly set up

 arch/mips/ar7/platform.c | 5 +++++
 arch/mips/ar7/prom.c     | 2 --
 2 files changed, 5 insertions(+), 2 deletions(-)

-- 
2.13.2

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

* [PATCH 1/3] MIPS: AR7: defer registration of GPIO
  2017-10-29 15:27 [PATCH 0/3] MIPS: AR7: assorted fixes Jonas Gorski
@ 2017-10-29 15:27 ` 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
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 15+ messages in thread
From: Jonas Gorski @ 2017-10-29 15:27 UTC (permalink / raw)
  To: linux-mips, linux-serial
  Cc: Ralf Baechle, Greg Kroah-Hartman, Yoshihiro YUNOMAE,
	Florian Fainelli, Nicolas Schichan

When called from prom init code, ar7_gpio_init() will fail as it will
call gpiochip_add() which relies on a working kmalloc() to alloc
the gpio_desc array and kmalloc is not useable yet at prom init time.

Move ar7_gpio_init() to ar7_register_devices() (a device_initcall)
where kmalloc works.

Fixes: 14e85c0e69d5 ("gpio: remove gpio_descs global array")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
Text shamelessy stolen from commit 2ec459f2a77b8.

 arch/mips/ar7/platform.c | 4 ++++
 arch/mips/ar7/prom.c     | 2 --
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c
index df7acea3747a..f2c9f90c5f13 100644
--- a/arch/mips/ar7/platform.c
+++ b/arch/mips/ar7/platform.c
@@ -653,6 +653,10 @@ static int __init ar7_register_devices(void)
 	u32 val;
 	int res;
 
+	res = ar7_gpio_init();
+	if (res)
+		pr_warn("unable to register gpios: %d\n", res);
+
 	res = ar7_register_uarts();
 	if (res)
 		pr_err("unable to setup uart(s): %d\n", res);
diff --git a/arch/mips/ar7/prom.c b/arch/mips/ar7/prom.c
index 4fd83336131a..dd53987a690f 100644
--- a/arch/mips/ar7/prom.c
+++ b/arch/mips/ar7/prom.c
@@ -246,8 +246,6 @@ void __init prom_init(void)
 	ar7_init_cmdline(fw_arg0, (char **)fw_arg1);
 	ar7_init_env((struct env_var *)fw_arg2);
 	console_config();
-
-	ar7_gpio_init();
 }
 
 #define PORT(offset) (KSEG1ADDR(AR7_REGS_UART0 + (offset * 4)))
-- 
2.13.2

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

* [PATCH 2/3] MIPS: AR7: ensure that serial ports are properly set up
  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 15:27 ` 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-08 22:03   ` James Hogan
  3 siblings, 1 reply; 15+ messages in thread
From: Jonas Gorski @ 2017-10-29 15:27 UTC (permalink / raw)
  To: linux-mips, linux-serial
  Cc: Ralf Baechle, Greg Kroah-Hartman, Yoshihiro YUNOMAE,
	Florian Fainelli, Nicolas Schichan, Oswald Buddenhagen

From: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>

without UPF_FIXED_TYPE, the data from the PORT_AR7 uart_config entry is
never copied, resulting in a dead port.

Fixes: 154615d55459 ("MIPS: AR7: Use correct UART port type")
Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
[jonas.gorski: add Fixes tag]
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 arch/mips/ar7/platform.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c
index f2c9f90c5f13..4674f1efbe7a 100644
--- a/arch/mips/ar7/platform.c
+++ b/arch/mips/ar7/platform.c
@@ -575,6 +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.regshift	= 2;
 
 	uart_port.line		= 0;
-- 
2.13.2

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

* [PATCH RFC 3/3] MIPS: AR7: ensure the port type's FCR value is used
  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 15:27 ` [PATCH 2/3] MIPS: AR7: ensure that serial ports are properly set up Jonas Gorski
@ 2017-10-29 15:27 ` Jonas Gorski
  2017-11-14 11:02     ` James Hogan
  2018-01-22 13:07   ` James Hogan
  2017-11-08 22:03   ` James Hogan
  3 siblings, 2 replies; 15+ messages in thread
From: Jonas Gorski @ 2017-10-29 15:27 UTC (permalink / raw)
  To: linux-mips, linux-serial
  Cc: Ralf Baechle, Greg Kroah-Hartman, Yoshihiro YUNOMAE,
	Florian Fainelli, Nicolas Schichan

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.

 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

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

* Re: [PATCH 1/3] MIPS: AR7: defer registration of GPIO
  2017-10-29 15:27 ` [PATCH 1/3] MIPS: AR7: defer registration of GPIO Jonas Gorski
@ 2017-10-29 17:33   ` Florian Fainelli
  0 siblings, 0 replies; 15+ messages in thread
From: Florian Fainelli @ 2017-10-29 17:33 UTC (permalink / raw)
  To: Jonas Gorski, linux-mips, linux-serial
  Cc: Ralf Baechle, Greg Kroah-Hartman, Yoshihiro YUNOMAE, Nicolas Schichan



On 10/29/2017 08:27 AM, Jonas Gorski wrote:
> When called from prom init code, ar7_gpio_init() will fail as it will
> call gpiochip_add() which relies on a working kmalloc() to alloc
> the gpio_desc array and kmalloc is not useable yet at prom init time.
> 
> Move ar7_gpio_init() to ar7_register_devices() (a device_initcall)
> where kmalloc works.
> 
> Fixes: 14e85c0e69d5 ("gpio: remove gpio_descs global array")
> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

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

* Re: [PATCH 2/3] MIPS: AR7: ensure that serial ports are properly set up
  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
  0 siblings, 0 replies; 15+ messages in thread
From: Florian Fainelli @ 2017-10-29 17:33 UTC (permalink / raw)
  To: Jonas Gorski, linux-mips, linux-serial
  Cc: Ralf Baechle, Greg Kroah-Hartman, Yoshihiro YUNOMAE,
	Nicolas Schichan, Oswald Buddenhagen



On 10/29/2017 08:27 AM, Jonas Gorski wrote:
> From: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
> 
> without UPF_FIXED_TYPE, the data from the PORT_AR7 uart_config entry is
> never copied, resulting in a dead port.
> 
> Fixes: 154615d55459 ("MIPS: AR7: Use correct UART port type")
> Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
> [jonas.gorski: add Fixes tag]
> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

-- 
Florian

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

* Re: [PATCH 0/3] MIPS: AR7: assorted fixes
@ 2017-11-08 22:03   ` James Hogan
  0 siblings, 0 replies; 15+ messages in thread
From: James Hogan @ 2017-11-08 22:03 UTC (permalink / raw)
  To: Jonas Gorski
  Cc: linux-mips, linux-serial, Ralf Baechle, Greg Kroah-Hartman,
	Yoshihiro YUNOMAE, Florian Fainelli, Nicolas Schichan

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

On Sun, Oct 29, 2017 at 04:27:18PM +0100, Jonas Gorski wrote:
> This patchset fixes a few issues found in AR7 that accumulated in the
> past few years. One was fixed for ages in OpenWrt/LEDE and never made
> it upstream, the others weren't noticed until now.
> 
> Jonas Gorski (2):
>   MIPS: AR7: defer registration of GPIO
>   MIPS: AR7: ensure the port type's FCR value is used
> 
> Oswald Buddenhagen (1):
>   MIPS: AR7: ensure that serial ports are properly set up

Thanks. Patches 1 + 2 applied for 4.14.

Cheers
James

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

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

* Re: [PATCH 0/3] MIPS: AR7: assorted fixes
@ 2017-11-08 22:03   ` James Hogan
  0 siblings, 0 replies; 15+ messages in thread
From: James Hogan @ 2017-11-08 22:03 UTC (permalink / raw)
  To: Jonas Gorski
  Cc: linux-mips, linux-serial, Ralf Baechle, Greg Kroah-Hartman,
	Yoshihiro YUNOMAE, Florian Fainelli, Nicolas Schichan

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

On Sun, Oct 29, 2017 at 04:27:18PM +0100, Jonas Gorski wrote:
> This patchset fixes a few issues found in AR7 that accumulated in the
> past few years. One was fixed for ages in OpenWrt/LEDE and never made
> it upstream, the others weren't noticed until now.
> 
> Jonas Gorski (2):
>   MIPS: AR7: defer registration of GPIO
>   MIPS: AR7: ensure the port type's FCR value is used
> 
> Oswald Buddenhagen (1):
>   MIPS: AR7: ensure that serial ports are properly set up

Thanks. Patches 1 + 2 applied for 4.14.

Cheers
James

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

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

* Re: [PATCH RFC 3/3] MIPS: AR7: ensure the port type's FCR value is used
@ 2017-11-14 11:02     ` James Hogan
  0 siblings, 0 replies; 15+ messages in thread
From: James Hogan @ 2017-11-14 11:02 UTC (permalink / raw)
  To: Jonas Gorski
  Cc: linux-mips, linux-serial, Ralf Baechle, Greg Kroah-Hartman,
	Yoshihiro YUNOMAE, Florian Fainelli, Nicolas Schichan

[-- 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 --]

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

* Re: [PATCH RFC 3/3] MIPS: AR7: ensure the port type's FCR value is used
@ 2017-11-14 11:02     ` James Hogan
  0 siblings, 0 replies; 15+ messages in thread
From: James Hogan @ 2017-11-14 11:02 UTC (permalink / raw)
  To: Jonas Gorski
  Cc: linux-mips, linux-serial, Ralf Baechle, Greg Kroah-Hartman,
	Yoshihiro YUNOMAE, Florian Fainelli, Nicolas Schichan

[-- 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 --]

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

* Re: [PATCH RFC 3/3] MIPS: AR7: ensure the port type's FCR value is used
  2017-11-14 11:02     ` James Hogan
  (?)
@ 2017-12-28 15:38     ` Jonas Gorski
  2018-01-02  8:40         ` James Hogan
  -1 siblings, 1 reply; 15+ messages in thread
From: Jonas Gorski @ 2017-12-28 15:38 UTC (permalink / raw)
  To: James Hogan
  Cc: MIPS Mailing List, linux-serial, Ralf Baechle,
	Greg Kroah-Hartman, Yoshihiro YUNOMAE, Florian Fainelli,
	Nicolas Schichan

On 14 November 2017 at 12:02, James Hogan <james.hogan@mips.com> wrote:
> 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+.

Hmm, I don't see it in
https://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips.git/log/?h=mips-fixes
- did you maybe forget to push?


Regards
Jonas

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

* Re: [PATCH RFC 3/3] MIPS: AR7: ensure the port type's FCR value is used
@ 2018-01-02  8:40         ` James Hogan
  0 siblings, 0 replies; 15+ messages in thread
From: James Hogan @ 2018-01-02  8:40 UTC (permalink / raw)
  To: Jonas Gorski, Ralf Baechle
  Cc: MIPS Mailing List, linux-serial, Greg Kroah-Hartman,
	Yoshihiro YUNOMAE, Florian Fainelli, Nicolas Schichan

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

On Thu, Dec 28, 2017 at 04:38:29PM +0100, Jonas Gorski wrote:
> On 14 November 2017 at 12:02, James Hogan <james.hogan@mips.com> wrote:
> > 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+.
> 
> Hmm, I don't see it in
> https://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips.git/log/?h=mips-fixes
> - did you maybe forget to push?

Ralf reappeared so I delegated the patch to him in patchwork, and he has
apparently marked it as accepted.

But perhaps that only just happened and he hasn't pushed yet. Ralf?

Cheers
James

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

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

* Re: [PATCH RFC 3/3] MIPS: AR7: ensure the port type's FCR value is used
@ 2018-01-02  8:40         ` James Hogan
  0 siblings, 0 replies; 15+ messages in thread
From: James Hogan @ 2018-01-02  8:40 UTC (permalink / raw)
  To: Jonas Gorski, Ralf Baechle
  Cc: MIPS Mailing List, linux-serial, Greg Kroah-Hartman,
	Yoshihiro YUNOMAE, Florian Fainelli, Nicolas Schichan

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

On Thu, Dec 28, 2017 at 04:38:29PM +0100, Jonas Gorski wrote:
> On 14 November 2017 at 12:02, James Hogan <james.hogan@mips.com> wrote:
> > 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+.
> 
> Hmm, I don't see it in
> https://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips.git/log/?h=mips-fixes
> - did you maybe forget to push?

Ralf reappeared so I delegated the patch to him in patchwork, and he has
apparently marked it as accepted.

But perhaps that only just happened and he hasn't pushed yet. Ralf?

Cheers
James

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

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

* Re: [PATCH RFC 3/3] MIPS: AR7: ensure the port type's FCR value is used
  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
@ 2018-01-22 13:07   ` James Hogan
  2018-01-22 13:34     ` Greg Kroah-Hartman
  1 sibling, 1 reply; 15+ messages in thread
From: James Hogan @ 2018-01-22 13:07 UTC (permalink / raw)
  To: stable
  Cc: Jonas Gorski, linux-mips, linux-serial, Ralf Baechle,
	Greg Kroah-Hartman, Yoshihiro YUNOMAE, Florian Fainelli,
	Nicolas Schichan

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

Hi stable maintainers,

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>

Please can this patch be applied to stable branches 3.17+. It is now
merged into mainline as commit 0a5191efe06b ("MIPS: AR7: ensure the port
type's FCR value is used").

Commit b084116f8587 ("MIPS: AR7: Ensure that serial ports are properly
set up") is a prerequisite for it to apply cleanly, but is already
tagged for stable.

Thanks
James

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

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

* Re: [PATCH RFC 3/3] MIPS: AR7: ensure the port type's FCR value is used
  2018-01-22 13:07   ` James Hogan
@ 2018-01-22 13:34     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 15+ messages in thread
From: Greg Kroah-Hartman @ 2018-01-22 13:34 UTC (permalink / raw)
  To: James Hogan
  Cc: stable, Jonas Gorski, linux-mips, linux-serial, Ralf Baechle,
	Yoshihiro YUNOMAE, Florian Fainelli, Nicolas Schichan

On Mon, Jan 22, 2018 at 01:07:19PM +0000, James Hogan wrote:
> Hi stable maintainers,
> 
> 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>
> 
> Please can this patch be applied to stable branches 3.17+. It is now
> merged into mainline as commit 0a5191efe06b ("MIPS: AR7: ensure the port
> type's FCR value is used").
> 
> Commit b084116f8587 ("MIPS: AR7: Ensure that serial ports are properly
> set up") is a prerequisite for it to apply cleanly, but is already
> tagged for stable.

Now snuck into this round of stable -rc review :)

thanks,

greg k-h

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

end of thread, other threads:[~2018-01-22 13:34 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.