cpufreq: cpufreq-dt: fix NETLINK wake up during suspend
during suspend, non-boot cpu will be pluged off, and when the last cpu of big cluster be pluged off, the related cpu cooling device will be unregistered, it will trigger an uevent, this will cause early wakeup if there are not enough time for the uevent to be handled before suspend. This patch fixes the issue by not unregistering cpu cooling device during suspend, this may not be a perfect solution. Signed-off-by: Kevin Wangtao <kevin.wangtao@hisilicon.com>
This commit is contained in:
committed by
Guodong Xu
parent
09fd0174c5
commit
1d2cd9e4bd
@@ -27,6 +27,8 @@
|
||||
|
||||
#include "cpufreq-dt.h"
|
||||
|
||||
extern bool cpufreq_suspended;
|
||||
|
||||
struct private_data {
|
||||
struct opp_table *opp_table;
|
||||
struct device *cpu_dev;
|
||||
@@ -307,7 +309,9 @@ static int cpufreq_exit(struct cpufreq_policy *policy)
|
||||
{
|
||||
struct private_data *priv = policy->driver_data;
|
||||
|
||||
cpufreq_cooling_unregister(priv->cdev);
|
||||
if (!cpufreq_suspended)
|
||||
cpufreq_cooling_unregister(priv->cdev);
|
||||
|
||||
dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table);
|
||||
dev_pm_opp_of_cpumask_remove_table(policy->related_cpus);
|
||||
if (priv->reg_name)
|
||||
@@ -327,6 +331,8 @@ static void cpufreq_ready(struct cpufreq_policy *policy)
|
||||
if (WARN_ON(!np))
|
||||
return;
|
||||
|
||||
if (cpufreq_suspended)
|
||||
goto put;
|
||||
/*
|
||||
* For now, just loading the cooling device;
|
||||
* thermal DT code takes care of matching them.
|
||||
@@ -348,6 +354,7 @@ static void cpufreq_ready(struct cpufreq_policy *policy)
|
||||
}
|
||||
}
|
||||
|
||||
put:
|
||||
of_node_put(np);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ static DEFINE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_data);
|
||||
static DEFINE_RWLOCK(cpufreq_driver_lock);
|
||||
|
||||
/* Flag to suspend/resume CPUFreq governors */
|
||||
static bool cpufreq_suspended;
|
||||
bool cpufreq_suspended = false;
|
||||
|
||||
static inline bool has_target(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user