diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2017-01-03 17:56:57 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-01-03 17:56:56 -0800 |
| commit | a5f4f523f854088bda337ee4de6b8b44090fb6e8 (patch) | |
| tree | bdec899c48b3f14b0802a575ce6e18c742876574 | |
| parent | 3ed5f01b008d41295451d543ffc30295caff5d39 (diff) | |
| parent | d36dd7737c6ebdde116241fb68f3bf48321e4aa0 (diff) | |
Merge "cpufreq: Register for hotplug notifier before locking hotplug"
| -rw-r--r-- | drivers/cpufreq/cpufreq.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 118dbf1cef44..6ec828805428 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2333,6 +2333,9 @@ static int cpufreq_cpu_callback(struct notifier_block *nfb, { unsigned int cpu = (unsigned long)hcpu; + if (!cpufreq_driver) + return NOTIFY_OK; + switch (action & ~CPU_TASKS_FROZEN) { case CPU_ONLINE: cpufreq_online(cpu); @@ -2499,6 +2502,9 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) pr_debug("trying to register driver %s\n", driver_data->name); + /* Register for hotplug notifers before blocking hotplug. */ + register_hotcpu_notifier(&cpufreq_cpu_notifier); + /* Protect against concurrent CPU online/offline. */ get_online_cpus(); @@ -2530,7 +2536,6 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) goto err_if_unreg; } - register_hotcpu_notifier(&cpufreq_cpu_notifier); pr_info("driver %s up and running\n", driver_data->name); out: |
