Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp81286pxm; Wed, 2 Mar 2022 10:48:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/G86OgDSbTxX1GP8VZcENC+3RQXkrhl+6R7nO/vmQu7KNYt8PK4mYPSAgMrCwe5jJ0CZK X-Received: by 2002:a17:902:f54c:b0:151:4cff:3f28 with SMTP id h12-20020a170902f54c00b001514cff3f28mr21899812plf.125.1646246929633; Wed, 02 Mar 2022 10:48:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646246929; cv=none; d=google.com; s=arc-20160816; b=KlfAG1xEJ1smAcgo0YVJDkdOqcw97643MegCQw6nh7p5OYlJSEGWGfnXqssWR7kch/ LaKHytBOH6ChiKDh4uoHxduolubKLB44ssnSBDgSTLQszPk/EXw2VrUBdu8IlKy2H6x6 fpAECXwzCjUIxe3nVh5G5P8NbEsFXY9wWEc4AeEY2CFtKFiShRskwupRQv1GahHphkbd IKLrKVLMXglMzZIo9VF7BTxYVgc93/pj4v/fhJpNiunOUQg8bu0QL9qs4UOMDlZjuwwH qsPmBocLRMjzH27NPiZpm3lIvzGuUJzX4YGXwVBrh2+rBh+Q/wZBFO9sfuidXlEbpILf vxJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=+dV5Hd8VT/souB3onGwWatFwSyNzsAN6c3BD3Wh73jc=; b=IyPn0TiTG1BhKVtfe2/tQlOAh9zzCUr/n8svzcOaLRZ2esXtapm6WOUhDkzndt245h MjHp74GC5VxwUUOBey1DsjlxCwx5MCnyxuBlVC8gQsYHtYiogxTcThGceoi70CqBaNle iqOmUtvcKCOFOyFoNpDBYnLAMHdK9ZflnaWm2aKGJRk7v55gTsIxEzR/fKSR7wL25V5u fj3OhG6w7oyn4uoMmFVERNl7q9e8w0fi5Bje7N3fNeQ/z4K65mxOCnXLhawUdE24Tqmj gfQJbV10R2FOvjRvoK0zp2JnVWQ3/nuWg59t02BRxpx1sercHcDYeyJqmz9KF1lI4hDH 1JOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b2-20020a63cf42000000b0037402a10428si14433954pgj.32.2022.03.02.10.48.32; Wed, 02 Mar 2022 10:48:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239805AbiCBHCY (ORCPT + 99 others); Wed, 2 Mar 2022 02:02:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239808AbiCBHCW (ORCPT ); Wed, 2 Mar 2022 02:02:22 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BCB58B459D; Tue, 1 Mar 2022 23:01:39 -0800 (PST) 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 5A5A01424; Tue, 1 Mar 2022 23:01:39 -0800 (PST) Received: from [10.57.21.27] (unknown [10.57.21.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 605C33F73D; Tue, 1 Mar 2022 23:01:37 -0800 (PST) Message-ID: Date: Wed, 2 Mar 2022 07:01:35 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v4 3/4] OPP: Add support of "opp-microwatt" for advanced EM registration Content-Language: en-US To: Viresh Kumar Cc: linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com, rafael@kernel.org, daniel.lezcano@linaro.org, nm@ti.com, sboyd@kernel.org, mka@chromium.org, dianders@chromium.org, robh+dt@kernel.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org References: <20220301093524.8870-1-lukasz.luba@arm.com> <20220301093524.8870-4-lukasz.luba@arm.com> <20220302045301.fq6nolscdfd5wvyo@vireshk-i7> From: Lukasz Luba In-Reply-To: <20220302045301.fq6nolscdfd5wvyo@vireshk-i7> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/2/22 04:53, Viresh Kumar wrote: > On 01-03-22, 09:35, Lukasz Luba wrote: >> The Energy Model (EM) can be created based on DT entry: >> 'dynamic-power-coefficient'. It's a 'simple' EM which is limited to the >> dynamic power. It has to fit into the math formula which requires also >> information about voltage. Some of the platforms don't expose voltage >> information, thus it's not possible to use EM registration using DT. >> >> This patch aims to fix it. It introduces new implementation of the EM >> registration callback. The new mechanism relies on the new OPP feature >> allowing to get power (which is coming from "opp-microwatt" DT property) >> expressed in micro-Watts. >> >> The patch also opens new opportunity to better support platforms, which >> have a decent static power. It allows to register 'advanced' EM (based >> on real power measurements) which models total power (static + dynamic), >> so better reflects real HW. > > Advanced :( > You're right, here these words sneak in. I'm going to resent this patch because it has this reported build issue for !EM. I'll update the words there as well. BTW, for the build fix, I'm going for the v3 approach: ------------8<-------------- if (_of_has_opp_microwatt_property(dev)) { struct em_data_callback em_cb_dt = EM_DATA_CB(_get_dt_power); return em_dev_register_perf_domain(dev, nr_opp, &em_cb_dt, cpus, true); } ----------->8--------------- I don't want to introduce another dual-macro mechanism, since the type em_data_callback is not defined in !EM. I hope you are OK with this approach, if not please let me know.