From: Greg KH <gregkh@linuxfoundation.org>
To: Kartik <kkartik@nvidia.com>
Cc: ldewangan@nvidia.com, jirislaby@kernel.org,
thierry.reding@gmail.com, jonathanh@nvidia.com,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
linux-tegra@vger.kernel.org
Subject: Re: [PATCH] serial: tegra: Correct error handling sequence
Date: Fri, 15 Apr 2022 08:41:27 +0200 [thread overview]
Message-ID: <YlkTl/hyNDr9Nlwj@kroah.com> (raw)
In-Reply-To: <1648112644-16950-1-git-send-email-kkartik@nvidia.com>
On Thu, Mar 24, 2022 at 02:34:04PM +0530, Kartik wrote:
> From: kartik <kkartik@nvidia.com>
>
> In the current error handling sequence the driver checks for break
> error at the end.
>
> By handling the break error first, we can avoid a situation where the
> driver keeps processing the errors which can be caused by an unhandled
> break error.
>
> Signed-off-by: kartik <kkartik@nvidia.com>
I need a full, legal name that you use to sign documents with. Is that
this name?
> ---
> drivers/tty/serial/serial-tegra.c | 26 +++++++++++++-------------
> 1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c
> index b6223fa..ba78a02 100644
> --- a/drivers/tty/serial/serial-tegra.c
> +++ b/drivers/tty/serial/serial-tegra.c
> @@ -440,7 +440,19 @@ static char tegra_uart_decode_rx_error(struct tegra_uart_port *tup,
> char flag = TTY_NORMAL;
>
> if (unlikely(lsr & TEGRA_UART_LSR_ANY)) {
> - if (lsr & UART_LSR_OE) {
> + if (lsr & UART_LSR_BI) {
> + /*
> + * Break error
> + * If FIFO read error without any data, reset Rx FIFO
> + */
> + if (!(lsr & UART_LSR_DR) && (lsr & UART_LSR_FIFOE))
> + tegra_uart_fifo_reset(tup, UART_FCR_CLEAR_RCVR);
> + if (tup->uport.ignore_status_mask & UART_LSR_BI)
> + return TTY_BREAK;
> + flag = TTY_BREAK;
> + tup->uport.icount.brk++;
> + dev_dbg(tup->uport.dev, "Got Break\n");
> + } else if (lsr & UART_LSR_OE) {
> /* Overrrun error */
> flag = TTY_OVERRUN;
> tup->uport.icount.overrun++;
> @@ -454,18 +466,6 @@ static char tegra_uart_decode_rx_error(struct tegra_uart_port *tup,
> flag = TTY_FRAME;
> tup->uport.icount.frame++;
> dev_dbg(tup->uport.dev, "Got frame errors\n");
> - } else if (lsr & UART_LSR_BI) {
> - /*
> - * Break error
> - * If FIFO read error without any data, reset Rx FIFO
> - */
> - if (!(lsr & UART_LSR_DR) && (lsr & UART_LSR_FIFOE))
> - tegra_uart_fifo_reset(tup, UART_FCR_CLEAR_RCVR);
> - if (tup->uport.ignore_status_mask & UART_LSR_BI)
> - return TTY_BREAK;
> - flag = TTY_BREAK;
> - tup->uport.icount.brk++;
> - dev_dbg(tup->uport.dev, "Got Break\n");
> }
> uart_insert_char(&tup->uport, lsr, UART_LSR_OE, 0, flag);
> }
What commit does this fix?
thanks,
greg k-h
prev parent reply other threads:[~2022-04-15 6:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-24 9:04 [PATCH] serial: tegra: Correct error handling sequence Kartik
2022-04-15 6:41 ` Greg KH [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:
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=YlkTl/hyNDr9Nlwj@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=jonathanh@nvidia.com \
--cc=kkartik@nvidia.com \
--cc=ldewangan@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=thierry.reding@gmail.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;
as well as URLs for NNTP newsgroup(s).