From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751367AbdBAXt1 (ORCPT ); Wed, 1 Feb 2017 18:49:27 -0500 Received: from cloudserver094114.home.net.pl ([79.96.170.134]:50864 "EHLO cloudserver094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751353AbdBAXtZ (ORCPT ); Wed, 1 Feb 2017 18:49:25 -0500 From: "Rafael J. Wysocki" To: Markus Mayer Cc: Viresh Kumar , Markus Mayer , Power Management List , Broadcom Kernel List , Linux Kernel Mailing List Subject: Re: [PATCH 2/2] cpufreq: brcmstb-avs-cpufreq: properly retrieve P-state upon suspend Date: Thu, 02 Feb 2017 00:44:44 +0100 Message-ID: <13652921.6keQ978gf5@aspire.rjw.lan> User-Agent: KMail/4.14.10 (Linux/4.10.0-rc3+; KDE/4.14.9; x86_64; ; ) In-Reply-To: References: <20161219201028.18885-1-code@mmayer.net> <20170106041112.GC21926@vireshk-i7> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, January 31, 2017 10:53:01 AM Markus Mayer wrote: > On 5 January 2017 at 20:11, Viresh Kumar wrote: > > On 19-12-16, 12:10, Markus Mayer wrote: > >> From: Markus Mayer > >> > >> 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 > >> --- > >> drivers/cpufreq/brcmstb-avs-cpufreq.c | 13 ++++++++++++- > >> 1 file changed, 12 insertions(+), 1 deletion(-) > >> > >> diff --git a/drivers/cpufreq/brcmstb-avs-cpufreq.c b/drivers/cpufreq/brcmstb-avs-cpufreq.c > >> index 2c6e325..c943606 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, > >> static int brcm_avs_suspend(struct cpufreq_policy *policy) > >> { > >> struct private_data *priv = policy->driver_data; > >> + int ret; > >> + > >> + ret = brcm_avs_get_pmap(priv, &priv->pmap); > >> + if (ret) > >> + return ret; > >> > >> - return brcm_avs_get_pmap(priv, &priv->pmap); > >> + /* > >> + * We can't use the P-state returned by brcm_avs_get_pmap(), since > >> + * that's the initial P-state from when the P-map was downloaded to the > >> + * AVS co-processor, not necessarily the P-state we are running at now. > >> + * So, we get the current P-state explicitly. > >> + */ > >> + return brcm_avs_get_pstate(priv, &priv->pmap.state); > >> } > >> > >> static int brcm_avs_resume(struct cpufreq_policy *policy) > > > > Acked-by: Viresh Kumar > > Just wanted to follow up to see if this has been or will be picked up > for 4.10? For 4.10? No way. > I had a quick poke around some trees and did not see it > there. I'm not sure which trees you checked, but it is there in my linux-next branch. Thanks, Rafael