From patchwork Tue Nov 3 09:05:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Luba X-Patchwork-Id: 11876359 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BB48C2D0A3 for ; Tue, 3 Nov 2020 09:07:13 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B324920756 for ; Tue, 3 Nov 2020 09:07:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kV6p0hS9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B324920756 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=0nCzuKaT2M1fOFhlI6kZpalM1PYUocBOcOWiO6K3Xiw=; b=kV6p0hS9EqhXFc++nAO/YkF9zW 8+PjSuUA9N/avoKCrCVozkLe7yhYluM0x2T0IiwLuVdxKh32nsvPT6jDs5Ky1Fmpjof7jUh1+OxFi Jtml02O2MCN3uXJHIY401SfZXRoSNHMYuVQcdpWXmUT2RjA6TZqd3OFz2qlxPfdTW50btwWlx617E d44Kdu5v5FjqFdrtRV/F2vQ95ENZay+RUsbolNFI4CjDVu5HKfY6A1It3GlVb4QvjUwxWv0KygX8q ybJLhm2T3zf21XB+lRyREjAux0p2FIFDVLeJi4YvGE3OIRLwIidt/ZK+Pqs0wqVqpZYjKdBReEO6s msIFlXyw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kZsGm-00020T-3X; Tue, 03 Nov 2020 09:06:28 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kZsGh-0001yF-DR for linux-arm-kernel@lists.infradead.org; Tue, 03 Nov 2020 09:06:20 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C7A63139F; Tue, 3 Nov 2020 01:06:15 -0800 (PST) Received: from e123648.arm.com (unknown [10.57.19.30]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 538693F719; Tue, 3 Nov 2020 01:06:11 -0800 (PST) From: Lukasz Luba To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 0/4] Clarify abstract scale usage for power values in Energy Model, EAS and IPA Date: Tue, 3 Nov 2020 09:05:56 +0000 Message-Id: <20201103090600.29053-1-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201103_040619_553787_207454CA X-CRM114-Status: GOOD ( 12.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nm@ti.com, rafael@kernel.org, daniel.lezcano@linaro.org, rnayak@codeaurora.org, corbet@lwn.net, sboyd@kernel.org, viresh.kumar@linaro.org, mka@chromium.org, amitk@kernel.org, dianders@chromium.org, morten.rasmussen@arm.com, robh+dt@kernel.org, sudeep.holla@arm.com, qperret@google.com, Dietmar.Eggemann@arm.com, lukasz.luba@arm.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi all, The Energy Model supports power values expressed in an abstract scale. This has an impact on Intelligent Power Allocation (IPA) and should be documented properly. Kernel sub-systems like EAS, IPA and DTPM (new comming PowerCap framework) would use the new flag to capture potential miss-configuration where the devices have registered different power scales, thus cannot operate together. There was a discussion below v2 of this patch series, which might help you to get context of these changes [2]. The agreed approach is to have the DT as a source of power values expressed always in milli-Watts and the only way to submit with abstract scale values is via the em_dev_register_perf_domain() API. Changes: v4: - change bool to int type for 'miliwatts' in struct em_perf_domain (suggested by Quentin) - removed one sentence from patch 2/4 in IPA doc power_allocator.rst (suggested by Quentin) - added reviewed-by from Quentin to 1/4, 3/4, 4/4 patches v3 [3]: - added boolean flag to struct em_perf_domain and registration function indicating if EM holds real power values in milli-Watts (suggested by Daniel and aggreed with Quentin) - updated documentation regarding this new flag - dropped DT binding change for 'sustainable-power' - added more maintainers on CC (due to patch 1/3 touching different things) v2 [2]: - updated sustainable power section in IPA documentation - updated DT binding for the 'sustainable-power' v1 [1]: - simple documenation update with new 'abstract scale' in EAS, EM, IPA Regards, Lukasz Luba [1] https://lore.kernel.org/linux-doc/20200929121610.16060-1-lukasz.luba@arm.com/ [2] https://lore.kernel.org/lkml/20201002114426.31277-1-lukasz.luba@arm.com/ [3] https://lore.kernel.org/lkml/20201019140601.3047-1-lukasz.luba@arm.com/ Lukasz Luba (4): PM / EM: Add a flag indicating units of power values in Energy Model docs: Clarify abstract scale usage for power values in Energy Model PM / EM: update the comments related to power scale docs: power: Update Energy Model with new flag indicating power scale .../driver-api/thermal/power_allocator.rst | 12 +++++++- Documentation/power/energy-model.rst | 30 +++++++++++++++---- Documentation/scheduler/sched-energy.rst | 5 ++++ drivers/cpufreq/scmi-cpufreq.c | 3 +- drivers/opp/of.c | 2 +- include/linux/energy_model.h | 20 ++++++++----- kernel/power/energy_model.c | 26 ++++++++++++++-- 7 files changed, 80 insertions(+), 18 deletions(-)