<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/cpufreq.h, branch v3.12.17</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v3.12.17</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v3.12.17'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2013-09-10T00:54:50+00:00</updated>
<entry>
<title>Revert "cpufreq: make sure frequency transitions are serialized"</title>
<updated>2013-09-10T00:54:50+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2013-09-10T00:54:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=798282a8718347b04a2f0a4bae7d775c48c6bcb9'/>
<id>urn:sha1:798282a8718347b04a2f0a4bae7d775c48c6bcb9</id>
<content type='text'>
Commit 7c30ed5 (cpufreq: make sure frequency transitions are
serialized) attempted to serialize frequency transitions by
adding checks to the CPUFREQ_PRECHANGE and CPUFREQ_POSTCHANGE
notifications.  However, it assumed that the notifications will
always originate from the driver's .target() callback, but they
also can be triggered by cpufreq_out_of_sync() and that leads to
warnings like this on some systems:

 WARNING: CPU: 0 PID: 14543 at drivers/cpufreq/cpufreq.c:317
 __cpufreq_notify_transition+0x238/0x260()
 In middle of another frequency transition

accompanied by a call trace similar to this one:

 [&lt;ffffffff81720daa&gt;] dump_stack+0x46/0x58
 [&lt;ffffffff8106534c&gt;] warn_slowpath_common+0x8c/0xc0
 [&lt;ffffffff815b8560&gt;] ? acpi_cpufreq_target+0x320/0x320
 [&lt;ffffffff81065436&gt;] warn_slowpath_fmt+0x46/0x50
 [&lt;ffffffff815b1ec8&gt;] __cpufreq_notify_transition+0x238/0x260
 [&lt;ffffffff815b33be&gt;] cpufreq_notify_transition+0x3e/0x70
 [&lt;ffffffff815b345d&gt;] cpufreq_out_of_sync+0x6d/0xb0
 [&lt;ffffffff815b370c&gt;] cpufreq_update_policy+0x10c/0x160
 [&lt;ffffffff815b3760&gt;] ? cpufreq_update_policy+0x160/0x160
 [&lt;ffffffff81413813&gt;] cpufreq_set_cur_state+0x8c/0xb5
 [&lt;ffffffff814138df&gt;] processor_set_cur_state+0xa3/0xcf
 [&lt;ffffffff8158e13c&gt;] thermal_cdev_update+0x9c/0xb0
 [&lt;ffffffff8159046a&gt;] step_wise_throttle+0x5a/0x90
 [&lt;ffffffff8158e21f&gt;] handle_thermal_trip+0x4f/0x140
 [&lt;ffffffff8158e377&gt;] thermal_zone_device_update+0x57/0xa0
 [&lt;ffffffff81415b36&gt;] acpi_thermal_check+0x2e/0x30
 [&lt;ffffffff81415ca0&gt;] acpi_thermal_notify+0x40/0xdc
 [&lt;ffffffff813e7dbd&gt;] acpi_device_notify+0x19/0x1b
 [&lt;ffffffff813f8241&gt;] acpi_ev_notify_dispatch+0x41/0x5c
 [&lt;ffffffff813e3fbe&gt;] acpi_os_execute_deferred+0x25/0x32
 [&lt;ffffffff81081060&gt;] process_one_work+0x170/0x4a0
 [&lt;ffffffff81082121&gt;] worker_thread+0x121/0x390
 [&lt;ffffffff81082000&gt;] ? manage_workers.isra.20+0x170/0x170
 [&lt;ffffffff81088fe0&gt;] kthread+0xc0/0xd0
 [&lt;ffffffff81088f20&gt;] ? flush_kthread_worker+0xb0/0xb0
 [&lt;ffffffff8173582c&gt;] ret_from_fork+0x7c/0xb0
 [&lt;ffffffff81088f20&gt;] ? flush_kthread_worker+0xb0/0xb0

For this reason, revert commit 7c30ed5 along with the fix 266c13d
(cpufreq: Fix serialization of frequency transitions) on top of it
and we will revisit the serialization problem later.

Reported-by: Alessandro Bono &lt;alessandro.bono@gmail.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: Remove temporary fix for race between CPU hotplug and sysfs-writes</title>
<updated>2013-09-10T00:49:47+00:00</updated>
<author>
<name>Srivatsa S. Bhat</name>
<email>srivatsa.bhat@linux.vnet.ibm.com</email>
</author>
<published>2013-09-06T19:53:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=56d07db274b7b15ca38b60ea4a762d40de093000'/>
<id>urn:sha1:56d07db274b7b15ca38b60ea4a762d40de093000</id>
<content type='text'>
Commit "cpufreq: serialize calls to __cpufreq_governor()" had been a temporary
and partial solution to the race condition between writing to a cpufreq sysfs
file and taking a CPU offline. Now that we have a proper and complete solution
to that problem, remove the temporary fix.

Signed-off-by: Srivatsa S. Bhat &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: serialize calls to __cpufreq_governor()</title>
<updated>2013-09-10T00:49:46+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2013-08-31T12:18:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=19c763031acb831a5ab9c1a701b7fedda073eb3f'/>
<id>urn:sha1:19c763031acb831a5ab9c1a701b7fedda073eb3f</id>
<content type='text'>
We can't take a big lock around __cpufreq_governor() as this causes
recursive locking for some cases. But calls to this routine must be
serialized for every policy. Otherwise we can see some unpredictable
events.

For example, consider following scenario:

