From: Moteen Shah <m-shah@ti.com>
To: Matthias Feser <mfe@KBSgmbhfr.onmicrosoft.com>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"jirislaby@kernel.org" <jirislaby@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"k-willis@ti.com" <k-willis@ti.com>,
"msp@baylibre.com" <msp@baylibre.com>,
"andriy.shevchenko@linux.intel.com"
<andriy.shevchenko@linux.intel.com>
Subject: Re: AW: [PATCH v3] serial: 8250_omap: clear rx_running on zero-length DMA completes
Date: Fri, 22 May 2026 15:48:58 +0530 [thread overview]
Message-ID: <ede98ffc-9e34-46a5-8d8f-87894fbf9d12@ti.com> (raw)
In-Reply-To: <BE3P281MB5515A937D47F610974FAEFA7EE0F2@BE3P281MB5515.DEUP281.PROD.OUTLOOK.COM>
On 22/05/26 14:32, Matthias Feser wrote:
> On AM33xx RX DMA only triggers when the FIFO reaches the
> configured threshold (typically 48 bytes). For smaller bursts
> no DMA request is issued and the FIFO is drained by RX timeout.
>
> In this case __dma_rx_do_complete() can legitimately see count == 0.
>
> The current code exits early in this case and does not clear
> dma->rx_running, leaving the DMA state inconsistent. This can
> prevent RX DMA from restarting and may cause
> omap_8250_rx_dma_flush() to fail, marking DMA as broken.
>
> Fix this by clearing dma->rx_running once the DMA transfer has
> completed or been terminated, even if no data was transferred.
>
> Signed-off-by: Matthias Feser <mfe@KBSgmbhfr.onmicrosoft.com>
> ---
> Changes in v3:
> - Move "Changes in v2" below the tear line as suggested
>
> Changes in v2:
> - Move dma->rx_running clear before the count check so the state
> is updated immediately after DMA completion/termination
>
> drivers/tty/serial/8250/8250_omap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
> index c552c6b9a037..76bc8ad324cb 100644
> --- a/drivers/tty/serial/8250/8250_omap.c
> +++ b/drivers/tty/serial/8250/8250_omap.c
> @@ -944,11 +944,11 @@ static void __dma_rx_do_complete(struct uart_8250_port *p)
> dev_err(p->port.dev, "teardown incomplete\n");
> }
> }
> + dma->rx_running = 0;
Nit: Add a newline above dma->rx_running, I think checkpatch would have
caught it.
With the above change:
Reviewed-by: Moteen Shah <m-shah@ti.com>
Please pick the tag up in the next version if you intend to make one.
Thanks and Regards,
Moteen
> if (!count)
> goto out;
> ret = tty_insert_flip_string(tty_port, dma->rx_buf, count);
>
> - dma->rx_running = 0;
> p->port.icount.rx += ret;
> p->port.icount.buf_overrun += count - ret;
> out:
next prev parent reply other threads:[~2026-05-22 10:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 13:30 [PATCH] " Matthias Feser
2026-05-22 5:40 ` Moteen Shah
2026-05-22 8:24 ` [PATCH v2] " Matthias Feser
2026-05-22 8:25 ` Moteen Shah
2026-05-22 8:28 ` Moteen Shah
2026-05-22 9:02 ` AW: [PATCH v3] " Matthias Feser
2026-05-22 10:18 ` Moteen Shah [this message]
2026-05-22 12:37 ` [PATCH v4] " Matthias Feser
2026-05-23 5:47 ` gregkh
2026-05-26 7:35 ` [PATCH v5] " Matthias Feser
2026-06-02 18:37 ` andriy.shevchenko
2026-06-08 11:00 ` Matthias Feser
2026-06-08 11:35 ` andriy.shevchenko
2026-05-22 8:46 ` [PATCH v2] " gregkh
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=ede98ffc-9e34-46a5-8d8f-87894fbf9d12@ti.com \
--to=m-shah@ti.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=k-willis@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=mfe@KBSgmbhfr.onmicrosoft.com \
--cc=msp@baylibre.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 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®