From: Viresh Kumar <viresh.kumar@linaro.org>
To: Jia Hongtao <hongtao.jia@nxp.com>
Cc: linux-pm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
scott.wood@nxp.com, yuantian.tang@nxp.com
Subject: Re: [PATCH 1/2] cpufreq: qoriq: Fix cooling device registration issue during suspend
Date: Mon, 18 Apr 2016 16:02:54 +0530 [thread overview]
Message-ID: <20160418103254.GD2322@vireshk-i7> (raw)
In-Reply-To: <1460966372-4877-1-git-send-email-hongtao.jia@nxp.com>
On 18-04-16, 15:59, Jia Hongtao wrote:
> Cooling device is registered by ready callback. It's also invoked while
> system resuming from sleep (Enabling non-boot cpus). Thus cooling device
> may be multiple registered. Stop_cpu callback is invoked during suspend
> (Disabling non-boot cpus). So matchable unregistration is added to fix
> this issue.
>
> Signed-off-by: Jia Hongtao <hongtao.jia@nxp.com>
> ---
> drivers/cpufreq/qoriq-cpufreq.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/cpufreq/qoriq-cpufreq.c b/drivers/cpufreq/qoriq-cpufreq.c
> index b23e525..1c2fdc1 100644
> --- a/drivers/cpufreq/qoriq-cpufreq.c
> +++ b/drivers/cpufreq/qoriq-cpufreq.c
> @@ -305,6 +305,7 @@ static int __exit qoriq_cpufreq_cpu_exit(struct cpufreq_policy *policy)
> {
> struct cpu_data *data = policy->driver_data;
>
> + cpufreq_cooling_unregister(data->cdev);
> kfree(data->pclk);
> kfree(data->table);
> kfree(data);
> @@ -323,6 +324,12 @@ static int qoriq_cpufreq_target(struct cpufreq_policy *policy,
> return clk_set_parent(policy->clk, parent);
> }
>
> +static void qoriq_cpufreq_stop_cpu(struct cpufreq_policy *policy)
> +{
> + struct cpu_data *cpud = policy->driver_data;
> +
> + cpufreq_cooling_unregister(cpud->cdev);
> +}
>
> static void qoriq_cpufreq_ready(struct cpufreq_policy *policy)
> {
> @@ -352,6 +359,7 @@ static struct cpufreq_driver qoriq_cpufreq_driver = {
> .verify = cpufreq_generic_frequency_table_verify,
> .target_index = qoriq_cpufreq_target,
> .get = cpufreq_generic_get,
> + .stop_cpu = qoriq_cpufreq_stop_cpu,
> .ready = qoriq_cpufreq_ready,
> .attr = cpufreq_generic_attr,
> };
You don't need to do it from stop_cpu(), please use
qoriq_cpufreq_cpu_exit() for this.
--
viresh
next prev parent reply other threads:[~2016-04-18 10:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-18 7:59 [PATCH 1/2] cpufreq: qoriq: Fix cooling device registration issue during suspend Jia Hongtao
2016-04-18 7:59 ` [PATCH 2/2] cpufreq: qoriq: Don't show cooling device messages if THERMAL_OF undefined Jia Hongtao
2016-04-18 10:33 ` Viresh Kumar
2016-04-26 0:02 ` Rafael J. Wysocki
2016-04-18 10:32 ` Viresh Kumar [this message]
2016-04-19 6:52 ` 答复: [PATCH 1/2] cpufreq: qoriq: Fix cooling device registration issue during suspend Hongtao Jia
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=20160418103254.GD2322@vireshk-i7 \
--to=viresh.kumar@linaro.org \
--cc=hongtao.jia@nxp.com \
--cc=linux-pm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=scott.wood@nxp.com \
--cc=yuantian.tang@nxp.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;
as well as URLs for NNTP newsgroup(s).