Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1067648rdh; Fri, 27 Oct 2023 04:02:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJswQrhCf1pSeSpudqva5e1/WbL4t5zbmGuh1ndvJmRGVgcv1X0fxcAzkj0h+o6wU1L2kP X-Received: by 2002:a05:6830:1e8f:b0:6bd:d14:147a with SMTP id n15-20020a0568301e8f00b006bd0d14147amr2324124otr.21.1698404525139; Fri, 27 Oct 2023 04:02:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698404525; cv=none; d=google.com; s=arc-20160816; b=jJQjKVKvYReYHvIBPjZV5VWF7AM0AOltw8MLigO705UQafqyemUVrtJC8u11hDlivE DFYNqGdaZmBjNgwCWFTcTvsI08NyvSPfb+/nkqmUbVL3rFAokUDWatQKB7KARm/l2WR7 dEzQ61tCMSwWa7nzVRUYb3LdjEWI0127CoJ9/ZQb/gspzUi7VG3BdcAuOui54lybQID9 bsGfvLn47xpcu4nDAvwzlkLbXZH3kvNtXE6qYFK+yg1u2EmTunRnXrmPSI1fFSkKf91e 8TzEuX3fdJj4RSGploF6Cj49JH3WmL19MY6JeWqP2uIw6xVY/rr+8QRHqoUh4+QF4T5L LRlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=cqY65ewHNCiGaOMxfWh5PGDR2twdefgqO6bZ82sIRPg=; fh=CQeAMmBBTXiNGCkV8so2tGf8vdSjfYJ0db7jgI0GUhw=; b=WjPI+li19o7mDCcQpc48SXXwKjHiqbgsd6nV2QBTD6lo89+yWaBavxT4/WaKqVQIr5 Oa6bzhkL5c5ZTHhGeWGd0BAfB/kskC9rIkzcHDt4w82Vai6wneQVdbfAyiqfSBZHlwqU 70Hzq838jrVnG/xROzlpw1uHig056ULuYH5QqGlmRlnINuvRN/emBBSNX1AEgwzOf+bO Bnaqd1ewLyOiQ/KQaz4hJYGiQE0vUmx8c6irzLMI2ujZHW74hMkiBbLwR+x1Z3rG9qM0 tW8jxXRXlFYZt+wXG7WqAFG9ea8LyObzUJpnNl9eyCkYTRENGPr7vaOG0OS3i86iPgvg PjCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cJUXesXS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id w3-20020a0ded03000000b005a2248bbdd9si1744316ywe.487.2023.10.27.04.02.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 04:02:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cJUXesXS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 4F836806E558; Fri, 27 Oct 2023 04:01:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231759AbjJ0LBR (ORCPT + 99 others); Fri, 27 Oct 2023 07:01:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231493AbjJ0LBP (ORCPT ); Fri, 27 Oct 2023 07:01:15 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71452194; Fri, 27 Oct 2023 04:01:13 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78592C433C7; Fri, 27 Oct 2023 11:01:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1698404473; bh=fo/rUXgDjTxBbkKJ2TCB2u4T9XooXAgroVyEUw22fOk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cJUXesXSq2hAhGnCykcZJshduWF/zMlmm+472mtKTo8zwcOUxJyQGAdcqk6kaS0K7 JYWQ1nidcPg6vPggvF0TO1z6M/FGpGcMEVxu5Bm+PxgKngfzfy+Q1ylIvUCc+dUyIV 3sac4vNlcRRvBujo3+jQxm1TqKoN8xcpsNXo2FNs= Date: Fri, 27 Oct 2023 13:01:10 +0200 From: Greg Kroah-Hartman To: Ilpo =?iso-8859-1?Q?J=E4rvinen?= Cc: Vamshi Gajjela , Jiri Slaby , linux-serial , LKML , manugautam@google.com, Subhash Jadavani , Channa Kadabi Subject: Re: [PATCH v3 3/3] serial: core: Update uart_poll_timeout() function to return unsigned long Message-ID: <2023102738-sandpaper-renovator-3afe@gregkh> References: <20231026135628.2800617-1-vamshigajjela@google.com> <2023102712-frolic-bush-3d67@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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, 27 Oct 2023 04:01:34 -0700 (PDT) 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 > > > > 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 > > > --- > > > 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