aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Mayer <mmayer@broadcom.com>2016-12-19 15:10:28 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-01-27 05:43:49 -0500
commit3c223c19aea85d3dda1416c187915f4a30b04b1f (patch)
tree2d2021f8161db3e9ed38b9a966a225b66dff8e58
parent9b02c54bc951fca884ba5719f42a27e8240965bf (diff)
cpufreq: brcmstb-avs-cpufreq: properly retrieve P-state upon suspend
The AVS GET_PMAP command does return a P-state along with the P-map information. However, that P-state is the initial P-state when the P-map was first downloaded to AVS. It is *not* the current P-state. Therefore, we explicitly retrieve the P-state using the GET_PSTATE command. Signed-off-by: Markus Mayer <mmayer@broadcom.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/cpufreq/brcmstb-avs-cpufreq.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/cpufreq/brcmstb-avs-cpufreq.c b/drivers/cpufreq/brcmstb-avs-cpufreq.c
index 2c6e3253ba64..c94360671f41 100644
--- a/drivers/cpufreq/brcmstb-avs-cpufreq.c
+++ b/drivers/cpufreq/brcmstb-avs-cpufreq.c
@@ -784,8 +784,19 @@ static int brcm_avs_target_index(struct cpufreq_policy *policy,
784static int brcm_avs_suspend(struct cpufreq_policy *policy) 784static int brcm_avs_suspend(struct cpufreq_policy *policy)
785{ 785{
786 struct private_data *priv = policy->driver_data; 786 struct private_data *priv = policy->driver_data;
787 int ret;
788
789 ret = brcm_avs_get_pmap(priv, &priv->pmap);
790 if (ret)
791 return ret;
787 792
788 return brcm_avs_get_pmap(priv, &priv->pmap); 793 /*
794 * We can't use the P-state returned by brcm_avs_get_pmap(), since
795 * that's the initial P-state from when the P-map was downloaded to the
796 * AVS co-processor, not necessarily the P-state we are running at now.
797 * So, we get the current P-state explicitly.
798 */
799 return brcm_avs_get_pstate(priv, &priv->pmap.state);
789} 800}
790 801
791static int brcm_avs_resume(struct cpufreq_policy *policy) 802static int brcm_avs_resume(struct cpufreq_policy *policy)