Messages in this thread |  | | Date | Wed, 6 Feb 2013 21:49:40 +0530 | Subject | Re: [PATCH 5/7] cpufreq: balance out cpufreq_cpu_{get,put} for scaling drivers using setpolicy | From | Viresh Kumar <> |
| |
On 6 February 2013 21:41, Dirk Brandewie <dirk.brandewie@gmail.com> wrote: > our files are clearly out of sync :-) The code in cpufreq_add_dev() is
I was at latest bleeding-edge then, but i still have below code in my HEAD.
> #ifdef CONFIG_SMP > /* check whether a different CPU already registered this > * CPU because it is in the same boat. */ > policy = cpufreq_cpu_get(cpu); > if (unlikely(policy)) { > cpufreq_cpu_put(policy); > return 0; > } > > The reference added by this cpufreq_cpu_get() is finally dropped in > __cpufreq_remove_dev() with the call to __cpufreq_governor()
__cpufreq_governor() is not calling cpufreq_cpu_put() at all and is dropping reference for the governor only, not for policy.
> if (driver->target) > __cpufreq_governor(data, CPUFREQ_GOV_STOP); > > Without this change I hang at: > pr_debug("waiting for dropping of refcount\n"); > wait_for_completion(cmp);
Below should have fixed it for you i believe.
pr_debug("%s: removing link, cpu: %d\n", __func__, cpu); cpufreq_cpu_put(data); unlock_policy_rwsem_write(cpu);
-- viresh
|  |