__cpufreq_remove_dev()
 __cpufreq_governor(policy, CPUFREQ_GOV_STOP);
   policy-&gt;governor-&gt;governor(policy, CPUFREQ_GOV_STOP);
    cpufreq_governor_dbs()
     case CPUFREQ_GOV_STOP:
      mutex_destroy(&amp;cpu_cdbs-&gt;timer_mutex)
      cpu_cdbs-&gt;cur_policy = NULL;
  &lt;PREEMPT&gt;
store()
 __cpufreq_set_policy()
  __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
    policy-&gt;governor-&gt;governor(policy, CPUFREQ_GOV_LIMITS);
     case CPUFREQ_GOV_LIMITS:
      mutex_lock(&amp;cpu_cdbs-&gt;timer_mutex); &lt;-- Warning (destroyed mutex)
       if (policy-&gt;max &lt; cpu_cdbs-&gt;cur_policy-&gt;cur) &lt;- cur_policy == NULL

And so store() will eventually result in a crash if cur_policy is
NULL at this point.

Introduce an additional variable which would guarantee serialization
here.

Reported-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: Drop the owner field from struct cpufreq_driver</title>
<updated>2013-08-10T01:24:47+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2013-08-06T17:23:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=adc97d6a735dbb1e94cb4f1bf0b55f258b349941'/>
<id>urn:sha1:adc97d6a735dbb1e94cb4f1bf0b55f258b349941</id>
<content type='text'>
We don't need to set .owner = THIS_MODULE any more in cpufreq drivers
as this field isn't used any more by the cpufreq core.

This patch removes it and updates all dependent drivers accordingly.

Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: Store cpufreq policies in a list</title>
<updated>2013-08-10T01:24:06+00:00</updated>
<author>
<name>Lukasz Majewski</name>
<email>l.majewski@samsung.com</email>
</author>
<published>2013-08-06T17:23:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c88a1f8b96e7384627b918dfabbfc0c615a4a914'/>
<id>urn:sha1:c88a1f8b96e7384627b918dfabbfc0c615a4a914</id>
<content type='text'>
Policies available in the cpufreq framework are now linked together.
They are accessible via cpufreq_policy_list defined in the cpufreq
core.

[rjw: Fix from Yinghai Lu folded in]
Signed-off-by: Lukasz Majewski &lt;l.majewski@samsung.com&gt;
Signed-off-by: Myungjoo Ham &lt;myungjoo.ham@samsung.com&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: Give consistent names to cpufreq_policy objects</title>
<updated>2013-08-07T21:34:10+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2013-08-06T17:23:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3a3e9e06d0c11b8efa95933a88c9e67209fa4330'/>
<id>urn:sha1:3a3e9e06d0c11b8efa95933a88c9e67209fa4330</id>
<content type='text'>
They are called policy, cur_policy, new_policy, data, etc.  Just call
them policy wherever possible.

Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: Re-arrange declarations in cpufreq.h</title>
<updated>2013-08-07T21:34:10+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2013-08-06T17:23:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=74aca95da74836a6807118f6590d8df8232c74a9'/>
<id>urn:sha1:74aca95da74836a6807118f6590d8df8232c74a9</id>
<content type='text'>
They are pretty much mixed up.  Although generic headers are present,
definitions/declarations are present outside of them too ...

This patch just moves stuff up and down to make it look better and
consistent.

Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: Clean up header files included in the core</title>
<updated>2013-08-07T21:34:09+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2013-08-06T17:23:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5ff0a268037d344f86df690ccb994d8bc015d2d9'/>
<id>urn:sha1:5ff0a268037d344f86df690ccb994d8bc015d2d9</id>
<content type='text'>
This patch addresses the following issues in the header files in the
cpufreq core:
 - Include headers in ascending order, so that we don't add same
   many times by mistake.
 - &lt;asm/&gt; must be included after &lt;linux/&gt;, so that they override
   whatever they need to.
 - Remove unnecessary includes.
 - Don't include files already included by cpufreq.h or
   cpufreq_governor.h.

[rjw: Changelog]
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: Remove unused function __cpufreq_driver_getavg()</title>
<updated>2013-07-25T23:06:44+00:00</updated>
<author>
<name>Stratos Karafotis</name>
<email>stratosk@semaphore.gr</email>
</author>
<published>2013-06-05T16:01:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cffe4e0e7413eb29fb8bd035c8b12b33a4b8522a'/>
<id>urn:sha1:cffe4e0e7413eb29fb8bd035c8b12b33a4b8522a</id>
<content type='text'>
The target frequency calculation method in the ondemand governor has
changed and it is now independent of the measured average frequency.
Consequently, the __cpufreq_driver_getavg() function and getavg
member of struct cpufreq_driver are not used any more, so drop them.

[rjw: Changelog]
Signed-off-by: Stratos Karafotis &lt;stratosk@semaphore.gr&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: Fix serialization of frequency transitions</title>
<updated>2013-07-04T11:12:44+00:00</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2013-07-02T11:06:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=266c13d767be61a17d8e6f2310b9b7c46278273b'/>
<id>urn:sha1:266c13d767be61a17d8e6f2310b9b7c46278273b</id>
<content type='text'>
Commit 7c30ed ("cpufreq: make sure frequency transitions are serialized")
interacts poorly with systems that have a single core freqency for all
cores.  On such systems we have a single policy for all cores with
several CPUs.  When we do a frequency transition the governor calls the
pre and post change notifiers which causes cpufreq_notify_transition()
per CPU.  Since the policy is the same for all of them all CPUs after
the first and the warnings added are generated by checking a per-policy
flag the warnings will be triggered for all cores after the first.

Fix this by allowing notifier to be called for n times. Where n is the number of
cpus in policy-&gt;cpus.

Reported-and-tested-by: Mark Brown &lt;broonie@linaro.org&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
