public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Markus Mayer <code@mmayer.net>
Cc: "Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Power Management List <linux-pm@vger.kernel.org>,
	Broadcom Kernel List <bcm-kernel-feedback-list@broadcom.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Markus Mayer <mmayer@broadcom.com>
Subject: Re: [PATCH 2/2] cpufreq: brcmstb-avs-cpufreq: properly retrieve P-state upon suspend
Date: Fri, 6 Jan 2017 09:41:12 +0530	[thread overview]
Message-ID: <20170106041112.GC21926@vireshk-i7> (raw)
In-Reply-To: <20161219201028.18885-3-code@mmayer.net>

On 19-12-16, 12:10, Markus Mayer wrote:
> From: Markus Mayer <mmayer@broadcom.com>
> 
> 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>
> ---
>  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 <viresh.kumar@linaro.org>

-- 
viresh

  reply	other threads:[~2017-01-06  4:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-19 20:10 [PATCH 0/2] cpufreq: brcmstb-avs-cpufreq: properly retrieve P-state upon suspend Markus Mayer
2016-12-19 20:10 ` [PATCH 1/2] cpufreq: brcmstb-avs-cpufreq: extend sysfs entry brcm_avs_pmap Markus Mayer
2017-01-06  4:04   ` Viresh Kumar
2016-12-19 20:10 ` [PATCH 2/2] cpufreq: brcmstb-avs-cpufreq: properly retrieve P-state upon suspend Markus Mayer
2017-01-06  4:11   ` Viresh Kumar [this message]
2017-01-31 18:53     ` Markus Mayer
2017-02-01 23:44       ` Rafael J. Wysocki
2017-02-01 23:59         ` Markus Mayer
2017-02-02  3:33         ` Viresh Kumar
2017-02-02 11:22           ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170106041112.GC21926@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=code@mmayer.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mmayer@broadcom.com \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox