Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH v3] serial: sh-sci: disable DMA for uart_console
@ 2019-05-15  3:29 George G. Davis
       [not found] ` <20190515105444.BB0722084F@mail.kernel.org>
  0 siblings, 1 reply; 2+ messages in thread
From: George G. Davis @ 2019-05-15  3:29 UTC (permalink / raw)
  To: Eugeniu Rosca, Geert Uytterhoeven, Simon Horman, Wolfram Sang,
	Greg Kroah-Hartman, Jiri Slaby, open list:SERIAL DRIVERS,
	open list
  Cc: Chris Brandt, Ulrich Hecht, Andy Lowe, Linux-Renesas,
	OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS, Magnus Damm,
	Rob Herring, Mark Rutland, George G. Davis, stable

As noted in commit 84b40e3b57ee ("serial: 8250: omap: Disable DMA for
console UART"), UART console lines use low-level PIO only access functions
which will conflict with use of the line when DMA is enabled, e.g. when
the console line is also used for systemd messages. So disable DMA
support for UART console lines.

Reported-by: Michael Rodin <mrodin@de.adit-jv.com>
Link: https://patchwork.kernel.org/patch/10929511/
Tested-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: stable@vger.kernel.org
Signed-off-by: George G. Davis <george_davis@mentor.com>
---
v2: Clarify comment regarding DMA support on kernel console,
    add {Tested,Reviewed}-by:, and Cc: linux-stable lines.
v3: Change Fixes: reference to Link: reference and add another Reviewed-by.
---
 drivers/tty/serial/sh-sci.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 3cd139752d3f..abc705716aa0 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1557,6 +1557,13 @@ static void sci_request_dma(struct uart_port *port)
 
 	dev_dbg(port->dev, "%s: port %d\n", __func__, port->line);
 
+	/*
+	 * DMA on console may interfere with Kernel log messages which use
+	 * plain putchar(). So, simply don't use it with a console.
+	 */
+	if (uart_console(port))
+		return;
+
 	if (!port->dev->of_node)
 		return;
 
-- 
2.7.4


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

* Re: [PATCH v3] serial: sh-sci: disable DMA for uart_console
       [not found] ` <20190515105444.BB0722084F@mail.kernel.org>
@ 2019-05-15 21:22   ` George G. Davis
  0 siblings, 0 replies; 2+ messages in thread
From: George G. Davis @ 2019-05-15 21:22 UTC (permalink / raw)
  To: Sasha Levin; +Cc: Eugeniu Rosca, Chris Brandt, stable

Hello Sasha,

On Wed, May 15, 2019 at 10:54:43AM +0000, Sasha Levin wrote:
> Hi,
> 
> [This is an automated email]
> 
> This commit has been processed because it contains a -stable tag.
> The stable tag indicates that it's relevant for the following trees: all
> 
> The bot has tested the following trees: v5.1.1, v5.0.15, v4.19.42, v4.14.118, v4.9.175, v4.4.179, v3.18.139.
> 
> v5.1.1: Build OK!
> v5.0.15: Build OK!
> v4.19.42: Build OK!
> v4.14.118: Build OK!

I've confirmed that the patch works on all of the above stable versions:

Tested-by: George G. Davis <george_davis@mentor.com> # on ARCH=arm64 boards r8a7795-es1-salvator-x and r8a7795-h3ulcb.


> v4.9.175: Failed to apply! Possible dependencies:
>     219fb0c1436e ("serial: sh-sci: Remove the platform data dma slave rx/tx channel IDs")

Although I've backported and build tested the patch on the above and below
stable versions, I'm unable to test on ARCH=arm64 boards due to lack of other
dependent commits for reliably booting the ARCH=arm64 boards that I have
available for testing.

I do have an ARCH=arm r8a7779-marzen board which hypothetically could be used
for testing on these earlier stable versions but it's rather mothballed at the
moment and will take some time to setup for testing.  I likely won't get to
that any time soon so since no one has reported this problem until recently,
I'd err on the side of limiting the stable update to v4.14+ for now.

If anyone has access to other targets which use the same driver and can test, please
feel free to backport and test the patch on ealier stable versions.

Thanks!

> 
> v4.4.179: Failed to apply! Possible dependencies:
>     219fb0c1436e ("serial: sh-sci: Remove the platform data dma slave rx/tx channel IDs")
> 
> v3.18.139: Failed to apply! Possible dependencies:
>     219fb0c1436e ("serial: sh-sci: Remove the platform data dma slave rx/tx channel IDs")
>     2922598cd913 ("serial: sh-sci: Replace hardcoded values in SCxSR_*_CLEAR macros")
>     2e0842a154f6 ("serial: sh-sci: Use the correct register for overrun checks")
>     31f90796c668 ("serial: sh-sci: Document remaining FIFO Control Register bits")
>     54af5001e1b8 ("serial: sh-sci: Use SCIF_DR instead of hardcoded literal 1")
>     75c249fd7cb9 ("serial: sh-sci: Replace hardcoded overrun bit values")
>     76735e9d558b ("serial: sh-sci: Add (H)SCIF RTS/CTS pin data register bit definitions")
>     8b6ff84c2d44 ("serial: sh-sci: Fix R-Car SCIF and HSCIF overrun handling")
>     8eadb56d6830 ("serial: sh-sci: Don't kick tx in sci_er_interrupt() when using DMA")
>     a1b5b43ffb84 ("serial: sh-sci: Replace buggy big #ifdef by runtime logic")
>     c097abc33f70 ("serial: sh-sci: Add SCIFA/B SCPCR register definitions")
>     c27ffc108017 ("serial: sh-sci: Move private definitions to private header file")
>     cb772fe75fa1 ("serial: sh-sci: Add overrun handling of SCIFA and SCIFB")
>     d94a0a385798 ("serial: sh-sci: Standardize on using the BIT() macro to define register bits")
>     e0a12a27e834 ("serial: sh-sci: Remove bogus sci_handle_fifo_overrun() call on (H)SCIF")
>     e1910fcdb545 ("serial: sh-sci: Shuffle functions around")
>     e6403c112f8c ("serial: sh-sci: Don't call sci_rx_interrupt() on error when using DMA")
>     ff4411296e99 ("serial: sh-sci: Add DT support to DMA setup")
> 
> 
> How should we proceed with this patch?
> 
> --
> Thanks,
> Sasha

-- 
Regards,
George

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

end of thread, other threads:[~2019-05-15 21:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-15  3:29 [PATCH v3] serial: sh-sci: disable DMA for uart_console George G. Davis
     [not found] ` <20190515105444.BB0722084F@mail.kernel.org>
2019-05-15 21:22   ` George G. Davis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox