Message ID | 54ED50F5.5080603@linaro.org |
---|---|
State | New |
Headers | show |
On 9 March 2015 at 07:04, Ethan Zhao <ethan.kernel@gmail.com> wrote: > Viresh, > Got that box and did some debug, found the policy->kobj is not initialized. > So the race happened between cpufreq_cpu_get() and > __cpufreq_add_dev(), and verified 'this' race could be fixed by commit > > 6d4e81e cpufreq: Ref the policy object sooner > > I have reboot the box with crond for more than 12 hours, no warning found. Oh, great. Thanks for your work Ethan. You want this to be pushed for 3.18 stable kernel, right? I will see what I can do. -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index b4375021238f..230a59d2e0d7 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -214,8 +214,10 @@ struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu) if (cpufreq_driver) { /* get the CPU */ policy = per_cpu(cpufreq_cpu_data, cpu); - if (policy) + if (policy) { kobject_get(&policy->kobj); + pr_info("%s: %d", __func__, atomic_read(&policy->kobj.kref.refcount)); + } } read_unlock_irqrestore(&cpufreq_driver_lock, flags); @@ -233,6 +235,7 @@ void cpufreq_cpu_put(struct cpufreq_policy *policy) return; kobject_put(&policy->kobj); + pr_info("%s: %d", __func__, atomic_read(&policy->kobj.kref.refcount)); up_read(&cpufreq_rwsem); } EXPORT_SYMBOL_GPL(cpufreq_cpu_put);