Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp6901001ybh; Thu, 8 Aug 2019 07:23:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyynJztA9Lof/dpRjF7OTUSNSs4w6LH1kgT3vx3xAoUn7m8oN47pJKtEDiV8zTURNE0qgfW X-Received: by 2002:a17:90a:360c:: with SMTP id s12mr4448162pjb.30.1565274222200; Thu, 08 Aug 2019 07:23:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565274222; cv=none; d=google.com; s=arc-20160816; b=L0mGcCLZp85QifbbnMejv3bjG7fePPjuGeJeyFVVhpkIVb3vRIDrBSRDP+uSJHRuaT +/HTKa080wQflIA3iTEiBqpNCWa5/tNX36x4VD38DMZsqriaVtzhzuP6x6UaEspUJ1Kx Q8BMoG1oZt0UoHzTsH8TehRMcpRBbKPImhmYIM5HX2hbFnLAGbXVMAZ1r/o6PRl4DW6i h3R7AmRms+XHMcS0xicHTjRq+IG+EZVStWxvzt3xSfZkBwz7VHQV2019odQ8uhWDIFnc RIClkkoSAWxmEm1MZ/nxm64+RtwGI1Ut/iwY2P5qhE9cP9kaeWwPd+7uDeHrsPKVPU/E JzNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=qZYDGj7eWs+pRGa8b87SZqTsEn9JBOT1Z7XeNw5EqDQ=; b=WTfIopiYqIVIysBP4B50pL1diXxh5woaAuN0KSlS/3fS5XHnO+zo6nCgysnDn4ncsD uugZzxQhktC6G+Mdm814dvJr/2+7D7mNnFBcWsmvx28T1km7LkJWP5SWFOqFuJIxAqR+ Wor05tUEkxKFPDXF55ZNviA5sF3NIUduSB7T/cg2/+JmMXXzytDD+0Ph/eRSzcOTV22R b4Q7fUZUNoNFL32LyjmaP2MRpjsPrSBgJHD3EBQq/dCCtBE8RpIpkqqvwE/m2aK9bxsp TFiGvnoojpgHqe6wiSNlofPSbwMbVJDVHugg67al6D8AKRbOrPk/7dQli2m9y9VXbxev It2A== 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 q5si21068031pll.279.2019.08.08.07.23.26; Thu, 08 Aug 2019 07:23:42 -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 S1732994AbfHHNTX (ORCPT + 99 others); Thu, 8 Aug 2019 09:19:23 -0400 Received: from foss.arm.com ([217.140.110.172]:33288 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732643AbfHHNTX (ORCPT ); Thu, 8 Aug 2019 09:19:23 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AC70515A2; Thu, 8 Aug 2019 06:19:22 -0700 (PDT) Received: from e107049-lin.arm.com (e107049-lin.cambridge.arm.com [10.1.195.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C4F9A3F694; Thu, 8 Aug 2019 06:19:21 -0700 (PDT) From: Douglas RAILLARD To: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org Cc: rjw@rjwysocki.net, viresh.kumar@linaro.org, agross@kernel.org Subject: [PATCH 1/2] cpufreq: drivers: Enable frequency invariance in qcom-cpufreq-hw Date: Thu, 8 Aug 2019 14:18:57 +0100 Message-Id: <20190808131857.21082-1-douglas.raillard@arm.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add calls to arch_set_freq_scale() in qcom-cpufreq-hw driver to enable frequency invariance. Signed-off-by: Douglas RAILLARD --- drivers/cpufreq/qcom-cpufreq-hw.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index 4b0b50403901..3bd3b8b268d9 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -34,9 +34,12 @@ static int qcom_cpufreq_hw_target_index(struct cpufreq_policy *policy, unsigned int index) { void __iomem *perf_state_reg = policy->driver_data; + unsigned long freq = policy->freq_table[index].frequency; writel_relaxed(index, perf_state_reg); + arch_set_freq_scale(policy->related_cpus, freq, + policy->cpuinfo.max_freq); return 0; } @@ -63,6 +66,7 @@ static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy, { void __iomem *perf_state_reg = policy->driver_data; int index; + unsigned long freq; index = policy->cached_resolved_idx; if (index < 0) @@ -70,7 +74,11 @@ static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy, writel_relaxed(index, perf_state_reg); - return policy->freq_table[index].frequency; + freq = policy->freq_table[index].frequency; + arch_set_freq_scale(policy->related_cpus, freq, + policy->cpuinfo.max_freq); + + return freq; } static int qcom_cpufreq_hw_read_lut(struct device *cpu_dev, -- 2.22.0