From: Michael Ellerman <mpe@ellerman•id.au>
To: Viresh Kumar <viresh.kumar@linaro•org>,
Rafael Wysocki <rjw@rjwysocki•net>,
Benjamin Herrenschmidt <benh@kernel•crashing.org>,
Paul Mackerras <paulus@samba•org>
Cc: Viresh Kumar <viresh.kumar@linaro•org>,
linux-pm@vger•kernel.org,
Vincent Guittot <vincent.guittot@linaro•org>,
linuxppc-dev@lists•ozlabs.org
Subject: Re: [PATCH 15/27] cpufreq: powerenv: Don't validate the frequency table twice
Date: Mon, 26 Feb 2018 22:53:44 +1100 [thread overview]
Message-ID: <871sh89dbr.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <3120e4db4ae3bc014d198a206f46be1305ec65e8.1519620578.git.viresh.kumar@linaro.org>
Viresh Kumar <viresh.kumar@linaro•org> writes:
> Subject: Re: [PATCH 15/27] cpufreq: powerenv: Don't validate the frequency table twice
^
powernv
> The cpufreq core is already validating the CPU frequency table after
> calling the ->init() callback of the cpufreq drivers and the drivers
> don't need to do the same anymore. Though they need to set the
> policy->freq_table field directly from the ->init() callback now.
>
> Stop validating the frequency table from powerenv driver.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro•org>
> ---
> drivers/cpufreq/powernv-cpufreq.c | 11 +++--------
> 1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c
> index 29cdec198657..0591874856d3 100644
> --- a/drivers/cpufreq/powernv-cpufreq.c
> +++ b/drivers/cpufreq/powernv-cpufreq.c
> @@ -812,7 +812,7 @@ static int powernv_cpufreq_target_index(struct cpufreq_policy *policy,
>
> static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy)
> {
> - int base, i, ret;
> + int base, i;
> struct kernfs_node *kn;
> struct global_pstate_info *gpstates;
Confusingly this function has two variables called ret, but the other
one is declared inside an if block below in context not shown.
So this hunk is correct.
> @@ -848,15 +848,10 @@ static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy)
> gpstates->timer.expires = jiffies +
> msecs_to_jiffies(GPSTATE_TIMER_INTERVAL);
> spin_lock_init(&gpstates->gpstate_lock);
> - ret = cpufreq_table_validate_and_show(policy, powernv_freqs);
> -
> - if (ret < 0) {
> - kfree(policy->driver_data);
> - return ret;
> - }
>
> + policy->freq_table = powernv_freqs;
> policy->fast_switch_possible = true;
> - return ret;
> + return 0;
> }
LGTM.
cheers
next prev parent reply other threads:[~2018-02-26 11:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-26 5:08 [PATCH 00/27] cpufreq: Stop validating cpufreq table in drivers Viresh Kumar
2018-02-26 5:08 ` [PATCH 15/27] cpufreq: powerenv: Don't validate the frequency table twice Viresh Kumar
2018-02-26 11:53 ` Michael Ellerman [this message]
2018-02-27 3:45 ` Viresh Kumar
2018-02-28 10:45 ` Michael Ellerman
2018-03-05 4:19 ` [PATCH V2 15/27] cpufreq: powernv: " Viresh Kumar
2018-03-09 10:00 ` [PATCH 00/27] cpufreq: Stop validating cpufreq table in drivers Viresh Kumar
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=871sh89dbr.fsf@concordia.ellerman.id.au \
--to=mpe@ellerman$(echo .)id.au \
--cc=benh@kernel$(echo .)crashing.org \
--cc=linux-pm@vger$(echo .)kernel.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=paulus@samba$(echo .)org \
--cc=rjw@rjwysocki$(echo .)net \
--cc=vincent.guittot@linaro$(echo .)org \
--cc=viresh.kumar@linaro$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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