Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp181735lqb; Tue, 16 Apr 2024 12:17:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU0Ytfrkp0BPKYeSKuguRNLBv0mdfyt32VKBYcFq4JLnXWyqddITwAeUbSj9p8zZxBJUDXWVZfmlTvfjqqPEwbTr7EZbXBozlQH5Iz54g== X-Google-Smtp-Source: AGHT+IHhOYZWTJBd4/8cXG8oEwfLK71Sdn08kmZaSpR3M/IuxdiUMcjp2K9G9mvm3LJr2LesaptN X-Received: by 2002:a17:903:32c7:b0:1e4:3b58:7720 with SMTP id i7-20020a17090332c700b001e43b587720mr17777449plr.2.1713295036092; Tue, 16 Apr 2024 12:17:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713295036; cv=pass; d=google.com; s=arc-20160816; b=LKGHNymknOAZyBpaqdmWbE9j6gzDFoKR/bHIt3gAtsejifgCQFDCA0SiUq4C9LwZ4I jvjq9T1Gouqthk9Y98ZMpW/kgFAG7g6dbVvByaWR7svKfijQHBdQ5Nk+eKyNSifqTKii r0KGO20nSqDmETO/doP7+1RUxW9CHDU9MZ7zdm2c9/o6lcAVcUi210XTj5OypzzTuCBb NOj2XlBZhmkn+hwyYfFnlm48x543uZWh4woqU5W3examnweISHlXNzm6rBjljLGp90MY mk9dBsEab8lnrZTW4QazjCxygJGMJpL1nfVGB+qle9r6slCfH4yd1NuAF65k9nd8vath G52A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:feedback-id:references :in-reply-to:message-id:subject:cc:from:to:date:dkim-signature; bh=Ac43jLMqQf/eO9EHaae+vUIk7xfngUWmCTeT+44YV3Y=; fh=IFgVgoakDO3qw9gWY07IltYmiI3jIJb9zoJI5Tu9WzY=; b=vDliIZVZs/Hgiqp64HyTTc+UeoIoHjczo9bbGROWv/srLNhe8ZLZZISxAjOsQWH0lo NG/EkBEg7d7FdA+nQKII1d5jFEVpM6LQB45jaYkX0vKhw8+sUyu70yAIJxTwkw1NBoMZ XJfFkwqY8Xg8vzAyWygd9EQvX/A+v4j/R/eCu9ai6egvm5/Z4Ey/lbLQxTJYAJVo8x0q 5WOLN2rjlspQFu8nNMfhA68prybLZFQ96yRV//7+iVWudR9I2HNekZY8iv4Fi/JjkUHH lUTYkn1VhilWk2CpDpzf3Zah0ShesK+7q1fdHPQAba2gtYYltspfYwLFNdPvM5rFkbTK MTQA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail3 header.b="Q/GBub0S"; arc=pass (i=1 spf=pass spfdomain=pm.me dkim=pass dkdomain=pm.me dmarc=pass fromdomain=pm.me); spf=pass (google.com: domain of linux-kernel+bounces-147455-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147455-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q5-20020a170902dac500b001e3d51ebf6esi10214587plx.406.2024.04.16.12.17.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 12:17:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147455-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail3 header.b="Q/GBub0S"; arc=pass (i=1 spf=pass spfdomain=pm.me dkim=pass dkdomain=pm.me dmarc=pass fromdomain=pm.me); spf=pass (google.com: domain of linux-kernel+bounces-147455-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147455-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id CCF72B211A8 for ; Tue, 16 Apr 2024 19:15:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E993137C2A; Tue, 16 Apr 2024 19:15:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b="Q/GBub0S" Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) (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 3ED1D13792A; Tue, 16 Apr 2024 19:15:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.22 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713294918; cv=none; b=YWlKF0gvPm7sO2wIWLTJ3ru4gKojHBG0/ic8945KDQhCTUhp3RosQjJ00neqywYwOCsN/WpSIqda/p5h7n/AXU0wx+V9AEFK7df93119Iy+Vn+qJ9ePFTDnAJXpT7gFhy2++Rg6cA1e4erLNARymbPQaD3Y0soeM7QL59pYBKOM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713294918; c=relaxed/simple; bh=Ac43jLMqQf/eO9EHaae+vUIk7xfngUWmCTeT+44YV3Y=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EOqtKIh/NWE9YHedsnZk5rtC34cDHMKr4V/OIzBWnYrta8+Q+nGWgFhv968Nyy9Jjb/kBX8P3RdvySuKoNSJF4XbSefdaoMx7r+0jY5khxu3MBtSM6fBLXfTiJHPdl190wEd4Y7uBYrqgUJIWGvAjdLbe6cGmNGPIHoadG+maRk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me; spf=pass smtp.mailfrom=pm.me; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b=Q/GBub0S; arc=none smtp.client-ip=185.70.43.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pm.me DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1713294909; x=1713554109; bh=Ac43jLMqQf/eO9EHaae+vUIk7xfngUWmCTeT+44YV3Y=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Q/GBub0SIgyBam+4opzEKK0txUbxvfCrhfAWYuAaSiYJtSNYdp44AFC9Y8RMMlxCw HXEZOppzCgWxF/UTq5ZhXx0+vd7kSizjzsE+3uoTjfdGyI1a+/F1od+NZN2/1ks8ow m6hngQhsRQdLUty/0DF+MgGgtZFff+fs/pd73fUAxuSHd7AqPrDTBMesEMQzmP9Inn Z76tf04rtmm1dt99egNjOuvc4a23AOjz7yZU007yWLt0IWhATgFMmFs5DXbiyxLrrG zrprpzfcX7aVT5enfVvRGGyU6LtRo11WdwtyqdatIFToOgHaZlECm8HiUINe/cQ+Ka /YViFEgnWX88g== Date: Tue, 16 Apr 2024 19:15:03 +0000 To: Andy Shevchenko From: Michael Pratt Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Wander Lairson Costa , =?utf-8?Q?Ilpo_J=C3=A4rvinen?= , Vamshi Gajjela Subject: Re: [PATCH v2 3/3] serial: 8250: Set fifo timeout using uart_fifo_timeout() Message-ID: In-Reply-To: References: <20240416182741.22514-1-mcpratt@pm.me> <20240416182741.22514-4-mcpratt@pm.me> Feedback-ID: 27397442:user:proton 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=utf-8 Content-Transfer-Encoding: quoted-printable Hi Andy, On Tuesday, April 16th, 2024 at 14:57, Andy Shevchenko wrote: >=20 > > unsigned int status, tmout =3D 10000; > >=20 > > - /* Wait up to 10ms for the character(s) to be sent. / > > + / Wait for a time relative to buffer size and baud */ > > + if (up->fifo_enable && up->port.timeout) > > + tmout =3D jiffies_to_usecs(up->port.timeout); >=20 >=20 > Why do we still use that default? Can't we calculate timeout even for\ > FIFO-less / FIFO-disabled devices? Maybe it's possible that there is some kind of rare case where the LSR regi= ster is not working or not configured properly for a device in which support is being worked on...without a timeout, that would result in an infinite lo= op. AFAIK, when everything is working properly, there is no such thing as needi= ng a timeout for a uart device without fifo, as every single byte written woul= d trigger an interrupt anyway. > -- > With Best Regards, > Andy Shevchenko -- MCP