Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp24333imm; Tue, 7 Aug 2018 13:11:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeoTGQF09KgXeumBttryZ+aA5jn2sZs3uNkj6J+c9OeR6u05nwSBl0E8OtYtYfunwWyFigo X-Received: by 2002:a17:902:5501:: with SMTP id f1-v6mr19142501pli.219.1533672691771; Tue, 07 Aug 2018 13:11:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533672691; cv=none; d=google.com; s=arc-20160816; b=mWe0c3lhYcj1Q0J/JMqMLJhvwet1ib0pEEFECKFfd8qmjovJhVDr5yIBWihPWHq4pb tSFdZaxPP/C8T71vSX8eOhM3YXIzNnK7MYwDBE4JMNEQ84sgtuU9+4H73L2jhKtIq4EH JviHC5kE++nCOZPAIZj9jAj/vHf5zRw1GPwfZCVy4cWcDw6mogDfjYOTl7LZ+g+0NIkf wT/QKtK5TQYJ8k4+gq3ExV41SpQPhlAoUejyOGMxqQ2KC89lDibOjQchMbqG6RUJVMw/ AWMVyc5lP3fUOljc1YA0yxOMQ8ifpaZmsIwL57ole5CZHJx0gqVPSwteDhgh+6jhfIis we4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=KlmNQclzw3yI/seHXREkNrc/g3S/dtz/918YttlURoc=; b=widVKVARmFYgoxKr1Dfg0AIcbUbHrdsX0MkiAnfWkrUFZhsGRxIdYz+np9qzvQ+pas k8fzt8Cq+JjDPMhBq2Mhmgte/2J/ZIINanTsvxXyLBRO1btlR6XJ+2JvCM2QTHe3Xgnb D9BTLy+egUjZw9Xsn3B1Mu9IcsjZhTMypI+Re1rQ4CqA2uNggTybuMJ6JzoFC4ZxehOo LbcnHoqMuZjUvfdfmM1Wvkko9afxifjfZy/b1SGQXjcx6zt+7Go2FnZgQ/6SP8jEAviR JqExFpxkZvKQk/m3eASkGwMvTSvJ9shT3XXzGTDCzLnll1zGC5tIYd4hcxJW8YI/yAF/ MO5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=KgKk+UiJ; dkim=pass header.i=@codeaurora.org header.s=default header.b=WVADr44B; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w3-v6si1644402plb.197.2018.08.07.13.10.53; Tue, 07 Aug 2018 13:11:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=KgKk+UiJ; dkim=pass header.i=@codeaurora.org header.s=default header.b=WVADr44B; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390300AbeHGVxD (ORCPT + 99 others); Tue, 7 Aug 2018 17:53:03 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:55282 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725881AbeHGVxD (ORCPT ); Tue, 7 Aug 2018 17:53:03 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 6936760C54; Tue, 7 Aug 2018 19:37:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1533670628; bh=x32cLoUzAhHh4YJWWCdV+79WK7g5P0XiA3T2VC1UBXY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KgKk+UiJiBEVC1V/CCZULMgWyoQDP7mfYPWX1QdvJVvZfHX4bvvyhQWP8EAFYi+R6 Nd5FzSCXY8fAWfl7BoRs2oX1F/+UOq3FAnwMd0yTjK0p0w/d4K72rV/TpTYe8EEdaG topNS0/KGLDhICgLp/bK5qHTMzonlENZqsyy9xOU= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 4634060B1A; Tue, 7 Aug 2018 19:37:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1533670627; bh=x32cLoUzAhHh4YJWWCdV+79WK7g5P0XiA3T2VC1UBXY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=WVADr44Bv1qU3IFxSkkNp2il56ICcNThG9eg1nLUJ4tDq4iulEJjZo4hJBzyfWEoU 0HF2ARXlPWGHwyVC/kF8F0Jbs99tnai7PtBZ6C/QDvZKsz88FwrAqvH8/m60NLVvLD y40XlfVtcrCLstgSvH9la7EGZv1bQ8VBdohWoGXY= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 07 Aug 2018 12:37:07 -0700 From: skannan@codeaurora.org To: Rob Herring Cc: MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mark Rutland , georgi.djakov@linaro.org, vincent.guittot@linaro.org, daidavid1@codeaurora.org, bjorn.andersson@linaro.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/2] PM / devfreq: Generic CPU frequency to device frequency mapping governor In-Reply-To: <20180807164114.GA12587@rob-hp-laptop> References: <1533171465-25508-1-git-send-email-skannan@codeaurora.org> <20180807164114.GA12587@rob-hp-laptop> Message-ID: <496ac47a3c78f37655b60841fba7494c@codeaurora.org> X-Sender: skannan@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-08-07 09:41, Rob Herring wrote: > On Wed, Aug 01, 2018 at 05:57:41PM -0700, Saravana Kannan wrote: >> Many CPU architectures have caches that can scale independent of the >> CPUs. >> Frequency scaling of the caches is necessary to make sure the cache is >> not >> a performance bottleneck that leads to poor performance and power. The >> same >> idea applies for RAM/DDR. >> >> To achieve this, this patch adds a generic devfreq governor that takes >> the >> current frequency of each CPU frequency domain and then adjusts the >> frequency of the cache (or any devfreq device) based on the frequency >> of >> the CPUs. It listens to CPU frequency transition notifiers to keep >> itself >> up to date on the current CPU frequency. >> >> To decide the frequency of the device, the governor does one of the >> following: >> >> * Uses a CPU frequency to device frequency mapping table >> - Either one mapping table used for all CPU freq policies (typically >> used >> for system with homogeneous cores/clusters that have the same >> OPPs). >> - One mapping table per CPU freq policy (typically used for ASMP >> systems >> with heterogeneous CPUs with different OPPs) >> >> OR >> >> * Scales the device frequency in proportion to the CPU frequency. So, >> if >> the CPUs are running at their max frequency, the device runs at its >> max >> frequency. If the CPUs are running at their min frequency, the >> device >> runs at its min frequency. And interpolated for frequencies in >> between. >> >> Signed-off-by: Saravana Kannan >> --- >> .../bindings/devfreq/devfreq-cpufreq-map.txt | 53 ++ > > Bindings should be a separate patch. > >> drivers/devfreq/Kconfig | 8 + >> drivers/devfreq/Makefile | 1 + >> drivers/devfreq/governor_cpufreq_map.c | 583 >> +++++++++++++++++++++ >> 4 files changed, 645 insertions(+) >> create mode 100644 >> Documentation/devicetree/bindings/devfreq/devfreq-cpufreq-map.txt >> create mode 100644 drivers/devfreq/governor_cpufreq_map.c >> >> diff --git >> a/Documentation/devicetree/bindings/devfreq/devfreq-cpufreq-map.txt >> b/Documentation/devicetree/bindings/devfreq/devfreq-cpufreq-map.txt >> new file mode 100644 >> index 0000000..982a30b >> --- /dev/null >> +++ >> b/Documentation/devicetree/bindings/devfreq/devfreq-cpufreq-map.txt >> @@ -0,0 +1,53 @@ >> +Devfreq CPUfreq governor >> + >> +devfreq-cpufreq-map is a parent device that contains one or more >> child devices. >> +Each child device provides CPU frequency to device frequency mapping >> for a >> +specific device. Examples of devices that could use this are: DDR, >> cache and >> +CCI. >> + >> +Parent device name shall be "devfreq-cpufreq-map". >> + >> +Required child device properties: >> +- cpu-to-dev-map, or cpu-to-dev-map-: >> + A list of tuples where each tuple consists of a >> + CPU frequency (KHz) and the corresponding device >> + frequency. CPU frequencies not listed in the table >> + will use the device frequency that corresponds to the >> + next rounded up CPU frequency. >> + Use "cpu-to-dev-map" if all CPUs in the system should >> + share same mapping. >> + Use cpu-to-dev-map- to describe different >> + mappings for different CPUs. The property should be >> + listed only for the first CPU if multiple CPUs are >> + synchronous. >> +- target-dev: Phandle to device that this mapping applies to. >> + >> +Example: >> + devfreq-cpufreq-map { >> + cpubw-cpufreq { >> + target-dev = <&cpubw>; >> + cpu-to-dev-map = >> + < 300000 1144000 >, >> + < 422400 2288000 >, >> + < 652800 3051000 >, >> + < 883200 5996000 >, >> + < 1190400 8056000 >, >> + < 1497600 10101000 >, >> + < 1728000 12145000 >, >> + < 2649600 16250000 >; > > Now we have frequencies listed in multiple places, the OPP tables and > here? Perhaps it is grouping OPPs that should be done. This doesn't list all OPPs (it can if necessary). This is listing the minimum frequency needed to give good performance/power for a device/product. AFAIK, OPP grouping isn't something that's supported in OPP framework or in DT. Is there something specific you had in mind? Also, I'd like for this to work even with devices that don't have OPPs listed in DT. Thanks, Saravana