mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org,
	linux-pm@vger.kernel.org, Jonghwa Lee <jonghwa3.lee@samsung.com>
Subject: Re: [RESEND PATCH] [CPUFREQ] EXYNOS: bugfix on retrieving old_index from freqs.old
Date: Fri, 20 Jul 2012 12:10:47 +0200	[thread overview]
Message-ID: <201207201210.48030.rjw@sisk.pl> (raw)
In-Reply-To: <1342752842-21368-1-git-send-email-myungjoo.ham@samsung.com>

On Friday, July 20, 2012, MyungJoo Ham wrote:
> From: Jonghwa Lee <jonghwa3.lee@samsung.com>
> 
> The policy might have been changed since last call of target().
> Thus, using cpufreq_frequency_table_target(), which depends on
> policy to find the corresponding index from a frequency, may return
> inconsistent index for freqs.old. Thus, old_index should be
> calculated not based on the current policy.
> 
> We have been observing such issue when scaling_min/max_freq were
> updated and sometimes cuased system lockups deu to incorrectly
> configured voltages.
> 
> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>

Applied to the pm-cpufreq branch of the linux-pm.git tree, will be pushed
for v3.6.

Thanks,
Rafael


> ---
>  drivers/cpufreq/exynos-cpufreq.c |   14 ++++++++++++--
>  1 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c
> index b243a7e..af2d81e 100644
> --- a/drivers/cpufreq/exynos-cpufreq.c
> +++ b/drivers/cpufreq/exynos-cpufreq.c
> @@ -62,8 +62,18 @@ static int exynos_target(struct cpufreq_policy *policy,
>  		goto out;
>  	}
>  
> -	if (cpufreq_frequency_table_target(policy, freq_table,
> -					   freqs.old, relation, &old_index)) {
> +	/*
> +	 * The policy max have been changed so that we cannot get proper
> +	 * old_index with cpufreq_frequency_table_target(). Thus, ignore
> +	 * policy and get the index from the raw freqeuncy table.
> +	 */
> +	for (old_index = 0;
> +		freq_table[old_index].frequency != CPUFREQ_TABLE_END;
> +		old_index++)
> +		if (freq_table[old_index].frequency == freqs.old)
> +			break;
> +
> +	if (freq_table[old_index].frequency == CPUFREQ_TABLE_END) {
>  		ret = -EINVAL;
>  		goto out;
>  	}
> 


      reply	other threads:[~2012-07-20 10:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-20  2:54 MyungJoo Ham
2012-07-20 10:10 ` Rafael J. Wysocki [this message]

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=201207201210.48030.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=cpufreq@vger.kernel.org \
    --cc=jonghwa3.lee@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    /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

Powered by JetHome