Message ID | 20231026135628.2800617-1-vamshigajjela@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp693122vqb; Thu, 26 Oct 2023 06:56:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFDN0NllDvSzGrdQ/Idrh/ri+6e2//wjnxGSqLf8PaKLF0ZKoahEVEjieTtZMYD1u9CLfHX X-Received: by 2002:a25:c711:0:b0:da0:54f7:11cf with SMTP id w17-20020a25c711000000b00da054f711cfmr7800093ybe.49.1698328605599; Thu, 26 Oct 2023 06:56:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698328605; cv=none; d=google.com; s=arc-20160816; b=PIM4CVq6NVoGjMFtpOLJBPd5SA99F6FO5EBRIzJe6a66OVyQiuwdi8tDk4VRjfbNYx fQJ+jAN8m53Ns3XXW/OO87+GV1T0LUv2dcOsnugce0fdAtFjolsrpZC0yr5hOzh0hUVO zp03AW2nvZo3oLXA8md/+1r2aGvV2EmSHEbkMtMlMvzcF1j7fdQgssbD4Bhqn47UKNbL BLFYEZSEX4T3jdsniNaTRYb5kG3oMM7e0je3UtUmA3NWg0lBOm3/Ie8ldre0Yl8xz/Cx Bj0G3t9aqoNK61cDYPjCB+9ZkHiSeTT5BL3bjR5E1R/aW99TbbXqYIU6eD7q2xgftXzg ek1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=y4G5FMWajl/F1bjn3WpqChw5dodQuAFRVzNXYVASYSI=; fh=4iPUH3SCaUeHRPwZInlqPLZI8cmh/b74OgcORLvvuVM=; b=X0o+mqFldhbMtryJ+VUX0zCnc4FsK/eELSpS5aTVuF4uXb2sI+wtH/oBb5lbOgPnkO cSrhjtd7nX8+W/D7O5u5JDWbYVqJn3s32LY8nZSAHnamGSdknDK7AmSOgzbPOgU4NXsG gZ8OabcJVf7uyQM6912furJEmKm6ZTYjwt0jEyB3EtQrpPhLGgDfqSWNbj/xFZLJre5q 85L4yBKAnR7y4rGoTKGEhCiXQichWIWqJei3hauPX/Efto7Gt6zxPFTGQws7yAdXL/o2 IYP+mrpmkzgpV/MwiIFxB+oUE5Bmxsw26cjo6f8UXxAGkoNtwlK+Wx+7a6aFCt3Q6hcG UPNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=VSvoXAH7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id x128-20020a254a86000000b00da07267940fsi5138247yba.464.2023.10.26.06.56.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 06:56:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=VSvoXAH7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7BF95818ABF6; Thu, 26 Oct 2023 06:56:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345152AbjJZN4l (ORCPT <rfc822;aposhian.dev@gmail.com> + 26 others); Thu, 26 Oct 2023 09:56:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234875AbjJZN4i (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 26 Oct 2023 09:56:38 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9660FBD for <linux-kernel@vger.kernel.org>; Thu, 26 Oct 2023 06:56:36 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-5af592fed43so1755507b3.2 for <linux-kernel@vger.kernel.org>; Thu, 26 Oct 2023 06:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698328596; x=1698933396; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=y4G5FMWajl/F1bjn3WpqChw5dodQuAFRVzNXYVASYSI=; b=VSvoXAH7++daBy6NrFerw+gKsLPPwo4kNGmhNln4C8ky04h4BmcIle4+KWNx8AQdIf hBLz1LeVcbS1VLBX5vVbdLi25u7Fx6T/OSlcN1bl5/L00aHKSF5ESFc1ATOELpoGuhe+ McR7wwtprYfW11apDvQTZ9qpiN1xN+P46mG0DyWgd+RW6v/sIB9gF+RjMqALrAXoEy5W tnwyPgMS3NY59S0EtdDML7KJb9t50Z+cyt305PU5JSaudP1Pn0JDk7IRGzHzgyTlT+ad iCTFBfCaApAc18NMLKC/4odM0L0ichbOSVInb6XU3X5flqbp8xr1WnwlfZw9gn0gPHQh Gvdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698328596; x=1698933396; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=y4G5FMWajl/F1bjn3WpqChw5dodQuAFRVzNXYVASYSI=; b=RiuTRuo8XZuNY3pK6oyM0z29CoVwrS8iENdASC7+NYh8rMUGuF9a/a9a+XfF8uqtXQ TD1MnAhHvBnBrRPDTUIZZJt9U9fa/nOm+Mr8VeI0h0fMljFS1rQ5ER0QwkWF+YP+0Opv jlT1EJNplXGMXfDf/1IZ7fTSGbEolMipivDtq0mH3QLv0UdDcMc5vmKQFqtbq+yN1iZV hRK2RAhJUvQHuXBmk5lfXxJulXtY890weHCrgTifyqIrNyX2yAiRLB6rbQiiK+P4SPqf Vqv8n1KKUXw5q8XKox0AZxrM8p4xC6mQJPxbh7Oe9gLiOxMusjdkMKOS3kYRqtbqjy3E rwEA== X-Gm-Message-State: AOJu0Yz4+8t4o8XnuzTdW47wx4aTjcp+pR8o16nOyB+7c8ZB1903NUzS iEgbKdovYlaQ4OAthDfY3BtVWp4BZWxQPq+LnWmE X-Received: from vamshig51.c.googlers.com ([fda3:e722:ac3:cc00:3:22c1:c0a8:70c]) (user=vamshigajjela job=sendgmr) by 2002:a81:48c9:0:b0:5a7:db29:40e3 with SMTP id v192-20020a8148c9000000b005a7db2940e3mr420178ywa.7.1698328595848; Thu, 26 Oct 2023 06:56:35 -0700 (PDT) Date: Thu, 26 Oct 2023 19:26:28 +0530 Mime-Version: 1.0 X-Mailer: git-send-email 2.42.0.758.gaed0368e0e-goog Message-ID: <20231026135628.2800617-1-vamshigajjela@google.com> Subject: [PATCH v3 3/3] serial: core: Update uart_poll_timeout() function to return unsigned long From: Vamshi Gajjela <vamshigajjela@google.com> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jirislaby@kernel.org>, ilpo.jarvinen@linux.intel.com Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, manugautam@google.com, Subhash Jadavani <sjadavani@google.com>, Channa Kadabi <kadabi@google.com>, VAMSHI GAJJELA <vamshigajjela@google.com> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Thu, 26 Oct 2023 06:56:44 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780737936598364815 X-GMAIL-MSGID: 1780826615656679135 |
Series |
None
|
|
Commit Message
Vamshi Gajjela
Oct. 26, 2023, 1:56 p.m. UTC
From: VAMSHI GAJJELA <vamshigajjela@google.com> The function uart_fifo_timeout() returns an unsigned long value, which is the number of jiffies. Therefore, change the variable timeout in the function uart_poll_timeout() from int to unsigned long. Change the return type of the function uart_poll_timeout() from int to unsigned long to be consistent with the type of timeout values. Signed-off-by: VAMSHI GAJJELA <vamshigajjela@google.com> --- v3: - updated description v2: - unsigned long instead of unsigned int - added () after function name in short log - updated description include/linux/serial_core.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On Thu, Oct 26, 2023 at 07:26:28PM +0530, Vamshi Gajjela wrote: > From: VAMSHI GAJJELA <vamshigajjela@google.com> Please use lower case letters like I think you mean to? Also, where are patches 1/3 and 2/3 of this series? I can't do anything without them as well. > The function uart_fifo_timeout() returns an unsigned long value, which > is the number of jiffies. Therefore, change the variable timeout in the > function uart_poll_timeout() from int to unsigned long. > Change the return type of the function uart_poll_timeout() from int to > unsigned long to be consistent with the type of timeout values. > > Signed-off-by: VAMSHI GAJJELA <vamshigajjela@google.com> > --- > v3: > - updated description > v2: > - unsigned long instead of unsigned int > - added () after function name in short log > - updated description > > include/linux/serial_core.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h > index bb6f073bc159..6916a1d7e477 100644 > --- a/include/linux/serial_core.h > +++ b/include/linux/serial_core.h > @@ -773,9 +773,9 @@ static inline unsigned long uart_fifo_timeout(struct uart_port *port) > } > > /* Base timer interval for polling */ > -static inline int uart_poll_timeout(struct uart_port *port) > +static inline unsigned long uart_poll_timeout(struct uart_port *port) > { > - int timeout = uart_fifo_timeout(port); > + unsigned long timeout = uart_fifo_timeout(port); > > return timeout > 6 ? (timeout / 2 - 2) : 1; So we are now doing 64bit math? Did that just make things slower? What bug is this actually fixing? How have you tested this to verify it works? thanks, greg k-h
On Fri, 27 Oct 2023, Greg Kroah-Hartman wrote: > On Thu, Oct 26, 2023 at 07:26:28PM +0530, Vamshi Gajjela wrote: > > From: VAMSHI GAJJELA <vamshigajjela@google.com> > > Please use lower case letters like I think you mean to? > > Also, where are patches 1/3 and 2/3 of this series? I can't do anything > without them as well. > > > The function uart_fifo_timeout() returns an unsigned long value, which > > is the number of jiffies. Therefore, change the variable timeout in the > > function uart_poll_timeout() from int to unsigned long. > > Change the return type of the function uart_poll_timeout() from int to > > unsigned long to be consistent with the type of timeout values. > > > > Signed-off-by: VAMSHI GAJJELA <vamshigajjela@google.com> > > --- > > v3: > > - updated description > > v2: > > - unsigned long instead of unsigned int > > - added () after function name in short log > > - updated description > > > > include/linux/serial_core.h | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h > > index bb6f073bc159..6916a1d7e477 100644 > > --- a/include/linux/serial_core.h > > +++ b/include/linux/serial_core.h > > @@ -773,9 +773,9 @@ static inline unsigned long uart_fifo_timeout(struct uart_port *port) > > } > > > > /* Base timer interval for polling */ > > -static inline int uart_poll_timeout(struct uart_port *port) > > +static inline unsigned long uart_poll_timeout(struct uart_port *port) > > { > > - int timeout = uart_fifo_timeout(port); > > + unsigned long timeout = uart_fifo_timeout(port); > > > > return timeout > 6 ? (timeout / 2 - 2) : 1; > > So we are now doing 64bit math? Did that just make things slower? That divide with a constant 2 though so I'd expect compiler to turn it into a shift. > What bug is this actually fixing? How have you tested this to verify it > works? AFAIK this doesn't fix anything because emptying when measured in jiffies isn't that big number. It's just about making the types more consistent.
On Fri, Oct 27, 2023 at 11:19:26AM +0300, Ilpo Järvinen wrote: > On Fri, 27 Oct 2023, Greg Kroah-Hartman wrote: > > > On Thu, Oct 26, 2023 at 07:26:28PM +0530, Vamshi Gajjela wrote: > > > From: VAMSHI GAJJELA <vamshigajjela@google.com> > > > > Please use lower case letters like I think you mean to? > > > > Also, where are patches 1/3 and 2/3 of this series? I can't do anything > > without them as well. > > > > > The function uart_fifo_timeout() returns an unsigned long value, which > > > is the number of jiffies. Therefore, change the variable timeout in the > > > function uart_poll_timeout() from int to unsigned long. > > > Change the return type of the function uart_poll_timeout() from int to > > > unsigned long to be consistent with the type of timeout values. > > > > > > Signed-off-by: VAMSHI GAJJELA <vamshigajjela@google.com> > > > --- > > > v3: > > > - updated description > > > v2: > > > - unsigned long instead of unsigned int > > > - added () after function name in short log > > > - updated description > > > > > > include/linux/serial_core.h | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h > > > index bb6f073bc159..6916a1d7e477 100644 > > > --- a/include/linux/serial_core.h > > > +++ b/include/linux/serial_core.h > > > @@ -773,9 +773,9 @@ static inline unsigned long uart_fifo_timeout(struct uart_port *port) > > > } > > > > > > /* Base timer interval for polling */ > > > -static inline int uart_poll_timeout(struct uart_port *port) > > > +static inline unsigned long uart_poll_timeout(struct uart_port *port) > > > { > > > - int timeout = uart_fifo_timeout(port); > > > + unsigned long timeout = uart_fifo_timeout(port); > > > > > > return timeout > 6 ? (timeout / 2 - 2) : 1; > > > > So we are now doing 64bit math? Did that just make things slower? > > That divide with a constant 2 though so I'd expect compiler to turn it > into a shift. Hopefully :) > > What bug is this actually fixing? How have you tested this to verify it > > works? > > AFAIK this doesn't fix anything because emptying when measured in jiffies > isn't that big number. It's just about making the types more consistent. Ah, ok, I'll wait for a proper version to be sent as I obviously can't take it like-this. thanks, greg k-h
On Fri, Oct 27, 2023 at 12:13 PM Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote: > > On Thu, Oct 26, 2023 at 07:26:28PM +0530, Vamshi Gajjela wrote: > > From: VAMSHI GAJJELA <vamshigajjela@google.com> > > Please use lower case letters like I think you mean to? Sure, I will update. > > Also, where are patches 1/3 and 2/3 of this series? I can't do anything > without them as well. 1/3 is dropped: https://lore.kernel.org/lkml/CAMTSyjqc118-by6LRHaSN7k8fOcR6K0kmYXdthPD7rqJuYOaVw@mail.gmail.com/ 2/3 is a clean up: https://lore.kernel.org/lkml/CAMTSyjpiz_LVtVAzaNpD-xThtp6sKNy-Uvkr+CaH9b10VRYD9A@mail.gmail.com/ for 2/3 waiting on response from Ilpo Järvinen > > > The function uart_fifo_timeout() returns an unsigned long value, which > > is the number of jiffies. Therefore, change the variable timeout in the > > function uart_poll_timeout() from int to unsigned long. > > Change the return type of the function uart_poll_timeout() from int to > > unsigned long to be consistent with the type of timeout values. > > > > Signed-off-by: VAMSHI GAJJELA <vamshigajjela@google.com> > > --- > > v3: > > - updated description > > v2: > > - unsigned long instead of unsigned int > > - added () after function name in short log > > - updated description > > > > include/linux/serial_core.h | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h > > index bb6f073bc159..6916a1d7e477 100644 > > --- a/include/linux/serial_core.h > > +++ b/include/linux/serial_core.h > > @@ -773,9 +773,9 @@ static inline unsigned long uart_fifo_timeout(struct uart_port *port) > > } > > > > /* Base timer interval for polling */ > > -static inline int uart_poll_timeout(struct uart_port *port) > > +static inline unsigned long uart_poll_timeout(struct uart_port *port) > > { > > - int timeout = uart_fifo_timeout(port); > > + unsigned long timeout = uart_fifo_timeout(port); > > > > return timeout > 6 ? (timeout / 2 - 2) : 1; > > So we are now doing 64bit math? Did that just make things slower? > > What bug is this actually fixing? How have you tested this to verify it > works? > > thanks, > > greg k-h
On Fri, 27 Oct 2023, VAMSHI GAJJELA wrote: > On Fri, Oct 27, 2023 at 12:13 PM Greg Kroah-Hartman > <gregkh@linuxfoundation.org> wrote: > > > > On Thu, Oct 26, 2023 at 07:26:28PM +0530, Vamshi Gajjela wrote: > > > From: VAMSHI GAJJELA <vamshigajjela@google.com> > > > > Please use lower case letters like I think you mean to? > Sure, I will update. > > > > Also, where are patches 1/3 and 2/3 of this series? I can't do anything > > without them as well. > 1/3 is dropped: > https://lore.kernel.org/lkml/CAMTSyjqc118-by6LRHaSN7k8fOcR6K0kmYXdthPD7rqJuYOaVw@mail.gmail.com/ > 2/3 is a clean up: > https://lore.kernel.org/lkml/CAMTSyjpiz_LVtVAzaNpD-xThtp6sKNy-Uvkr+CaH9b10VRYD9A@mail.gmail.com/ > for 2/3 waiting on response from Ilpo Järvinen I didn't realize you were waiting for some input. You can do that rename if you want. Now that I looked again that patch, I was considering that perhaps the local frame_time variable could also be dropped in that function.
On Fri, Oct 27, 2023 at 07:28:12PM +0530, VAMSHI GAJJELA wrote: > On Fri, Oct 27, 2023 at 12:13 PM Greg Kroah-Hartman > <gregkh@linuxfoundation.org> wrote: > > > > On Thu, Oct 26, 2023 at 07:26:28PM +0530, Vamshi Gajjela wrote: > > > From: VAMSHI GAJJELA <vamshigajjela@google.com> > > > > Please use lower case letters like I think you mean to? > Sure, I will update. > > > > Also, where are patches 1/3 and 2/3 of this series? I can't do anything > > without them as well. > 1/3 is dropped: > https://lore.kernel.org/lkml/CAMTSyjqc118-by6LRHaSN7k8fOcR6K0kmYXdthPD7rqJuYOaVw@mail.gmail.com/ > 2/3 is a clean up: > https://lore.kernel.org/lkml/CAMTSyjpiz_LVtVAzaNpD-xThtp6sKNy-Uvkr+CaH9b10VRYD9A@mail.gmail.com/ > for 2/3 waiting on response from Ilpo Järvinen But I see no threading of anything here, please submit things so that we have a chance to know what is going on. What would you do if you got a patch that only said 3/3 to review? thanks, greg k-h
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index bb6f073bc159..6916a1d7e477 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -773,9 +773,9 @@ static inline unsigned long uart_fifo_timeout(struct uart_port *port) } /* Base timer interval for polling */ -static inline int uart_poll_timeout(struct uart_port *port) +static inline unsigned long uart_poll_timeout(struct uart_port *port) { - int timeout = uart_fifo_timeout(port); + unsigned long timeout = uart_fifo_timeout(port); return timeout > 6 ? (timeout / 2 - 2) : 1; }