From patchwork Tue Sep 26 16:41:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Eggemann X-Patchwork-Id: 114270 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4042757qgf; Tue, 26 Sep 2017 09:42:37 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAUMu/bmAvssZrDxgv8qK0dgpHghH5KtJaPNBu6crabfksOmudv3NpAspMHXUGrJp8U/ulX X-Received: by 10.101.73.129 with SMTP id r1mr11707009pgs.411.1506444157240; Tue, 26 Sep 2017 09:42:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506444157; cv=none; d=google.com; s=arc-20160816; b=lqXy8rh6lOMHdjUHeT2AUDDsj5+qHycQTccroNzMQehj2fN7t8L11qdbq7WTCutX0z QcTKTwq4wHibQBliRfGwve8H4gQFTKgChHO2+osGEFfcuqSRbNnq3u0X58vUWMLvLyrW EmRU3+nAf1p0ulrTONV5VFmg1r994yVDsE4SQqD9NwnU46pADHrXKJOu+ggRLGUr5y1n CjQpxRv9pM7ixqH9OVqWfywZSwOKA2Sy6H/TpulNFjxUtVGhIdvgfBeW4Hs6gXko2R54 8QlbcS2LYYYVfalqYul2tm3G/On1c5KWXngcpuxy+4B+FuNfKHhKjfTMrw/uilrwTHk+ xRzg== 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=8fpD/HhKupRtXdhiM4QfEiCZ3UYTDG1N4BRS/FsrRo0=; b=jWo/y2FYlHS/a1tT75s4ua4O1jpusdNMyCtODCaOSAbmzUlo5wmbArlOwUR+iwZhXo nq069Nx/l8wV1u8bzLLZg4UeBBFyoStzNAhwZSiB0hINB3Sjy9FP88lRUHaDJUL59qGq 5Stlc17A6LLLHlenNIuSNw3Ub68YLwtUaTSsWBu25x5p5v27LQmPFDqaRB2rOLvTxItv GpTUWs1JjsbS22RblhVQzal18JdohBkWR+cmfBwMygzBqVbxJ22bo3w3gUr12d5JVnS1 /HeYEkuqsYIWQ0VBrxGmx5/2RGnky72XH+51mU0vquQxg5UhkPAMCS9we3PGE2YnkF0a 1u+g== 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 b5si5511116pgu.734.2017.09.26.09.42.36; Tue, 26 Sep 2017 09:42:37 -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 S1030748AbdIZQmf (ORCPT + 26 others); Tue, 26 Sep 2017 12:42:35 -0400 Received: from foss.arm.com ([217.140.101.70]:36034 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030638AbdIZQmb (ORCPT ); Tue, 26 Sep 2017 12:42:31 -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 5E00F165D; Tue, 26 Sep 2017 09:42:31 -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 F04373F483; Tue, 26 Sep 2017 09:42:28 -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 v5 04/10] cpufreq: dt: invoke frequency-invariance setter function Date: Tue, 26 Sep 2017 17:41:09 +0100 Message-Id: <20170926164115.32367-5-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170926164115.32367-1-dietmar.eggemann@arm.com> References: <20170926164115.32367-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 d83ab94d041a..545946ad0752 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; } /*