Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1461419rdd; Wed, 10 Jan 2024 22:52:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IFOmc/7gF0auMYJgH+LrBubG/D3LU7je5+qDtdZieQ+l2YmUXf3pNAUZHFq9YMDPn9YAuOF X-Received: by 2002:a17:906:647:b0:a28:bcc0:74de with SMTP id t7-20020a170906064700b00a28bcc074demr304863ejb.71.1704955970507; Wed, 10 Jan 2024 22:52:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704955970; cv=none; d=google.com; s=arc-20160816; b=U6m54H2y2+e59WXuwBXiMcmmmNE0d7XXsq80XmQCJ5V8KeNK+BHw6tKNyrh85/eY68 p7sv7PWjnSjN9AjJxCXXa2bM1BC+3em2jzayTL6QBeQwGM2wFHnb/nX4+x9bSDg90M9X CW67BanNAnhksQEe3L/JjrRaa6Rki3JL7/gDcoJfgIc5FxMOzf2IF+/A4WOnbCC9ycav 74HI0gaUlfwHOXax+Xo13g1Q18dL0PXIv66S/1Da/1ONid79vubjsbwn8bL1zG+n5Du8 NE63a9Z3t/yNyommpZCNPPso6RJZACSfHqFGRPwE8eVcVbm40T8T6bIwLIh9tdpdmAo1 A5Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Ql9pPJsfAF9Wom6RZVGlxdNQ6HDXPWyrp0AXY1Z8ZuU=; fh=cFVGRozBCNlk7SpqAnd+/ZHeMy0S9J0Mtqlz2wuIw4o=; b=tocmgeFjPB7Sb8ogyT2CtP8XsLtUbZu5fxUMJMhZZd1G7cLakYRHbuRNHBincV2oYR 9B8DRaSyXfTNNcVaLx/V0sfciqYVvqrQ7ejiJbraW834ywM7gkvGIC9J2jgGevw3iZpp sqsyffKbYrSRPSAJclDAHK00vJKg2zACYVnQzDyt+Cu8a+93N1nrWN3l0/74icBgjsYx 7fH4JhoTpkrYbHVmGKLcm+A/rNGp/Krqsy2GsbPVNTq8whP4heSOAjchSoTh4I5CsxEw Erwhpwyr0VAtD1ZEW2pVt6UPhv67Qa2xqwmnLV+cfxcVjDnXolwmbwGfUaqBkZUIlHCb CiJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NGvG5Scy; spf=pass (google.com: domain of linux-kernel+bounces-23116-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23116-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ka14-20020a170907990e00b00a2a12e01927si210282ejc.279.2024.01.10.22.52.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 22:52:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23116-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NGvG5Scy; spf=pass (google.com: domain of linux-kernel+bounces-23116-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23116-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 463941F23867 for ; Thu, 11 Jan 2024 06:52:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A554653AF; Thu, 11 Jan 2024 06:52:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="NGvG5Scy" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A16995382; Thu, 11 Jan 2024 06:52:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEC21C433F1; Thu, 11 Jan 2024 06:52:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1704955961; bh=xODAJt+RpoPJsO1LiIGKxZkDf5NGLa+gJ+Rp4TBoiSo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NGvG5Scy2oHu4RjRhn1DooJi/oby9fU1wUT8C/miebL+QfF1a7sx6/bdVrPlGHAsB tBhO9Fvb91ySI920IiZ6n2VdGLlROSdvkQZlWzpWSvk9pj8odtmearkVcKkeOS3xSk z6uZy/1xiehw7QgVXhsfcTKktwA5BACgrXA6NcxE= Date: Thu, 11 Jan 2024 07:52:37 +0100 From: Greg Kroah-Hartman To: Michael Pratt Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Jiri Slaby , Wander Lairson Costa , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Andy Shevchenko Subject: Re: [PATCH v1 RESEND] serial: 8250: Set fifo timeout with uart_fifo_timeout() Message-ID: <2024011125-stiffness-mutilated-75bb@gregkh> References: <20240111002056.28205-1-mcpratt@pm.me> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240111002056.28205-1-mcpratt@pm.me> On Thu, Jan 11, 2024 at 12:27:07AM +0000, Michael Pratt wrote: > Commit 8f3631f0f6eb ("serial/8250: Use fifo in 8250 console driver") > reworked functions for basic 8250 and 16550 type serial devices > in order to enable and use the internal FIFO device for buffering, > however the default timeout of 10 ms remained, which is proving > to be insufficient for low baud rates like 9600, causing data overrun. > > Unforunately, that commit was written and accepted just before commit > 31f6bd7fad3b ("serial: Store character timing information to uart_port") > which introduced the frame_time member of the uart_port struct > in order to store the amount of time it takes to send one UART frame > relative to the baud rate and other serial port configuration, > and commit f9008285bb69 ("serial: Drop timeout from uart_port") > which established function uart_fifo_timeout() in order to > calculate a reasonable timeout to wait for all frames > in the FIFO device to flush before writing data again > using the now stored frame_time value and size of the buffer. > > Fix this by using the new function to calculate the timeout > whenever the buffer is larger than 1 byte (unknown port default). > > Tested on a MIPS device (ar934x) at baud rates 625, 9600, 115200. > > Signed-off-by: Michael Pratt > --- > v1 thread: https://lore.kernel.org/linux-serial/20231125063552.517-1-mcpratt@pm.me/ What commit id does this fix? thanks, greg k-h