Message ID | 20231122175957.3875102-1-hugo@hugovil.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp1505668vqb; Wed, 22 Nov 2023 10:00:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfuh/gdHppu2pVi4FSMwq4fE4+7Dm5x+cb+GreBRAhK+X7dcvaepEjoS+uKY654RHZLqr+ X-Received: by 2002:a05:6a20:840d:b0:153:78c1:c40f with SMTP id c13-20020a056a20840d00b0015378c1c40fmr3780829pzd.15.1700676011292; Wed, 22 Nov 2023 10:00:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700676011; cv=none; d=google.com; s=arc-20160816; b=Dh7eCtBcJMayeMI1s55FZqXPrtQUzP19wc2NWgIff5ubZHmDQsbcUQWkAoiZCWh/1/ lHClWhCO92pVY+J5wC92h6ow1Bll1HByl6unMVUVodOkqHBLYqUBVr+J0sKO7AIHLgyR OVYoB/L5giNItr9pk6cnyhmE18sNi/JNjm21kwLxYT2grw1xDQlaOttOD4yIZwcm5BNl zSQz0H2zJ5uqKaDMrhGUa3muDst8eVxXdlGoL1HognWUsV08GmlQ4emhxlFyASxXdM/w m2/HDICF3TMSaCzL6M9z0iFz0lasG3RR4XBZKhWL08kM616Bw9OhMAzCOoG1zbYMH9Kr 7IrQ== 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 :message-id:date:cc:to:from:dkim-signature; bh=mogw1+ONtpkAQfXqFiiZf+Z9HRH49163oXyjFNr/5SM=; fh=Nz6ne7h+AgCzD1lryOzZAocqC56o6aNMrzsKseIZn0k=; b=pr2PZXeLgB++nyfqubh1pwQiIW4W+VacZAxoDOgfOY70or7sSli9ReOcc9QtJWjyKP /2Pb1NEX9+sf71aUPJZjY/EzgsExClg8nHlIeAtDuhEjKvdEnWC46V9SlOh2s/4wNj6n ZtPka/O6dGWXx6n1hG11tbGRnhrWgXWXdKV7dnwcWNfp+S3caeg8yx3T8zfuMzj3eplr MgQqhsbiT5EDO3uvdTT88OymNSdjDimJ/1b1dxXzdNDAdXf0HUcb5/I6gvr666tLYT+P EV/6OluNh0+kBkcotwgNwsJc2wmipZfeiIKJKPcqW4YdSR/myUXCCYa/FhRz0r5Ppqeu rMrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=wzjDlURU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id h132-20020a636c8a000000b005bdfbf1d562si12145363pgc.192.2023.11.22.10.00.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 10:00:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=wzjDlURU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 3061E824E511; Wed, 22 Nov 2023 10:00:06 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231652AbjKVSAH (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Wed, 22 Nov 2023 13:00:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230377AbjKVSAG (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 22 Nov 2023 13:00:06 -0500 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CB581B3; Wed, 22 Nov 2023 10:00:02 -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:Date:Cc:To :From:subject:date:message-id:reply-to; bh=mogw1+ONtpkAQfXqFiiZf+Z9HRH49163oXyjFNr/5SM=; b=wzjDlURU69dbRv1uUWnq8LJdpP fUFWW3JseNpffxI/31xEbHCDGCMBv2WMsUX40JeS/t6QOhNHthjcAa6KIcK5X11kykR/ColpoaQFJ x08OjrJPT8ZWIJTBAZQ2cuzRetruPrce6HTCaar8NG5t80vLeIbGdkpEPg3ySpiX1+lQ=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:50830 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from <hugo@hugovil.com>) id 1r5rW2-00015P-MR; Wed, 22 Nov 2023 12:59:59 -0500 From: Hugo Villeneuve <hugo@hugovil.com> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jirislaby@kernel.org> Cc: hugo@hugovil.com, Hugo Villeneuve <hvilleneuve@dimonoff.com>, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Date: Wed, 22 Nov 2023 12:59:56 -0500 Message-Id: <20231122175957.3875102-1-hugo@hugovil.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 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 lipwig.vger.email X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 Subject: [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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 22 Nov 2023 10:00:06 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783288049161919744 X-GMAIL-MSGID: 1783288049161919744 |
Series |
serial: max310x: change confusing comment about Tx FIFO
|
|
Commit Message
Hugo Villeneuve
Nov. 22, 2023, 5:59 p.m. UTC
From: Hugo Villeneuve <hvilleneuve@dimonoff.com> 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. Change the comment so that it is unambiguous. Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> --- drivers/tty/serial/max310x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: 98b1cc82c4affc16f5598d4fa14b1858671b2263
Comments
On středa 22. listopadu 2023 18:59:56 CET, Hugo Villeneuve wrote: > From: Hugo Villeneuve <hvilleneuve@dimonoff.com> > > 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. Cheers, Jan > > Change the comment so that it is unambiguous. > > Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> > --- > 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
On Fri, 01 Dec 2023 17:04:15 +0100 Jan Kundrát <jan.kundrat@cesnet.cz> wrote: > On středa 22. listopadu 2023 18:59:56 CET, Hugo Villeneuve wrote: > > From: Hugo Villeneuve <hvilleneuve@dimonoff.com> > > > > 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 <hvilleneuve@dimonoff.com> > > --- > > 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 > >
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;