From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EF725C27C79 for ; Mon, 17 Jun 2024 10:29:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DmSEyiY1/tUU8t4+5nYLYjOn8Nj8PdsCn24MTiYR5Qg=; b=Am2reJ1Va/g6DTDJpZjl2Ckp9p kAwqj0MospmbKZdqbqNk5z6eSYubOpbNX/cBmFgCPFaK6tjZL2VJqL+ZfMFoLxdbc5vIlyl2QWYOv kPmP0PFlDFTpogc86aV63McQ7aodELokXfjHOWSYyEX7IGnBmpsiWgIgzsCw8xTHAtOpFTSy0VYl+ buSqnYJJF2lAT/MzCZGrkHD+gBMdZbTK4lUp8ydgS/wLKl5jtqtJMA25oE8LImtnoZTFKH7LJj/2w 7Eh/JW34TzQDvm+abMDGxmRhPhnL91vCKLVUXv2kIDm0Mt/8yhncj5xkqVf6BNuM89RaBFcB5zhZd uVn2eSYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJ9bq-0000000AG2j-1aGw; Mon, 17 Jun 2024 10:29:10 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJ9bo-0000000AG29-1ozq for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 10:29:09 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 04B6B60F78; Mon, 17 Jun 2024 10:29:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C14F0C2BD10; Mon, 17 Jun 2024 10:29:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718620146; bh=h8m6K47SfYhgo2FbakEfctLP6IJiz9PoDGqcI9Lpx78=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DScFnxttQ9z8aIToFh5M30yf9Y2aVWUOrwvezwqPtrmd5T7Je4ggNXYj5XH7gnjFd 6mUxzvzXAmVSUFtS1c5rCVSXH3B4EZXDs/wSo++DAPc4i3poRJxn4zJvOncv5qPvdn PNU/kGlx/1DVsSDLSeSgnwG5ZugUvev8w3EY+K9/z3rqBSWvTqi8tl4evbyYT/gR5+ 5GhMDJ/9YfmJ5LesDvu6jemo2bA4784rqu1oVYikSaLJju4R/lhvD52LVdWzdtjfTl UuLItxoWpGXyNrQY36pgZkz7Eu3iX5ANCMWeNwIJb68r+I1TFmXin9CSGHrnRDGI+d z0JQUr6XduYQA== Date: Mon, 17 Jun 2024 11:29:01 +0100 From: Simon Horman To: xiaolei wang Cc: olteanv@gmail.com, linux@armlinux.org.uk, alexandre.torgue@foss.st.com, andrew@lunn.ch, joabreu@synopsys.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com, wojciech.drewek@intel.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [net PATCH] net: stmmac: No need to calculate speed divider when offload is disabled Message-ID: <20240617102901.GO8447@kernel.org> References: <20240614081916.764761-1-xiaolei.wang@windriver.com> <20240615144747.GE8447@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_032908_556387_28C8432C X-CRM114-Status: GOOD ( 13.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, Jun 16, 2024 at 09:15:05AM +0800, xiaolei wang wrote: > > On 6/15/24 22:47, Simon Horman wrote: > > On Fri, Jun 14, 2024 at 04:19:16PM +0800, Xiaolei Wang wrote: ... > > /* Final adjustments for HW */ > > value = div_s64(qopt->idleslope * 1024ll * ptr, port_transmit_rate_kbps); > > priv->plat->tx_queues_cfg[queue].idle_slope = value & GENMASK(31, 0); > > > > value = div_s64(-qopt->sendslope * 1024ll * ptr, port_transmit_rate_kbps); > > priv->plat->tx_queues_cfg[queue].send_slope = value & GENMASK(31, 0); > > > > And the div_s64() lines above appear to use > > ptr uninitialised in the !qopt->enable case. > > Oh, when deleting the configuration, idleslope and sendslope are both 0, do > you mean we also need to set ptr to 0? Understood, if idleslope and sendslope are 0, then ptr could be set to any value and the result would be the same. And, based on my limited understanding, 0 does not seem to be a bad choice. My point is that ptr shouldn't be uninitialised at this point. ...