Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5525742imm; Tue, 31 Jul 2018 12:26:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcMpGmAJLOJ2loZ0ck/DjKjZjDo23o2TlTAey4wWzZzAGCNYYj8QcXqjTvUGGkgFpGGVMtT X-Received: by 2002:a62:c410:: with SMTP id y16-v6mr23541243pff.161.1533065183826; Tue, 31 Jul 2018 12:26:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533065183; cv=none; d=google.com; s=arc-20160816; b=B+9nNKsJof67sHdnlQVDduNFEWI1LVzzMvaNWiVGJ4HDEHdTyxtEclUkv1Wnd8/7KH fU/TcgFZzCe5I9dkVbY9qowBTgMPCPpBjWmXGmnI1iRvGcaj03oVotxkVNGRlFo6aw18 Q9D/f5Yn7vSNtQGS5aOKQcTAhXbLXxJzAARomNL+bkHBXqi+kXx/iEABNh8ZlomVsb7b cV1nPJ1mxZTQpQiwnUShKnJbz0y7D1rPRw1xQMmPirZPl1LZKw/13Mgrw1WBzxqJojjD IYqTEXb3mcAHb/Jrit8sV+qghfpUtK8HCKs/hPhwv6gQPGXPj+0uw3NIT8OyO6tQNi3/ usxg== 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=bEMGe5wdK2USz1FZ6p80lznmxaxzUV8RCwPlqKizA8E=; b=s/flMM8bi4MR/BSmbPTn2qeLn712+CQjwmukN5p6zT6HWWR3rfJvAQVtjYTRguR2Y+ vXjA8KJNPf/bGFrdk6GJfjvpnU46b7QnTAo0bYnYA4qB0D/VeMyAOpJrVHN8RwVHD0u7 +QOWwSpU3YA91YbsEthBzFXgnDfVG8eBbOb8FFl+pzfXWZEPm5nLCA4/gpgI0GBlxAta Xku2EGER/DRstYGULae2vOo+92lMYeENU5FGotDJhOV8w6OqcVOdULre3ihAOXk3XdLP ccG/N0U2ysOmbxeZ9eqCnhATC66sEBSlKRN+8rvd9AtKux7Iyiqc40/xKuVDd41PLoUE hDew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=ox+0PmtJ; dkim=pass header.i=@codeaurora.org header.s=default header.b=ox+0PmtJ; 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 m63-v6si13265886pld.62.2018.07.31.12.26.00; Tue, 31 Jul 2018 12:26:23 -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=ox+0PmtJ; dkim=pass header.i=@codeaurora.org header.s=default header.b=ox+0PmtJ; 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 S1732323AbeGaVGq (ORCPT + 99 others); Tue, 31 Jul 2018 17:06:46 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:36694 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728800AbeGaVGq (ORCPT ); Tue, 31 Jul 2018 17:06:46 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 810DA60B19; Tue, 31 Jul 2018 19:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1533065099; bh=EPTk36YUrGKglBOFpQ0mNMSjipOdFGISnVPnsrBN6xI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ox+0PmtJ4DZpxetPSr8sPQN0HVjkjCubcGlphOb1vHINHLypYuV5/GDc4UY5326kx 2kN6LPRnniv5+SErGUmqFYVLPRpLeuwjKhZz/A4ZFAoOOKY6KCXfExnKH5+PTpY1p/ UlUf/32MdCcQq1oyLnHpTZgz7c/mEsrE6SiMb5F0= 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 12F0460585; Tue, 31 Jul 2018 19:24:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1533065099; bh=EPTk36YUrGKglBOFpQ0mNMSjipOdFGISnVPnsrBN6xI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ox+0PmtJ4DZpxetPSr8sPQN0HVjkjCubcGlphOb1vHINHLypYuV5/GDc4UY5326kx 2kN6LPRnniv5+SErGUmqFYVLPRpLeuwjKhZz/A4ZFAoOOKY6KCXfExnKH5+PTpY1p/ UlUf/32MdCcQq1oyLnHpTZgz7c/mEsrE6SiMb5F0= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 31 Jul 2018 12:24:59 -0700 From: skannan@codeaurora.org To: MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Rob Herring , Mark Rutland , Rajendra Nayak Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PM / devfreq: Generic cpufreq governor In-Reply-To: <1532750217-8886-1-git-send-email-skannan@codeaurora.org> References: <1532750217-8886-1-git-send-email-skannan@codeaurora.org> Message-ID: <304a412a17e9bff85991eb1e7e175be8@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-07-27 20:56, 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 can > listen > to the frequency transitions of each CPU frequency domain and then > adjusts > the frequency of the cache (or any devfreq device) based on the > frequency > of the CPUs. > > 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.txt | 53 ++ > drivers/devfreq/Kconfig | 8 + > drivers/devfreq/Makefile | 1 + > drivers/devfreq/governor_cpufreq.c | 583 > +++++++++++++++++++++ > 4 files changed, 645 insertions(+) > create mode 100644 > Documentation/devicetree/bindings/devfreq/devfreq-cpufreq.txt > create mode 100644 drivers/devfreq/governor_cpufreq.c > > diff --git > a/Documentation/devicetree/bindings/devfreq/devfreq-cpufreq.txt > b/Documentation/devicetree/bindings/devfreq/devfreq-cpufreq.txt > new file mode 100644 > index 0000000..6537538 MyungJoo, Chanwoo, Thoughts? Good enough to merge? Rob, DT review? I know this DT documentation should be a separate patch, but I've kept it here for context. I can split it up once the code and the binding have been agreed to. Thanks, Saravana