Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp828014rwb; Mon, 26 Sep 2022 06:25:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4esFriqdwBgdiZiBhfLIdUEsb3dOurESyHqyec/A3UnlWNtj6hZNLWmx30qgQBr0CYzMdJ X-Received: by 2002:a05:6402:35d6:b0:44e:f45a:8f79 with SMTP id z22-20020a05640235d600b0044ef45a8f79mr22643648edc.393.1664198723321; Mon, 26 Sep 2022 06:25:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664198723; cv=none; d=google.com; s=arc-20160816; b=pe0AirKMV7OOxeNje1Q/zuDBd9nBlN2zXWKOPP8cCqAVUdqaYrYg87og4rlnuULzO6 7Co9IE/nH01opcG0yeGpdOMc3Lt2LTlePUaEGAfStR9eWlGwRzCYpMJG8XcGLDvPu0Hv RpKlOOfWe/NJfjqtCptxc7Z8e8RqQNO7LsoPG0BvZgg2B3aPfv6e2C84OfOyxJ7ftrba Nyzxgkhw7A6W0+In0SCotKGTlbLzY4Il3TzLVOffgxw7Vq7AzDinxLiC9lMv5dnDQDEp LFbvcW8RsCdYRtDSeEZ9ANuhi5fGZzeiYhcrw/yZVOawxQVlHqwv7illJ3s9fbQ1Rsmj riyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gPxTfQrasTVvD7DTl2TpO1T3lJuaLWljlRKT8/NDArs=; b=Am/vVWps3VByN7VQ3fHB3yNIoDoyq8Ha3Y36ZWMNV+pZldJCas8rxhaDMHyFJ84reQ Qkm4jUQwHb8Js6KHvmRNnR1eqG5nf8uRNaz//Kew0R9j4OyAar39wWFOwH7QGfO3UnUC h0OcCSpbWf3vPfgRJJqmLZFqhtMd1OOokChCOtMgLY47FOhNn5l6y4bSaJvw2AInnQFi 740uRbt2KpXefMzLpcUHx/o3Uy7/HAVpgcydPbdBajP9s+FMHUPDETuJupSVoFezPBXJ 1YKEHCNKvUBAORSYo4FNsfhKUnWAk9Zchlx40+OzzqmXJAsL2zJ8a8zR8CuHb1VT8H6S wYCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jWP2EGuI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jj1-20020a170907984100b00780e844b2f7si12748116ejc.481.2022.09.26.06.24.58; Mon, 26 Sep 2022 06:25:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jWP2EGuI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235135AbiIZL7I (ORCPT + 99 others); Mon, 26 Sep 2022 07:59:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239323AbiIZLzN (ORCPT ); Mon, 26 Sep 2022 07:55:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43BC078BE9; Mon, 26 Sep 2022 03:50:42 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 7D35D60B4A; Mon, 26 Sep 2022 10:49:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78865C433D6; Mon, 26 Sep 2022 10:49:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664189369; bh=xLv6Yp4tyzE+V2Ro4LgR0kyqrrBkxn5bGkLAx5w9QAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jWP2EGuIV81mMqSu1Er3qoMQXsfLGXmrylciEZEXNuGEAm5+cE4hEQ8NL1Tyasr9Z Kj1gcDnaF8xh/KyXAwfwItpHBjgR5m3H+EA6tERCLV92+hp3iEwv1x11hexOYBB0Cz EReUpfNFCnhHZ3J8LNJAdJKLKjnk+bBY8l9wWDro= 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.19 163/207] serial: tegra-tcu: Use uart_xmit_advance(), fixes icount.tx accounting Date: Mon, 26 Sep 2022 12:12:32 +0200 Message-Id: <20220926100813.971169658@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100806.522017616@linuxfoundation.org> References: <20220926100806.522017616@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ilpo Järvinen 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ärvinen Link: https://lore.kernel.org/r/20220901143934.8850-4-ilpo.jarvinen@linux.intel.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; 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);