Linux-Serial Archive on
 help / color / Atom feed
From: Michael Walle <>
Cc: Greg Kroah-Hartman <>,
	Jiri Slaby <>,
	Angelo Dureghello <>,
	Johan Hovold <>,
	Philippe Schenker <>,
	Michael Walle <>
Subject: [PATCH v2 9/9] serial: fsl_lpuart: disable DMA for console and fix sysrq
Date: Wed, 12 May 2021 16:12:55 +0200
Message-ID: <> (raw)
In-Reply-To: <>

SYSRQ doesn't work with DMA. This is because there is no error
indication whether a symbol had a framing error or not. Actually,
this is not completely correct, there is a bit in the data register
which is set in this case, but we'd have to read change the DMA access
to 16 bit and we'd need to post process the data, thus make the DMA
pointless in the first place.

Signed-off-by: Michael Walle <>
Please note, that there is already sysrq/break support in the 8 bit
version. But I think there is a race between the hardware DMA controller
and the ISR in this driver. I'm not sure though and can't test it.

Angelo, maybe you could test it, I'd presume with this patch you don't need
the special handling in the ISR anymore.

 drivers/tty/serial/fsl_lpuart.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 1ed019d91177..0185bb8b6000 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -1587,6 +1587,9 @@ static void lpuart_tx_dma_startup(struct lpuart_port *sport)
 	u32 uartbaud;
 	int ret;
+	if (uart_console(&sport->port))
+		goto err;
 	if (!sport->dma_tx_chan)
 		goto err;
@@ -1616,6 +1619,9 @@ static void lpuart_rx_dma_startup(struct lpuart_port *sport)
 	int ret;
 	unsigned char cr3;
+	if (uart_console(&sport->port))
+		goto err;
 	if (!sport->dma_rx_chan)
 		goto err;

      parent reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 14:12 [PATCH v2 0/9] serial: fsl_lpuart: sysrq, loopback support and fixes Michael Walle
2021-05-12 14:12 ` [PATCH v2 1/9] serial: fsl_lpuart: don't modify arbitrary data on lpuart32 Michael Walle
2021-05-12 14:12 ` [PATCH v2 2/9] serial: fsl_lpuart: use UARTDATA_MASK macro Michael Walle
2021-05-12 14:12 ` [PATCH v2 3/9] serial: fsl_lpuart: don't restore interrupt state in ISR Michael Walle
2021-05-12 14:12 ` [PATCH v2 4/9] serial: fsl_lpuart: split sysrq handling Michael Walle
2021-05-12 14:12 ` [PATCH v2 5/9] serial: fsl_lpuart: handle break and make sysrq work Michael Walle
2021-05-12 14:12 ` [PATCH v2 6/9] serial: fsl_lpuart: remove RTSCTS handling from get_mctrl() Michael Walle
2021-05-12 14:12 ` [PATCH v2 7/9] serial: fsl_lpuart: remove manual RTSCTS control from 8-bit LPUART Michael Walle
2021-05-12 14:12 ` [PATCH v2 8/9] serial: fsl_lpuart: add loopback support Michael Walle
2021-05-12 14:12 ` Michael Walle [this message]

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:

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

  git send-email \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Serial Archive on

Archives are clonable:
	git clone --mirror linux-serial/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-serial linux-serial/ \
	public-inbox-index linux-serial

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone