Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13748090pxu; Mon, 4 Jan 2021 03:26:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/ihL1ATVFPoXuOQ85sQuPLV3fuVrkoqbGOf29l2KdXwTHVv57BvG+5JaC9zotTVrlGDIQ X-Received: by 2002:a17:906:cd14:: with SMTP id oz20mr61709269ejb.99.1609759570053; Mon, 04 Jan 2021 03:26:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609759570; cv=none; d=google.com; s=arc-20160816; b=n1z31NK8uX6X8t/m53c8TLqaulQDzDqf26eB1FHU4GTiW25yRqHc83Fgn/WQwHQC0S IN5F7+ATw6seGJV+dUx1wV/jbesJxktksWa84s/C76RW6OiNlhYpyT8L661RaaohMZAq djdS7aIcwScp7hAVoPE8S8qPKf2MClOYI92yM01aiD0mRbuY3neiewXvSy5QMejmdwtF ETBfCHs8/V5saLE3i5K4zSbcljCQc3sYgZVXpM7AOo9sk7n07Maxl94Buequ3AyLDzvV 7WchuSZtNxZFOf9PdGfvSGhN4LyICOZoMQdshEhteNadz24wSaTsRagn7DeE9zcB5maL tEHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=MZWKWB6DR6hNDrsfU5p9DwYo2p/txd/B82NQ7fAKCkU=; b=MdLJp3pSNsat/C7k2pbK637y3aDpHczkBNRRW3eGKIM/PRtD9k1rWwUosxho9VpQrv aidIWvUvcg6N3c/S0K6REpcF6pJD1GxSTv3aMDRhdhyyLO1tZRhSKGam99LrcrZ+c0R2 vhTkGiS2xXMkJCcYvsnPWWqh9VU6I2uXbams1pN71RvIXZD7Xx50RqBwMnk8/MJObAEi 6TIgY+kx8jr0q6yqty5xo33ZVNV4egqtvr7uiS6qcnxLIo8/5nFBHVM1X5nVsepYmRBp RRdlec6a/FmAHa3sLArt7WX2YhnZ8xSaJCjd5z4bBT3NDeScUaEwFqf6upp+dSSGX5/n sx+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nl9r27QN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 1si32905338edv.426.2021.01.04.03.25.47; Mon, 04 Jan 2021 03:26:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nl9r27QN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726564AbhADLVe (ORCPT + 99 others); Mon, 4 Jan 2021 06:21:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726234AbhADLVe (ORCPT ); Mon, 4 Jan 2021 06:21:34 -0500 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15B12C061798 for ; Mon, 4 Jan 2021 03:20:38 -0800 (PST) Received: by mail-ed1-x531.google.com with SMTP id u19so26962750edx.2 for ; Mon, 04 Jan 2021 03:20:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=MZWKWB6DR6hNDrsfU5p9DwYo2p/txd/B82NQ7fAKCkU=; b=nl9r27QNZY4Nj976rgvuCPiFY8wmes/BZl9umicY7cdV5Fxo65af2BrZmdHzWXIobt oOIWzDwmZlzJ+VLUWsqIfQpqc6bGiZgUeqKQz+cSyvdruBb3tLxfz2mX5cjngPL00izA jKU+EP+gmt7AU7mKPsjiYsvEGXM4g6KcOpVKz5FfcnjWpqdCKjcXmU5XvQhBC59tGcVA sFXHAd1mGsSXug2gdh18mC7rN85u6D5jxHebdmrMg5cJ4ZQCom4WaIouYIyB+huraAHb mnknX2v4ZX85PGB6N3r8QKcP0KJItnyVdKr8S4V4Kf6GeqLKrYMRGdE+L8A9grpgXzQe qyyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MZWKWB6DR6hNDrsfU5p9DwYo2p/txd/B82NQ7fAKCkU=; b=s78rygJ3iEOr2Mw9nihCDIMtP8k0ERRHpamp0kDkpd7rXrAoK1+D1CGviLwj9+9jyP kTfAqn3NApXZEC8S34TsnW1hS7t5ZtD/6gfVIfdQaMuVCYrBfOhSBwpuMfJnrDbxLVwW jf5CHoVTMvfgjmfwcMzuT48LHQ3S+mUHd12RWn0SSpRorXWmhiVRFhOVPgIXDni1Cm6w Qoh8a5/ZdaxMXDfFioC3vA2xy+Q8TsqrVGIC+6LfLF7sLDAUS6uNL9rW0aQ/Xgd7Wpms rRq3dftmQt4t+cXYrrkIG6WkziK4Gwl0CjMNK8OIoLIVoediZBO5hvzvg3h3LBxC12Xy 1j4g== X-Gm-Message-State: AOAM5309cLiOjnCizIZYr7Hdk33eArmLPK+lqsw+/C5a8iUulHWbUNnY nbEVGaa7uS2T8zMl951qEOoYH2HfB25qzA== X-Received: by 2002:a50:e84d:: with SMTP id k13mr68908071edn.154.1609759236390; Mon, 04 Jan 2021 03:20:36 -0800 (PST) Received: from [192.168.0.41] (lns-bzn-59-82-252-129-8.adsl.proxad.net. [82.252.129.8]) by smtp.googlemail.com with ESMTPSA id h16sm23360677eji.110.2021.01.04.03.20.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Jan 2021 03:20:35 -0800 (PST) Subject: Re: [PATCH] powercap/drivers/dtpm: Fix __udivdi3 and __aeabi_uldivmod unresolved symbols To: Geert Uytterhoeven Cc: "Rafael J. Wysocki" , Linux PM list , ACPI Devel Maling List , kernel test robot , "Rafael J. Wysocki" , open list References: <20201230153744.15612-1-daniel.lezcano@linaro.org> From: Daniel Lezcano Message-ID: Date: Mon, 4 Jan 2021 12:20:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert, On 04/01/2021 09:18, Geert Uytterhoeven wrote: > Hi Daniel, > > On Wed, Dec 30, 2020 at 4:39 PM Daniel Lezcano > wrote: >> 32 bits architectures do not support u64 division, so the macro >> DIV_ROUND_CLOSEST is not adequate as the compiler will replace the >> call to an unexisting function for the platform, leading to an >> unresolved symbols. >> >> Fix this by using the compatible macros: >> >> DIV64_U64_ROUND_CLOSEST and DIV_ROUND_CLOSEST_ULL. >> >> Reported-by: kernel test robot >> Signed-off-by: Daniel Lezcano > > Thanks for your patch! > >> --- a/drivers/powercap/dtpm.c >> +++ b/drivers/powercap/dtpm.c >> @@ -99,8 +99,8 @@ static void __dtpm_rebalance_weight(struct dtpm *dtpm) >> pr_debug("Setting weight '%d' for '%s'\n", >> child->weight, child->zone.name); >> >> - child->weight = DIV_ROUND_CLOSEST(child->power_max * 1024, >> - dtpm->power_max); >> + child->weight = DIV64_U64_ROUND_CLOSEST( >> + child->power_max * 1024, dtpm->power_max); > > Note that 64-by-64 divisions are expensive on 32-bit platforms. > > Does dtpm.power_max need to be u64? The dtpm is based on the powercap framework which deals with microwatts and the functions are expecting u64 values. The division here happens when there is an update of the dtpm tree which occurs rarely (at boot time or hotplug). As the power model is in the vast majority on 64b platforms, the effort to optimize to u32 sounds not worth, especially that the 32b platforms supporting the energy model are now obsolete. > The (lack of) documentation for the dtpm structure does not say what is > being stored there. > > Gr{oetje,eeting}s, > > Geert > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog