From: Robin Gong <yibin.gong@nxp.com>
To: jslaby@suse.com, fugang.duan@nxp.com, linux-serial@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linux-imx@nxp.com
Subject: [PATCH v1] tty: serial: imx: enable IDDMAEN for the last tail data
Date: Thu, 20 Sep 2018 23:26:00 +0800 [thread overview]
Message-ID: <1537457160-10792-1-git-send-email-yibin.gong@nxp.com> (raw)
enable IDDMAEN in UCR4 to let sdma script has the chance to detect
the idle status and transfer the last tail data with the interrupt
notifying uart driver.Otherwise, the last dma done interrupt of the
tail data in rxfifo whose size is less than watermark may never be
received by uart driver.
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
---
drivers/tty/serial/imx.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 239c0fa..bbb1693 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1278,7 +1278,7 @@ static int imx_uart_dma_init(struct imx_port *sport)
static void imx_uart_enable_dma(struct imx_port *sport)
{
- u32 ucr1;
+ u32 ucr1, ucr4;
imx_uart_setup_ufcr(sport, TXTL_DMA, RXTL_DMA);
@@ -1287,18 +1287,26 @@ static void imx_uart_enable_dma(struct imx_port *sport)
ucr1 |= UCR1_RXDMAEN | UCR1_TXDMAEN | UCR1_ATDMAEN;
imx_uart_writel(sport, ucr1, UCR1);
+ ucr4 = imx_uart_readl(sport, UCR4);
+ ucr4 |= UCR4_IDDMAEN;
+ imx_uart_writel(sport, ucr4, UCR4);
+
sport->dma_is_enabled = 1;
}
static void imx_uart_disable_dma(struct imx_port *sport)
{
- u32 ucr1;
+ u32 ucr1, ucr4;
/* clear UCR1 */
ucr1 = imx_uart_readl(sport, UCR1);
ucr1 &= ~(UCR1_RXDMAEN | UCR1_TXDMAEN | UCR1_ATDMAEN);
imx_uart_writel(sport, ucr1, UCR1);
+ ucr4 = imx_uart_readl(sport, UCR4);
+ ucr4 &= ~UCR4_IDDMAEN;
+ imx_uart_writel(sport, ucr4, UCR4);
+
imx_uart_setup_ufcr(sport, TXTL_DEFAULT, RXTL_DEFAULT);
sport->dma_is_enabled = 0;
--
2.7.4
next reply other threads:[~2018-09-20 7:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-20 15:26 Robin Gong [this message]
2018-09-20 7:55 ` Uwe Kleine-König
2018-09-20 8:39 ` Robin Gong
2018-09-20 9:39 ` Lucas Stach
2018-09-20 10:33 ` Andy Duan
2018-09-20 10:42 ` Lucas Stach
2018-09-20 10:54 ` Andy Duan
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=1537457160-10792-1-git-send-email-yibin.gong@nxp.com \
--to=yibin.gong@nxp.com \
--cc=fugang.duan@nxp.com \
--cc=jslaby@suse.com \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®