Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp92628pxk; Fri, 11 Sep 2020 01:01:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzb/8JoGvbZLJXaVfkH5vFhlmNaZ9RuGa7Q3zZFDNTxGryH4psZo7bjFSS7poItin5ELVMY X-Received: by 2002:aa7:d558:: with SMTP id u24mr766609edr.336.1599811309566; Fri, 11 Sep 2020 01:01:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599811309; cv=none; d=google.com; s=arc-20160816; b=Fkx3R2IR3bqpY1fFMsleGYrtC9UqKArA841pnX9CkkbTYaY1HlmQ3oFDD0GMdcTiGE O24a9MJp9zQ322FbRUzoOeW49JNcNjmDRmkQlPvmeQ3DbZ5d62CJ4Cl263B2jxwVIbx9 I9xpsv1CrUN5qcPfSlBMh1tZiYdhD8O91thLK1lzshL/8ug06Dq3/DF2UjIh/kslCMcW zAR5ATLF4J45MDdIcYlwBF2PuWKYtckiYgWL5afTrK29/zAa/7DJPcv8Y7erLN9Wg0gF krH2JhQep6tVCcaXnLTH47waY3uphEzqROr0/JRR9l0ynZHBpUNaUjSMuf8Ekx5PxEhI DngA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=1IUSu/d3w6Wkl/EvaZBQs8+EfTzsdofYI5H0K7F7L1o=; b=jVv7ytbe622eGcYeeN5swnPoCiEEZEy64G551NIR6z5mzN8Pu4Ee+OkvMpkS3SvHXq e5hKS3Qpyyrq7eY1EkwN7yaCv4EmMetuSRhWD65Fp7D7UfvlUJzy8UWTyZvpeAQn8T+c lez/Rq626ftPn3vwGe/EMwk4XzIAHZuAXo4xXuec3ydgUZdL3mvPZ3dGgCJ1nkeX7OC4 F6vfNKsiNcYWz6jyjaM8KXixKy0jjZJe+teYf5c8sW+23fmS9bOPWWsMdSC598bWotAj ono0Q0NgpHGEb4aKB/nKE/++5ot5HwJ0gRyk/20ndeAAGqsgKkP0RNnsDXh/JRjCU9LW r0+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G8EdYaLJ; 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 s18si799543eji.593.2020.09.11.01.01.25; Fri, 11 Sep 2020 01:01:49 -0700 (PDT) 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=G8EdYaLJ; 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 S1725788AbgIKH6O (ORCPT + 99 others); Fri, 11 Sep 2020 03:58:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725786AbgIKH6I (ORCPT ); Fri, 11 Sep 2020 03:58:08 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70919C061756 for ; Fri, 11 Sep 2020 00:58:08 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id a9so3854322wmm.2 for ; Fri, 11 Sep 2020 00:58:08 -0700 (PDT) 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=1IUSu/d3w6Wkl/EvaZBQs8+EfTzsdofYI5H0K7F7L1o=; b=G8EdYaLJeEp/GI1N1GuZ1b6OOHrLRNIm7B4ikRMq59wmBHu+2vXE0NCCGTbKaI0cDY i5rmWNN/1W1pgiRv91f7fwtLZ5IFfsG+QAZlx0iFPFKz/2hPlPsZ45vmCzjdIkkMpTqJ NoIyfmZIGHoRe3/GiYdqSpTV3WBNS9cJ0AGCMY/besJr2+jj8/RUnyBXhPOv/urktqvT REJN8+U/97Lt7BmQeF2SD8v63wLxGu6X2bZObIpqpcgx2OVE4EppIo6ac0nVmnJ1M6tm cD2lfKQ5oelMZAKuX0ksH9ci/b7GXigp1ojqJSldTdfvDvdjgtkFQFpAp6IpRr6sOsPt KYNg== 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=1IUSu/d3w6Wkl/EvaZBQs8+EfTzsdofYI5H0K7F7L1o=; b=O1NTbO331nHyDCYabDRf82I2qXhKNPaYwXd6bTu4JiNvuTWg2JoG5AsuuXrQEX/PE6 CFz7Qf6/2KlR71iH4H/JJV/FUN6XyXGg88uWDKPnKTx3HYKopfafnCktR+knCbZXldKB PjeWsBFQ4B5O50hab/ytzBaiJ/pWKS8sc4GTf4NuCCTT+qPNjUsMq734kXJdmj0gtcmA MhWJX/rKOFh/Xi6F5BFm0UmLw8pzU9bs6WJNue2kJnWFFnWICkxDGtEl8578MxxoOJt5 oHclVKmwEI1zYQUfeJthTwIoGE7nsdmcwEOoGd71J60omzAIvFT7Fk5sBooOUxA5KmrH mMqQ== X-Gm-Message-State: AOAM531BTVfDYGN5VWMlp9XaFjxLQXS6pcFYV2mnh/MlR+i7LESAHc7+ cY4lZWKhdsIaYJ8ZQvW7fFqJUQ== X-Received: by 2002:a7b:cb82:: with SMTP id m2mr799532wmi.56.1599811085439; Fri, 11 Sep 2020 00:58:05 -0700 (PDT) Received: from ?IPv6:2a01:e34:ed2f:f020:d5d9:c908:efdc:8b45? ([2a01:e34:ed2f:f020:d5d9:c908:efdc:8b45]) by smtp.googlemail.com with ESMTPSA id a85sm2831561wmd.26.2020.09.11.00.58.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Sep 2020 00:58:04 -0700 (PDT) Subject: Re: [PATCH RFC] powercap/drivers/energy_model: protocode: Add powercap energy model based To: Amit Kucheria Cc: "Rafael J. Wysocki" , Lukasz Luba , Srinivas Pandruvada , Ram Chandrasekar , LKML , Linux PM list References: <20200707171457.31540-1-daniel.lezcano@linaro.org> From: Daniel Lezcano Message-ID: Date: Fri, 11 Sep 2020 09:58:04 +0200 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Amit, thanks for taking the time to review the series and read this long description. On 10/09/2020 11:48, Amit Kucheria wrote: [ ... ] >> + >> +config POWERCAP_EM >> + bool "Energy model based power capping" >> + depends on ENERGY_MODEL >> + default y > > Don't make it default ;-) Thanks for pointing this out :D [ ... ] >> + pc_package = powercap_em_register(pct, "package", pc_soc, >> + &zone_ops, 1, &constraint_ops); > > Will the soc and package hierarchy eventually be dynamically read from > devicetree or similar and these hardcoded registration removed? Yes, that's correct. > For the rest of the devices, IMO, it makes sense to use the genpd > hierarchy to reflect the powercap hierarchy. I whipped up the > following patch to show how it might be achieved. What needs to be > done is to now reflect the parent-child/sibling relationships of genpd > into powercap. Initially I thought we'd need to additional DT > properties in the genpd bindings but I think we might be able to read > the device-specific energy model data directly to populate the > powercap constraints. We need a way to describe the power constraints relationship of the domains to populate the hierarchy of the powercap directories. In the DT it may look like that (very roughly): power-constraints { power-constraint: package { compatible = "power-constraint,virtual"; }; power-constraint: perfdomain0 { compatible = "power-constraint,cpu"; device = <&cpu_l0>; parent = <&package>; }; power-constraint: perfdomain1 { compatible = "power-constraint,cpu"; device = <&cpu_b0>; parent = <&package>; }; power-constraint: gpu { compatible = "power-constraint,gpu"; parent = <&package> }; }; -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog