<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/cpufreq, branch v4.6</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.6</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.6'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-05-06T11:16:22Z</updated>
<entry>
<title>Merge branches 'pm-opp-fixes', 'pm-cpufreq-fixes' and 'pm-cpuidle-fixes'</title>
<updated>2016-05-06T11:16:22Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2016-05-06T11:16:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5f2f88e330e7ee2d2d7c5e0984b86108b00ac800'/>
<id>urn:sha1:5f2f88e330e7ee2d2d7c5e0984b86108b00ac800</id>
<content type='text'>
* pm-opp-fixes:
  PM / OPP: Remove useless check

* pm-cpufreq-fixes:
  intel_pstate: Fix intel_pstate_get()
  cpufreq: intel_pstate: Fix HWP on boot CPU after system resume
  cpufreq: st: enable selective initialization based on the platform

* pm-cpuidle-fixes:
  ARM: cpuidle: Pass on arm_cpuidle_suspend()'s return value
</content>
</entry>
<entry>
<title>intel_pstate: Fix intel_pstate_get()</title>
<updated>2016-05-04T12:09:16Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2016-05-04T12:01:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6d45b719cbd51f014bb1b5dd8ed99068d78d36af'/>
<id>urn:sha1:6d45b719cbd51f014bb1b5dd8ed99068d78d36af</id>
<content type='text'>
After commit 8fa520af5081 "intel_pstate: Remove freq calculation from
intel_pstate_calc_busy()" intel_pstate_get() calls get_avg_frequency()
to compute the average frequency, which is problematic for two reasons.

First, intel_pstate_get() may be invoked before the driver reads the
CPU feedback registers for the first time and if that happens,
get_avg_frequency() will attempt to divide by zero.

Second, the get_avg_frequency() call in intel_pstate_get() is racy
with respect to intel_pstate_sample() and it may end up returning
completely meaningless values for this reason.

Moreover, after commit 7349ec0470b6 "intel_pstate: Move
intel_pstate_calc_busy() into get_target_pstate_use_performance()"
sample.core_pct_busy is never computed on Atom, but it is used in
intel_pstate_adjust_busy_pstate() in that case too.

To address those problems notice that if sample.core_pct_busy
was used in the average frequency computation carried out by
get_avg_frequency(), both the divide by zero problem and the
race with respect to intel_pstate_sample() would be avoided.

Accordingly, move the invocation of intel_pstate_calc_busy() from
get_target_pstate_use_performance() to intel_pstate_update_util(),
which also will take care of the uninitialized sample.core_pct_busy
on Atom, and modify get_avg_frequency() to use sample.core_pct_busy
as per the above.

Reported-by: kernel test robot &lt;ying.huang@linux.intel.com&gt;
Link: http://marc.info/?l=linux-kernel&amp;m=146226437623173&amp;w=4
Fixes: 8fa520af5081 "intel_pstate: Remove freq calculation from intel_pstate_calc_busy()"
Fixes: 7349ec0470b6 "intel_pstate: Move intel_pstate_calc_busy() into get_target_pstate_use_performance()"
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Fix HWP on boot CPU after system resume</title>
<updated>2016-05-02T11:48:15Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2016-05-02T00:27:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ba41e1bc28bd862089b0fc00e8136aa258a62b21'/>
<id>urn:sha1:ba41e1bc28bd862089b0fc00e8136aa258a62b21</id>
<content type='text'>
Commit 41cfd64cf49fc "Update frequencies of policy-&gt;cpus only from
-&gt;set_policy()" changed the way the intel_pstate driver's -&gt;set_policy
callback updates the HWP (hardware-managed P-states) settings.
A side effect of it is that if those settings are modified on the
boot CPU during system suspend and wakeup, they will never be
restored during subsequent system resume.

To address this problem, allow cpufreq drivers that don't provide
-&gt;target or -&gt;target_index callbacks to use -&gt;suspend and -&gt;resume
callbacks and add a -&gt;resume callback to intel_pstate to restore
the HWP settings on the CPUs that belong to the given policy.

Fixes: 41cfd64cf49fc "Update frequencies of policy-&gt;cpus only from -&gt;set_policy()"
Tested-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'pm-cpufreq-fixes'</title>
<updated>2016-04-29T12:22:25Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2016-04-29T12:22:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=81be193b7e2089dc34a4e3939f1b057f53995f56'/>
<id>urn:sha1:81be193b7e2089dc34a4e3939f1b057f53995f56</id>
<content type='text'>
* pm-cpufreq-fixes:
  cpufreq: intel_pstate: Fix processing for turbo activation ratio
  Revert "cpufreq: governor: Fix negative idle_time when configured with CONFIG_HZ_PERIODIC"
</content>
</entry>
<entry>
<title>cpufreq: st: enable selective initialization based on the platform</title>
<updated>2016-04-28T13:25:56Z</updated>
<author>
<name>Sudeep Holla</name>
<email>Sudeep.Holla@arm.com</email>
</author>
<published>2016-04-27T16:18:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2482bc31ca8096241b8fa97610ef23154ce55f45'/>
<id>urn:sha1:2482bc31ca8096241b8fa97610ef23154ce55f45</id>
<content type='text'>
The sti-cpufreq does unconditional registration of the cpufreq-dt driver
which causes issue on an multi-platform build. For example, on Vexpress
TC2 platform, we get the following error on boot:

cpu cpu0: OPP-v2 not supported
cpu cpu0: Not doing voltage scaling
cpu: dev_pm_opp_of_cpumask_add_table: couldn't find opp table
	for cpu:0, -19
cpu cpu0: dev_pm_opp_get_max_volt_latency: Invalid regulator (-6)
...
arm_big_little: bL_cpufreq_register: Failed registering platform driver:
		vexpress-spc, err: -17

The actual driver fails to initialise as cpufreq-dt is probed
successfully, which is incorrect. This issue can happen to any platform
not using cpufreq-dt in a multi-platform build.

This patch adds a check to do selective initialization of the driver.

