lkml.org 
[lkml]   [2013]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 5/7] cpufreq: balance out cpufreq_cpu_{get,put} for scaling drivers using setpolicy
From
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


\
 
 \ /
  Last update: 2013-02-06 18:01    [W:0.120 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site