public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	linux-serial@vger.kernel.org,
	Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: [PATCH 3/3] serial: tegra-tcu: Use uart_xmit_advance(), fixes icount.tx accounting
Date: Thu, 25 Aug 2022 12:17:07 +0300	[thread overview]
Message-ID: <20220825091707.8112-4-ilpo.jarvinen@linux.intel.com> (raw)
In-Reply-To: <20220825091707.8112-1-ilpo.jarvinen@linux.intel.com>

Tx'ing does not correctly account Tx'ed characters into icount.tx.
Using uart_xmit_advance() fixes the problem.

Fixes: 2d908b38d409 ("serial: Add Tegra Combined UART driver")
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/tty/serial/tegra-tcu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/tegra-tcu.c b/drivers/tty/serial/tegra-tcu.c
index 4877c54c613d..889b701ba7c6 100644
--- a/drivers/tty/serial/tegra-tcu.c
+++ b/drivers/tty/serial/tegra-tcu.c
@@ -101,7 +101,7 @@ static void tegra_tcu_uart_start_tx(struct uart_port *port)
 			break;
 
 		tegra_tcu_write(tcu, &xmit->buf[xmit->tail], count);
-		xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1);
+		uart_xmit_advance(port, count);
 	}
 
 	uart_write_wakeup(port);
-- 
2.30.2


  parent reply	other threads:[~2022-08-25  9:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25  9:17 [PATCH 0/3] serial: Add uart_xmit_advance() + fixes part (of a larger patch series) Ilpo Järvinen
2022-08-25  9:17 ` [PATCH 1/3] serial: Create uart_xmit_advance() Ilpo Järvinen
2022-08-30 12:27   ` Greg Kroah-Hartman
2022-08-30 12:38     ` Andy Shevchenko
2022-08-30 12:48       ` Greg Kroah-Hartman
2022-08-30 12:53         ` Andy Shevchenko
2022-08-25  9:17 ` [PATCH 2/3] serial: tegra: Use uart_xmit_advance(), fixes icount.tx accounting Ilpo Järvinen
2022-08-25  9:17 ` Ilpo Järvinen [this message]
2022-08-26 16:03 ` [PATCH 0/3] serial: Add uart_xmit_advance() + fixes part (of a larger patch series) Andy Shevchenko
2022-08-29  7:23 ` Jiri Slaby
2022-08-29  7:41   ` Ilpo Järvinen
2022-08-29  7:50     ` Jiri Slaby
2022-08-29  7:54       ` Ilpo Järvinen

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=20220825091707.8112-4-ilpo.jarvinen@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=jonathanh@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