Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1580227rdd; Thu, 11 Jan 2024 03:38:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IE2Zu3oTLkI40z8Y/af+w/Pk+PtvtJOQ/nty/1ApwhyQKJ45FvPpne/2E57mKDshk9dd+EH X-Received: by 2002:a17:907:9707:b0:a28:aa90:2dd0 with SMTP id jg7-20020a170907970700b00a28aa902dd0mr335412ejc.44.1704973108352; Thu, 11 Jan 2024 03:38:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704973108; cv=none; d=google.com; s=arc-20160816; b=mWBnWcjZyQTMLxAP6Z03Lcc7VswFX5LHuz4Oi6rLig7Gx+zIDeLoODwcjF1vV0C8Ot CS0pSeTOsnaaUjT4y9xX02DLIhleo9r5SMwOIXRr/O2MQXUb2r6UfGuzL2NmZ+wF1YFG fYENBO2Udr5YJxwSMkNYxLSCJD1wen0uRniDRh56Q2WQauFNyHkBmSuVwWYGsh5D+lHN A2XvLL8gDmk3gkiYwXIxEj9dVfwfbgYja0xyxkaVB4zcxTjY15LeERs5UxteEnHVM0Wp Y0dPdTExQ6v+YhGCekPgWanPaQdgzyMwJXBllTfyZj6L+T2vUCkcRrk6vqGrnF+AwGLf U3GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:date:from :dkim-signature; bh=SZ00bj13GfSGEOm3AnNPDE7ZYxoalWXABWKNc5kkMsE=; fh=GDx6DOlBFqqoVyHMn91ZI2haPCTFpgufYcwAjMzu+6U=; b=j63GE77m3nQVj4zJXdRMTSAGj4nqwTTUt9/DOfbmbIduLXJW0VusXCne2D03gDgCkp jdDyxW+l714OGNQ/vS7Hng5jpXyplvTl/+5cGkSMAUPmzI7X1+7KGI0E1XyqGTdI742N 50HO37+EvcNazEZviHqdLyLl+QfDnGFiCBwPtM0sm8kQbuxXtSUdkA7qonw9lmpsxnDd SJR+3QbAefYhaedSe1NYHTiDgDp+pIN/TeHkQv0QTKM4dR2iJDUOxlavyLMxRkrIhJkZ AMO4t6jrcV7VZAJcRm1m/W5X9QdRiyHMTlghZ8XKK9Cy0y5OgIaqzkL4OH8fAltJdQus ExkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ug8d0jJ9; spf=pass (google.com: domain of linux-kernel+bounces-23503-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23503-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id o1-20020a17090608c100b00a26f0662381si434547eje.804.2024.01.11.03.38.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 03:38:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23503-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ug8d0jJ9; spf=pass (google.com: domain of linux-kernel+bounces-23503-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23503-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 1D8A61F22398 for ; Thu, 11 Jan 2024 11:38:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD41A15496; Thu, 11 Jan 2024 11:38:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Ug8d0jJ9" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) (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 7A2A0156C8; Thu, 11 Jan 2024 11:38:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704973092; x=1736509092; h=from:date:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=Z1ttDXrYTv+Sve/f2vZWawOKbHHb4+tnEe1pfr93vWw=; b=Ug8d0jJ9XHd1lRGtVWDI3ilJKPxx6DZHW0tqEeVbjnMSDw8lXF2ArJ20 oaV/fe2AjhfUA8tFFkHDCQvCYn1I/H+Jvuzq5Bdzo/IcFEdbXCV2VLx0Q Dqyy3DehdxKCd1t6b7hQ4tqqI4aBvmHMSduwnv2Pi/1SCcEBSjI1hI6jn F8XQBtem4+TdJiMq4gwHx6SR9PuCNy16OYnecPBPeKqEOCwu6WSftYH+x in6ERmt59PVSeFMFg3j6v1ADErCHA1E4VufqI6Gv9GSUJ+f2R4K/orLCC qz6yJyJNi/br9NFNzeKyzQH/6SxoNBs2y2R2eUZ6t+oMcGz3G7XUj3cWs A==; X-IronPort-AV: E=McAfee;i="6600,9927,10949"; a="395965665" X-IronPort-AV: E=Sophos;i="6.04,186,1695711600"; d="scan'208";a="395965665" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2024 03:38:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10949"; a="1029514569" X-IronPort-AV: E=Sophos;i="6.04,186,1695711600"; d="scan'208";a="1029514569" Received: from ijarvine-desk1.ger.corp.intel.com (HELO localhost) ([10.246.32.201]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2024 03:38:09 -0800 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Thu, 11 Jan 2024 13:38:04 +0200 (EET) To: Michael Pratt cc: Greg Kroah-Hartman , LKML , linux-serial , Jiri Slaby , Wander Lairson Costa , Andy Shevchenko Subject: Re: [PATCH v1 RESEND] serial: 8250: Set fifo timeout with uart_fifo_timeout() In-Reply-To: Message-ID: References: <20240111002056.28205-1-mcpratt@pm.me> <2024011125-stiffness-mutilated-75bb@gregkh> 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 On Thu, 11 Jan 2024, Michael Pratt wrote: > > > On Thursday, January 11th, 2024 at 01:52, Greg Kroah-Hartman wrote: > > > On Thu, Jan 11, 2024 at 12:27:07AM +0000, Michael Pratt wrote: > > > > > Commit 8f3631f0f6eb ("serial/8250: Use fifo in 8250 console driver") > > This is the commit that made the issue present itself. > > I'm not sure whether it's right to say that this "fixes" that commit > since it only caused the issue indirectly, and the diff for this patch > doesn't touch any lines that the other commit touched, and the method > I'm using to fix the issue was not available at the time, and also that > for high baud rates like 115200 everything is still fine... > (the 10 ms timeout is as old as the tree) > > If that's enough for a "Fixes" tag then go ahead (or tell me to add it), > but maybe a "Ref" tag would be enough? > > You can see the other thread linked for more discussion on that point if you like... Besides Fixes tags, you can add dependency information for stable folks with Cc tag using the format described in Documentation/process/stable-kernel-rules.rst -- i. > > > 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 mcpratt@pm.me > > > --- > > > v1 thread: https://lore.kernel.org/linux-serial/20231125063552.517-1-mcpratt@pm.me/ > > > > > > What commit id does this fix? > > > > thanks, > > > > greg k-h > > -- > MCP >