Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp941541rdb; Wed, 6 Dec 2023 04:37:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IHZOd9ShpqvZs+oMfuUKddAT9BNJaCSFPxRMz+7zDhnss6AzicT8vZ1tw01VlXuJ1LG0aD0 X-Received: by 2002:a05:6358:7e8b:b0:16d:bbe2:d4f9 with SMTP id o11-20020a0563587e8b00b0016dbbe2d4f9mr949198rwn.4.1701866256030; Wed, 06 Dec 2023 04:37:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701866255; cv=none; d=google.com; s=arc-20160816; b=Ywro87eAiv2uocoawjXZhD/ZUQPv27xi7lJPx7oX2tyvFRPckt9W2viIQc/vx1m4HY TZKXvbYiCdHLmnXSDW/Gp0gHqTkoCukJvH1XnPacXjULbcZXHjObCdJrIqw4hLBLYMYR MZ9KSouJ+9Fx3ItSUEptB8TE9oMvYr5rO/+2dzxmbB43lcc+efmOPG/EOAD/muctgEed 28n7DoeaZoNdGYWF4OwRZcHKL6xe4zphdJhZz3jrfm8q2aXr+fnX+JgFrqi+s3pvXvU3 8qk6nwD8/La+C3ok8Lb7MGLYm3PI2EGDOg8qdLQfH7HBLo5w/VqvRwQ9dbT73pSwRK3N jP4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=vUWzo2mwEay9Yo3CJVR1tizyLprTJoRzT2o1RccfPhI=; fh=zJrK3BEvIbNibf9qiAWXud+d9fWCUY4mb+heoComI5s=; b=W3VB7Yvur7Uxgbx27ancLAPTR9lfBW/Dwi2bVecgqlgu1crFNPvmtXn0V+iDL9L3fE lhOrduy5J463bdUcD+aKTvsb8YhvvxCJLTMBGfdRfy5jN8Yis+6ettVVl5Zh5oLBp0mm YL8+z+NbpLE/C1f+MhVJbP8SKbYSY0JM7d0ggyiya4r5M5zioHEIfOQ+kSJXqlAysPUz bXNjiEm3sYv1MlXRvxGOXVqEmyP5eaVRu8Z5wiHBvFzx70AJMJ1isffVQzzg3PL3TVBd 3uuKOE/9z87hHxksOuDUUWjgyJLxLdjBBiDI8t8cg5INCrwjsQ2ntR3HtZZcCGGa6OLw 40XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RcwhKY5d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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. [23.128.96.31]) by mx.google.com with ESMTPS id u21-20020a62ed15000000b006ce980c788esi735539pfh.309.2023.12.06.04.37.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 04:37:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RcwhKY5d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 AEBD080E3419; Wed, 6 Dec 2023 04:37:33 -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 S1378319AbjLFMhS (ORCPT + 99 others); Wed, 6 Dec 2023 07:37:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377925AbjLFMhR (ORCPT ); Wed, 6 Dec 2023 07:37:17 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07547D1 for ; Wed, 6 Dec 2023 04:37:24 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0D26C433C9; Wed, 6 Dec 2023 12:37:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701866243; bh=rpE8tUM2R/1vhSlb7IqgfgIczGVZAD4AZUaewUYEnhI=; h=From:To:Cc:Subject:Date:From; b=RcwhKY5dkx9Ra+6ZK+fh2xWlEwOwFl2Uw0B/m5v5ovvziWI3hRlO9ai6VnyxAbMvD czgNL9W6WnTLezAjG9C7ktlYhjZ0/Ys3rIq1JVuCXEMozsspQiGWGP+Zt7lm7UZ6HD 5stWmarfaqI1ioZHFJ/tfzfiQ6xm6Kdj8oT2wP088PshaGGDfeIp/aUSmPqUnomUTl XGIWpnhbLg4QoHCyyFEju904l8+NQHc0fnTom+IW+jXMUC++rq+YnUJ+PtuHQssq5l IlMwmyO993Kzr7qSwhLocupRq+e3c4wDXWG6yb2mMUBzrvJDIm9KoV2yw80+hqR3RS ARURZ/fpvvO5g== From: Arnd Bergmann To: Bjorn Andersson Cc: Arnd Bergmann , Andy Gross , Konrad Dybcio , Stephen Boyd , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] soc: qcom: stats: fix 64-bit division Date: Wed, 6 Dec 2023 13:37:06 +0100 Message-Id: <20231206123717.524009-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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]); Wed, 06 Dec 2023 04:37:33 -0800 (PST) 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 --- 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