Fixes: ab0ea257fc58 (cpufreq: st: Provide runtime initialised driver for ST's platforms)
Signed-off-by: Sudeep Holla &lt;sudeep.holla@arm.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Acked-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Cc: 4.5+ &lt;stable@vger.kernel.org&gt; # 4.5+
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Fix processing for turbo activation ratio</title>
<updated>2016-04-25T21:39:09Z</updated>
<author>
<name>Srinivas Pandruvada</name>
<email>srinivas.pandruvada@linux.intel.com</email>
</author>
<published>2016-04-23T02:53:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1becf03545a0859ceaaf9e8c2d9861882a71cb01'/>
<id>urn:sha1:1becf03545a0859ceaaf9e8c2d9861882a71cb01</id>
<content type='text'>
When the config TDP level is not nominal (level = 0), the MSR values for
reading level 1 and level 2 ratios contain power in low 14 bits and actual
ratio bits are at bits [23:16]. The current processing for level 1 and
level 2 is wrong as there is no shift done to get actual ratio.

Fixes: 6a35fc2d6c22 (cpufreq: intel_pstate: get P1 from TAR when available)
Signed-off-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
Cc: 4.4+ &lt;stable@vger.kernel.org&gt; # 4.4+
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>Revert "cpufreq: governor: Fix negative idle_time when configured with CONFIG_HZ_PERIODIC"</title>
<updated>2016-04-25T00:39:20Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2016-04-21T18:57:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=94862a62dfe3ba1c7601115a2dc80721c5b256f0'/>
<id>urn:sha1:94862a62dfe3ba1c7601115a2dc80721c5b256f0</id>
<content type='text'>
Revert commit 0df35026c6a5 (cpufreq: governor: Fix negative idle_time
when configured with CONFIG_HZ_PERIODIC) that introduced a regression
by causing the ondemand cpufreq governor to misbehave for
CONFIG_TICK_CPU_ACCOUNTING unset (the frequency goes up to the max at
one point and stays there indefinitely).

The revert takes subsequent modifications of the code in question into
account.

Fixes: 0df35026c6a5 (cpufreq: governor: Fix negative idle_time when configured with CONFIG_HZ_PERIODIC)
Link: https://bugzilla.kernel.org/show_bug.cgi?id=115261
Reported-and-tested-by: Timo Valtoaho &lt;timo.valtoaho@gmail.com&gt;
Cc: 4.5+ &lt;stable@vger.kernel.org&gt; # 4.5+
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'pm-cpufreq-fixes'</title>
<updated>2016-04-21T18:57:46Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2016-04-21T18:57:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=395da1259ac3e3fdc70636a854c993ddb76c6169'/>
<id>urn:sha1:395da1259ac3e3fdc70636a854c993ddb76c6169</id>
<content type='text'>
* pm-cpufreq-fixes:
  cpufreq: Abort cpufreq_update_current_freq() for cpufreq_suspended set
  intel_pstate: Avoid getting stuck in high P-states when idle
</content>
</entry>
<entry>
<title>cpufreq: Abort cpufreq_update_current_freq() for cpufreq_suspended set</title>
<updated>2016-04-18T21:47:42Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2016-04-10T03:59:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c9d9c929e6741118776eb0f385339d3c2b84d5f8'/>
<id>urn:sha1:c9d9c929e6741118776eb0f385339d3c2b84d5f8</id>
<content type='text'>
Since governor operations are generally skipped if cpufreq_suspended
is set, cpufreq_start_governor() should do nothing in that case.

That function is called in the cpufreq_online() path, and may also
be called from cpufreq_offline() in some cases, which are invoked
by the nonboot CPUs disabing/enabling code during system suspend
to RAM and resume.  That happens when all devices have been
suspended, so if the cpufreq driver relies on things like I2C to
get the current frequency, it may not be ready to do that then.

To prevent problems from happening for this reason, make
cpufreq_update_current_freq(), which is the only function invoked
by cpufreq_start_governor() that doesn't check cpufreq_suspended
already, return 0 upfront if cpufreq_suspended is set.

Fixes: 3bbf8fe3ae08 (cpufreq: Always update current frequency before startig governor)
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
</entry>
<entry>
<title>intel_pstate: Avoid getting stuck in high P-states when idle</title>
<updated>2016-04-10T03:59:10Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2016-04-10T03:59:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ffb810563c0c049872a504978e06c8892104fb6c'/>
<id>urn:sha1:ffb810563c0c049872a504978e06c8892104fb6c</id>
<content type='text'>
Jörg Otte reports that commit a4675fbc4a7a (cpufreq: intel_pstate:
Replace timers with utilization update callbacks) caused the CPUs in
his Haswell-based system to stay in the very high frequency region
even if the system is completely idle.

That turns out to be an existing problem in the intel_pstate driver's
P-state selection algorithm for Core processors.  Namely, all
decisions made by that algorithm are based on the average frequency
of the CPU between sampling events and on the P-state requested on
the last invocation, so it may get stuck at a very hight frequency
even if the utilization of the CPU is very low (in fact, it may get
stuck in a inadequate P-state regardless of the CPU utilization).
The only way to kick it out of that limbo is a sufficiently long idle
period (3 times longer than the prescribed sampling interval), but if
that doesn't happen often enough (eg. due to a timing change like
after the above commit), the P-state of the CPU may be inadequate
pretty much all the time.

To address the most egregious manifestations of that issue, reset the
core_busy value used to determine the next P-state to request if the
utilization of the CPU, determined with the help of the MPERF
feedback register and the TSC, is below 1%.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=115771
Reported-and-tested-by: Jörg Otte &lt;jrg.otte@gmail.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
