Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1729833rdb; Thu, 7 Dec 2023 07:22:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IFgZAiJhJ9qAD/GKMZcsfy0jTeL4y7en7YzD8EE+7PmTwJ3sWCPlbPEjeABg0VIYIo0J5LV X-Received: by 2002:a17:90b:796:b0:288:966e:bd02 with SMTP id l22-20020a17090b079600b00288966ebd02mr1262284pjz.60.1701962534958; Thu, 07 Dec 2023 07:22:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701962534; cv=none; d=google.com; s=arc-20160816; b=tGHccZmdFG9oc0TacqGx/031UFilzXW3x69xee8EA8c3ho+gf9N7HY2Ezq9/w2xB7N r/7Wk2qiYYKAZkVOOC9NOd63qBxk0/jwzwtdcJ0fREP0DHNIwCWdvtUHTZr1JJaEUkYQ Tr80nH/S2o2lxFN3sjzE7hJdOgmZ3ddbl4fuSIxFajX8f2hO2qbTwoE49eStyh0z4lYy VuxzpDIC3TaDGFlx1do35h1arYyMrfwRou7BY37Luaj2Dr+7cA5d7QRYfWdbSB/58a7j 10Y5m0O0I98ln5wNBGL2n+IxuXz5udUdscKBO8zisin1YGPkSm0LZkZ3NZnL804sdnhh oi/w== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6z3UVCES9xsAX95L+SD4RaRt6INE/iSDNBrN1LnmMbg=; fh=5UkCiBgKDLxYFV7bPsYL1d4au1HFj2WsBuHP6gCi2cg=; b=rxkO2zHqpE90JyJ4gN93ICQcQqh+ELUwtckCipdx07ZFgoQYGpkae2F/DM8zKWaPpe Sys+vnTwvkbtbht3i6OxD4pRfOFsqVH1GHA5JagZOPJDDZL2i3O1W95sQ5n1nzKyBcgr PDJML5cIK6uDoYKk6OMGBUjFSgweka2jOCa5fIcM46QdKzfyHxOG81EE6NXXMC/aX02b xiiMWuVGxs8Gb+TXw2rzLCvBdVf8aLifc6EK+rHrGims6xfRECIA6kWnHq7HopwG6sST t0CTLXEkjMk7aEZ8toZx6FPVWR/4edXrvAmY/PM+4RBviPVX1cF8xTiX/bgMP+SO/kND J6mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nl4nnvV1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id n37-20020a634d65000000b005c623a19e63si1289571pgl.721.2023.12.07.07.22.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 07:22:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nl4nnvV1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 8B1D680ABFDE; Thu, 7 Dec 2023 07:21:56 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443464AbjLGPVj (ORCPT + 99 others); Thu, 7 Dec 2023 10:21:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443499AbjLGPVY (ORCPT ); Thu, 7 Dec 2023 10:21:24 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71E07172C for ; Thu, 7 Dec 2023 07:21:25 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 666D2C433C7; Thu, 7 Dec 2023 15:21:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701962485; bh=45oamiijKSCLo/ORgchi/hZLvxifeiPsd9EiBfcYapY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nl4nnvV1kl1BSDZ7fxNw0ZxUEEQYqDk2GC8ePLDfhpOLnqk232ExGKGTZoHR2iu2h mUi+1APpDklkWy0hnjB/CTAvWErmWSE2onSCMeK9zOf6OhRwhA/Miyne1hpAFX9d9l YoYGddItHTDhWd/0amtZyrjGEPsGq1UDXtlln7FSZKyEJdIJ8zrrrARM+D4RAdD3/0 VMeUBzSvycUy3PSEACzl01++jkbxDockEjjiUKA0h+pmI8/bNRYF3v/9X0goDdX7jx 5LPmKCZFRgFpEImh9n1cbasp+zD/xwN6bGv9oQzLNz7ZWSMJDn2cL3A648N5OvtYxN 7JldAj5D9w5sg== Date: Thu, 7 Dec 2023 07:24:43 -0800 From: Bjorn Andersson To: Arnd Bergmann Cc: Arnd Bergmann , Andy Gross , Konrad Dybcio , Stephen Boyd , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] soc: qcom: stats: fix 64-bit division Message-ID: <57aatyq7y62uocvm76hucgr7zbwu2q573iq5miuua7n4rd4wjm@6fbsuryxo55s> References: <20231206123717.524009-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231206123717.524009-1-arnd@kernel.org> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Thu, 07 Dec 2023 07:21:56 -0800 (PST) On Wed, Dec 06, 2023 at 01:37:06PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > Unguarded 64-bit division is not allowed on 32-bit kernels because this > is very slow. The result of trying anyway is a link failure: > > arm-linux-gnueabi-ld: drivers/soc/qcom/qcom_stats.o: in function `qcom_ddr_stats_show': > qcom_stats.c:(.text+0x334): undefined reference to `__aeabi_uldivmod' > > As this function is only used for debugging and not performance critical, > rewrite it to use div_u64() instead. ARCH_TIMER_FREQ is a multiple of > MSEC_PER_SEC anyway, so there is no loss in precisison. > > Fixes: e84e61bdb97c ("soc: qcom: stats: Add DDR sleep stats") > Signed-off-by: Arnd Bergmann I had [1] lined up already, but hadn't pushed the branch out out... Like your version better, so dropping mine. [1] https://lore.kernel.org/all/20231205-qcom_stats-aeabi_uldivmod-fix-v1-1-f94ecec5e894@quicinc.com/ Thanks, Bjorn > --- > drivers/soc/qcom/qcom_stats.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/soc/qcom/qcom_stats.c b/drivers/soc/qcom/qcom_stats.c > index 4763d62a8cb0..5ec8a754b22b 100644 > --- a/drivers/soc/qcom/qcom_stats.c > +++ b/drivers/soc/qcom/qcom_stats.c > @@ -221,7 +221,7 @@ static int qcom_ddr_stats_show(struct seq_file *s, void *unused) > > for (i = 0; i < ddr.entry_count; i++) { > /* Convert the period to ms */ > - entry[i].dur = mult_frac(MSEC_PER_SEC, entry[i].dur, ARCH_TIMER_FREQ); > + entry[i].dur = div_u64(entry[i].dur, ARCH_TIMER_FREQ / MSEC_PER_SEC); > } > > for (i = 0; i < ddr.entry_count; i++) > -- > 2.39.2 >