From patchwork Wed May 8 13:37:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 13658806 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D4D08C04FFE for ; Wed, 8 May 2024 13:38:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=4F6ojjNsSTxGlnCPNbu0oYWtyZoP9pzPMkctOaCOyC8=; b=ttpMoHer6C4Tml HQ8S3uF2IY2msPqueYP6mo0XIXB9h0g7ctbVfaVGY/lTpDvia70LMtLQJM/WhRe3wXL3Sjk1udc6x xI7bx3jotzxW0cDInEotjZJrNPycgHNUR9A+c9ytJzm5gi5HVgv6rxij69WMqxLtUMr/KRevx7bBw PtW03lRpDcZ9QjbWK3LTOerrdJFefE9jVI3hOJ5OyxbFat0LQEt/d1Lpa24JsIK7HmKpK3Da60iTH yhpXJDpnBv7NLckvmD+uu3zyUyrDpP4nuztGviNXxKrqj8bmbcSh3wYQd0CcbYN30OGhn6LD+J/Wv qkGVCF6Sc6Flf2Ar3Rxg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4hV2-0000000FfiZ-0tNH; Wed, 08 May 2024 13:38:35 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4hUu-0000000FffR-3kQe for linux-arm-kernel@lists.infradead.org; Wed, 08 May 2024 13:38:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1715175497; x=1746711497; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=1anWl7U0g1N5ReOl67RGFJDhNdBee4tIaUiND+Vgla8=; b=Gkg3ZYqlCRe+cKlZzLR5D3ZotH/o3fnPNoKnByBWeL/Cy+q5eGiXf/vW W2ZDEYaiLp+vEnjdQBO+yKEXB46BpdC56pzQQY0R+/hbgXqsezkwm40yw TLrZLOD5bac6L+9Op3eAz/24nSpDD3D1XaAjsNcLvjOIVkx0BTlQXcBeM sUyczFm2tb8ilA1hCXpkL6kA+e9KtGD0n3hF15kZejiysKmk+Xze8tbQ7 gf+snhH5DFLfixN28sgzv2J/W19P7kTrhwrEJQXDiGf6ZeKaY5VxuTVo9 ofkubQ//jbtRTQP20xMwlG88WaETap6TZan1MqOTJvRZizH7gYqzCb0OP A==; X-CSE-ConnectionGUID: z54Sk1EmRBC1VdH69ne3fA== X-CSE-MsgGUID: 3vZd3Y/sRkKMGvbzBMbsTQ== X-IronPort-AV: E=Sophos;i="6.08,145,1712613600"; d="scan'208";a="36814849" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 08 May 2024 15:38:11 +0200 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id D977816E68D; Wed, 8 May 2024 15:38:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1715175487; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding; bh=1anWl7U0g1N5ReOl67RGFJDhNdBee4tIaUiND+Vgla8=; b=qtXJCzoersL5wQiIkKQBAwn4D4j1wABKeNyuQudkAIie3Q8ZmvyTdD5EEbJNiX7a42Ctpk W1eBU5pUlT2EFPWCm6CPi5kFsDDgkeP0OUiJjsVJct0eVihbTEg76lQCV7yAo2N+FH5Etn PcWCE0YGvTmH1q9BOR0cBxOGgSPG/o0oLR1glcAgFoOz8b3+btIhMgCk1mhPeIjg7K5tBZ v9qfdIH/33ko0jAiHFk/lPBP03oCDFu2N5ZCDQ391ng8zlYRQZZPbi96RHuKup5SCpW0AO Q3DcCAxCoeIkVPH7W6D6WB+F0LyjF6wjePw6SGW3HHIKKh93QW/RJwxc+AfrRg== From: Matthias Schiffer To: Greg Kroah-Hartman , Jiri Slaby , Shawn Guo , Sascha Hauer Cc: Pengutronix Kernel Team , Fabio Estevam , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux@ew.tq-group.com, Matthias Schiffer , Michael Krummsdorf Subject: [PATCH] serial: imx: Raise TX trigger level to 8 Date: Wed, 8 May 2024 15:37:44 +0200 Message-ID: <20240508133744.35858-1-matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240508_063817_540629_9BEF8C4F X-CRM114-Status: GOOD ( 12.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org At the default TX trigger level of 2 in non-DMA mode (meaning that an interrupt is generated when less than 2 characters are left in the FIFO), we have observed frequent buffer underruns at 115200 Baud on an i.MX8M Nano. This can cause communication issues if the receiving side expects a continuous transfer. Increasing the level to 8 makes the UART trigger an interrupt earlier, giving the kernel enough time to refill the FIFO, at the cost of triggering one interrupt per ~24 instead of ~30 bytes of transmitted data (as the i.MX UART has a 32 byte FIFO). Signed-off-by: Michael Krummsdorf Signed-off-by: Matthias Schiffer --- drivers/tty/serial/imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 79f1503cd75b4..2eb22594960f3 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -1305,7 +1305,7 @@ static void imx_uart_clear_rx_errors(struct imx_port *sport) } -#define TXTL_DEFAULT 2 /* reset default */ +#define TXTL_DEFAULT 8 #define RXTL_DEFAULT 8 /* 8 characters or aging timer */ #define TXTL_DMA 8 /* DMA burst setting */ #define RXTL_DMA 9 /* DMA burst setting */