From patchwork Thu Jul 27 19:33:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 108859 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2486025qge; Thu, 27 Jul 2017 12:35:35 -0700 (PDT) X-Received: by 10.98.28.193 with SMTP id c184mr5152842pfc.77.1501184135328; Thu, 27 Jul 2017 12:35:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501184135; cv=none; d=google.com; s=arc-20160816; b=gjzMO3Q1jlFfpweCgUnK8tQuETRrXlm9tWHpxZkZSW3DhTEmzylLIUybQ23/MbBBqo RWpBtts03NTxElpsiBJFkJJ9wAdFRzHdou0BoTP6UMPktVvsxcNYtG5rJkNOQ9tn65gi /SVj5sqOF3/vQTqOvvpYjqY7Ff2INZiDD9sidrArOHBMPYvkUXFFGmTFYSTvVuX12URY BGAbhisg9Nv0Aq2fWpxglx1nC3Xu0WA6Z3I8yYeSuZAnzurMPgKRl8+L/jT0KQspsM/Q O16YnhlOqlRFBSP8MhKUgWg/WS17E84IjBcVrsqTEOL6Qxxmho4rvomgSq1dbf/tDXdu +S3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=2Na+X+ucZpePkIu+UHbbZ+zNpHNjhH9tUuLonkTRAKs=; b=s5HSoLzpBfYV94LWEaGCwc87nZiPQhdbMNWJ2bD5YbC2xNu+3wL/b1P3fIfkVKrZ+/ X5Da7A5yAInJaIxGU4pkJhU3f8UY0IuqHJZw+NYmwhv8Kk1rQ+OHAFqVeCyZBcQIbFpi 4Y756JzhzQXqDxCZU980lYA691xmhawmI5aq9GR+W4DTaonstcz2IcHFoQCiPRoMdIWC 6Xp2dwOJTUvy4s6rTbsP/mM8VyPo3zlonyBdzn+6WgsLN6uZfCAGq+5WnIoPKkAt82nO uFbYksG5JukkYvUC4lmLK2eYIKwUdWu6kEuGo9rZBBgwY8/DnLcL7+JagWmfzSH4AVIN hOSg== ARC-Authentication-Results: i=1; mx.google.com; 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 z4si7375721plh.438.2017.07.27.12.35.23; Thu, 27 Jul 2017 12:35:35 -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; 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 S1751933AbdG0TfV (ORCPT + 26 others); Thu, 27 Jul 2017 15:35:21 -0400 Received: from foss.arm.com ([217.140.101.70]:51094 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751670AbdG0Tdr (ORCPT ); Thu, 27 Jul 2017 15:33:47 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3F5D21610; Thu, 27 Jul 2017 12:33:47 -0700 (PDT) Received: from e107985-lin.cambridge.arm.com (e107985-lin.cambridge.arm.com [10.1.210.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 03E5A3F540; Thu, 27 Jul 2017 12:33:44 -0700 (PDT) From: Dietmar Eggemann To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org, linux@arm.linux.org.uk, Greg Kroah-Hartman , Russell King , Catalin Marinas , Will Deacon , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v3 04/10] cpufreq: dt: invoke frequency-invariance setter function Date: Thu, 27 Jul 2017 20:33:06 +0100 Message-Id: <20170727193312.9849-5-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170727193312.9849-1-dietmar.eggemann@arm.com> References: <20170727193312.9849-1-dietmar.eggemann@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Call the frequency-invariance setter function arch_set_freq_scale() if the new frequency has been successfully set which is indicated by dev_pm_opp_set_rate() returning 0. Cc: Rafael J. Wysocki Cc: Viresh Kumar Signed-off-by: Dietmar Eggemann --- drivers/cpufreq/cpufreq-dt.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- 2.11.0 diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index fef3c2160691..cbac8a7dbc50 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -43,9 +43,17 @@ static struct freq_attr *cpufreq_dt_attr[] = { static int set_target(struct cpufreq_policy *policy, unsigned int index) { struct private_data *priv = policy->driver_data; + unsigned long freq = policy->freq_table[index].frequency; + int ret; + + ret = dev_pm_opp_set_rate(priv->cpu_dev, freq * 1000); - return dev_pm_opp_set_rate(priv->cpu_dev, - policy->freq_table[index].frequency * 1000); + if (!ret) { + arch_set_freq_scale(policy->related_cpus, freq, + policy->cpuinfo.max_freq); + } + + return ret; } /*