From patchwork Fri Aug 25 14:32:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 111021 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp1045515ybm; Fri, 25 Aug 2017 07:32:43 -0700 (PDT) X-Received: by 10.99.185.16 with SMTP id z16mr9731921pge.395.1503671563045; Fri, 25 Aug 2017 07:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503671563; cv=none; d=google.com; s=arc-20160816; b=ckJOG2fEeK0mnbS6i95KpcB+LvjewCNvGDUOXFsP8qBtUIg/nJCm6OIArzv0zgcO6a 9I/Yul3TnMtTstmqTMjZ7UG4AUJc45VBFMsV6ocbz5eRkg3mWBq3KC23t+bf6ex3R9dM 8qaeVlCo+r3iGgZL9ffAfHfCj40Hqa9VKJAgfvPWo7aMaHpnKxEyV26KMCJQGBdJV2fV TPshAYZM6kNKC/uDHPru/P38WE8JLIl+SE4LzKwLxFc1XrDqZX0+632Vb/ion5QJ/0IN RtofiOwp4V5GVVP4psvWQvGCKPBboViFjCkCEZrJcnYgOgLIGEQijiWBun1zAnmYX77C DdDg== 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=OBnYimGH1/H1SbR09O3MMUsSKNahhfRmLx5wiy4AddQ=; b=nz4Z5vtoASwz4h5FExK4bIiN/iies5mTq8zdm68N/9d+PcIxT3P0t8E4XVZWBkB7/k pP89/ILGSPmHoem9bAODYV/XT5uRw6/5IlUQVZhsvZIeSUhMq6E772O0ItmheHWotmj1 tsWJcYFsgqlCTAhu285UYwy4g4Ld2+wgFnhNjQbZmMjODtRVYMpQNReJKp7wsjLNbiZX Q99nxTVQf74P+eRNs23GjiMmBVxksT6222i/jp2sDtiWyEPrFAxjdBhlyoF1LGP0hwGu gYspeWEn+7bPmw0XdGnlobM8432o4n/m8JEhBsf7oA2ed7yf7sCFxPJRm8cBoFA7vtm5 cxgA== 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 a1si5061466pln.371.2017.08.25.07.32.42; Fri, 25 Aug 2017 07:32:43 -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 S932730AbdHYOcj (ORCPT + 26 others); Fri, 25 Aug 2017 10:32:39 -0400 Received: from foss.arm.com ([217.140.101.70]:54072 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756769AbdHYOcg (ORCPT ); Fri, 25 Aug 2017 10:32:36 -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 2600B168F; Fri, 25 Aug 2017 07:32:36 -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 2BAA23F540; Fri, 25 Aug 2017 07:32:34 -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 , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen , Viresh Kumar , "Rafael J . Wysocki" , Sudeep Holla Subject: [PATCH v4 04/10] cpufreq: dt: invoke frequency-invariance setter function Date: Fri, 25 Aug 2017 15:32:00 +0100 Message-Id: <20170825143206.30467-5-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170825143206.30467-1-dietmar.eggemann@arm.com> References: <20170825143206.30467-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 Acked-by: Viresh Kumar --- 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; } /*