From nobody Fri Dec 19 17:33:04 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F8AFC07E9D for ; Mon, 26 Sep 2022 11:29:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234607AbiIZL3c (ORCPT ); Mon, 26 Sep 2022 07:29:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237932AbiIZL2R (ORCPT ); Mon, 26 Sep 2022 07:28:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D56306B150; Mon, 26 Sep 2022 03:41:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 49180B80942; Mon, 26 Sep 2022 10:41:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98BBBC433D6; Mon, 26 Sep 2022 10:41:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664188878; bh=xLv6Yp4tyzE+V2Ro4LgR0kyqrrBkxn5bGkLAx5w9QAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oOSYu/LaN05Ijg+NnhPLnYQH4TnK4CY/odo9ex39IGeCAfZ8/YzFDlRA4jHNwPoYo /3NsE0j0ybLJ+YCz1tjpw9DCWpau3RHMYdq+ToKyQ+VRvPNjCT1j+b1lvQ9SOaNPdr gHR9/ud2haTjHTP9Zcaubkz8jkUwwU8Ln6mlycL8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Shevchenko , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH 5.15 121/148] serial: tegra-tcu: Use uart_xmit_advance(), fixes icount.tx accounting Date: Mon, 26 Sep 2022 12:12:35 +0200 Message-Id: <20220926100800.685080097@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100756.074519146@linuxfoundation.org> References: <20220926100756.074519146@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ilpo J=C3=A4rvinen commit 1d10cd4da593bc0196a239dcc54dac24b6b0a74e upstream. 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") Cc: # serial: Create uart_xmit_advance() Reviewed-by: Andy Shevchenko Signed-off-by: Ilpo J=C3=A4rvinen Link: https://lore.kernel.org/r/20220901143934.8850-4-ilpo.jarvinen@linux.i= ntel.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/tegra-tcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 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(stru break; =20 tegra_tcu_write(tcu, &xmit->buf[xmit->tail], count); - xmit->tail =3D (xmit->tail + count) & (UART_XMIT_SIZE - 1); + uart_xmit_advance(port, count); } =20 uart_write_wakeup(port);