Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1172151rdb; Fri, 1 Dec 2023 08:44:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IETqO90ALQpD1TGjchyETXGY0dnV7in51jdqaz5TsOL7xYvTOvs6LTHVYcXNWKVwnTPIZlY X-Received: by 2002:a05:6a20:6a1c:b0:18a:f317:1ee8 with SMTP id p28-20020a056a206a1c00b0018af3171ee8mr35621606pzk.16.1701449054896; Fri, 01 Dec 2023 08:44:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701449054; cv=none; d=google.com; s=arc-20160816; b=eVJBZUhv7KLEBnhmORBw9QV3udwWW6lcq3BmxTyUKuEwkj8ICWxGHAgtkgEs9875U2 aiye0PNa/vGDAjMR0GHBBBxej702eaXq3QK6zWyZ2SbaZZ8tUyZwmLm1Zf02Fjb18TL5 aIxH1T2TdzAZvbqPM/m8skX/AGunUgrgyTkvwFbSmShk+5iDPiqvCG+JrY1vB9c/aBH+ ConGfewEIYgzLcG7DzaLacdb/XxtdO3A59F9KoFtfV0I+pJm5qttx0AkAJiulKplJ5F8 E0lOjzyG+BQ7064YrmSBrm6DWgUF7Njdd8gl1ky4SoExqa8eaJqkfJa4PPM7LuDvzeU/ fFWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :references:in-reply-to:message-id:cc:to:from:date:dkim-signature; bh=7At9uuqHWGrA2m9Dhp2A4PrSwVUv/Y1UlsqVgIz15hI=; fh=GnhNJrJ3T6PCEJUyUIYZtS4zcsr2d66LvJpx1Sdd5pI=; b=FL98GjNr4Aat9T4uepCmt/ol54MxdPb+vNDTyQRXrjO7Uyc/457+bXukSeVl6+xjdZ rMA1Mm+hvvtNkYSYAC5YErCvV2luYT6NH/4LdToF6gcngWsnO+QPfpCnCh69cq9KzBrQ XcIxidGF3MUHnHqa7XdkrVn8kegBfTvZfcYxl9CHqUM0a6zKO7XOwf+Wi1Hsi8FLOna8 uqllL6KILPWmcWmjCMbEt26eDzONSE2V+m8dnc/o2rBx46jK7z+bV8Skx21fBGOaLVL4 3mDBqMbhrP3qRMuIuqXsjd7IA2a08yBBjivQdzT+G/mkd/Sjy7gIRnVeitPiCH7mru4J 0u3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=a6KD8D6j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id s63-20020a632c42000000b005af44ed3148si3473099pgs.367.2023.12.01.08.44.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 08:44:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=a6KD8D6j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 23586827033D; Fri, 1 Dec 2023 08:44:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229468AbjLAQnz (ORCPT + 99 others); Fri, 1 Dec 2023 11:43:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjLAQny (ORCPT ); Fri, 1 Dec 2023 11:43:54 -0500 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4207ACF; Fri, 1 Dec 2023 08:43:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=x; h=Subject:Content-Transfer-Encoding:Mime-Version:Message-Id:Cc:To:From :Date:subject:date:message-id:reply-to; bh=7At9uuqHWGrA2m9Dhp2A4PrSwVUv/Y1UlsqVgIz15hI=; b=a6KD8D6juzVjavnBFuM3wf+B7M 3uxRChtB/sCuHJekpKBLWWrufDPuWjmX3upNruc3a/hJo3nLGsr9rUjc2NI9fsvamnoXAEXtQJ6A3 jWajIBl5kbfzUmctZIMy8g6a74aiMFGHkH8iIiPPI232ZtnjYmp+jf4Pm0F4FAXB1Gvw=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:49622 helo=pettiford) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1r96cI-0004Xp-IO; Fri, 01 Dec 2023 11:43:51 -0500 Date: Fri, 1 Dec 2023 11:43:48 -0500 From: Hugo Villeneuve To: Jan =?UTF-8?B?S3VuZHLDoXQ=?= Cc: Greg Kroah-Hartman , Jiri Slaby , Hugo Villeneuve , , Message-Id: <20231201114348.fec7077998136877adb030f9@hugovil.com> In-Reply-To: References: <20231122175957.3875102-1-hugo@hugovil.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_CSS autolearn=unavailable autolearn_force=no version=3.4.6 Subject: Re: [PATCH] serial: max310x: change confusing comment about Tx FIFO X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.hugovil.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 01 Dec 2023 08:44:12 -0800 (PST) On Fri, 01 Dec 2023 17:04:15 +0100 Jan Kundrát wrote: > On středa 22. listopadu 2023 18:59:56 CET, Hugo Villeneuve wrote: > > From: Hugo Villeneuve > > > > The comment wording can be confusing, as txlen will return the number of > > bytes available in the FIFO, which can be less than the maximum theoretical > > Tx FIFO size. > > This (commit) message is confusing, too, IMHO, because `txlen` is the > number of bytes that are currently waiting in the TX FIFO. So that number > is "available" for the HW UART to pick up and send, but it's not a number > of bytes that's "available" in the FIFO for host to push more bytes to. I > guess you might want to tweak that description here. Hi Jan, you are right, the commit message is confusing. I copied it from the commit message of a similar patch for the sc16is7xx driver, and I should have modified it for the max310x: SC16IS7XX TXLVL: spaces available in TX FIFO MAX310X TXFIFOLVL: current fill level in TX FIFO The patch has already been applied to Greg's tty-next tree (my understanding is that it cannot be rebased?), but at least the comment in the code is still valid. Thank you for the precision. Hugo V. > > > > Change the comment so that it is unambiguous. > > > > Signed-off-by: Hugo Villeneuve > > --- > > drivers/tty/serial/max310x.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c > > index 97e4965b73d4..f3a99daebdaa 100644 > > --- a/drivers/tty/serial/max310x.c > > +++ b/drivers/tty/serial/max310x.c > > @@ -780,7 +780,7 @@ static void max310x_handle_tx(struct uart_port *port) > > to_send = uart_circ_chars_pending(xmit); > > until_end = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE); > > if (likely(to_send)) { > > - /* Limit to size of TX FIFO */ > > + /* Limit to space available in TX FIFO */ > > txlen = max310x_port_read(port, MAX310X_TXFIFOLVL_REG); > > txlen = port->fifosize - txlen; > > to_send = (to_send > txlen) ? txlen : to_send; > > > > base-commit: 98b1cc82c4affc16f5598d4fa14b1858671b2263 > >