<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/cpufreq, branch v4.9</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.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-10-28T23:29:17Z</updated>
<entry>
<title>Merge branches 'pm-cpufreq-fixes' and 'pm-sleep-fixes'</title>
<updated>2016-10-28T23:29:17Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2016-10-28T23:29:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8b2ada27dc1045e8191673bf769a1136ce8a0127'/>
<id>urn:sha1:8b2ada27dc1045e8191673bf769a1136ce8a0127</id>
<content type='text'>
* pm-cpufreq-fixes:
  cpufreq: intel_pstate: Always set max P-state in performance mode
  cpufreq: intel_pstate: Set P-state upfront in performance mode

* pm-sleep-fixes:
  PM / suspend: Fix missing KERN_CONT for suspend message
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Always set max P-state in performance mode</title>
<updated>2016-10-24T21:20:25Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2016-10-24T21:20:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2f1d407adab026b34a105ed27b1d4d7e910c4448'/>
<id>urn:sha1:2f1d407adab026b34a105ed27b1d4d7e910c4448</id>
<content type='text'>
The only times at which intel_pstate checks the policy set for
a given CPU is the initialization of that CPU and updates of its
policy settings from cpufreq when intel_pstate_set_policy() is
invoked.

That is insufficient, however, because intel_pstate uses the same
P-state selection function for all CPUs regardless of the policy
setting for each of them and the P-state limits are shared between
them.  Thus if the policy is set to "performance" for a particular
CPU, it may not behave as expected if the cpufreq settings are
changed subsequently for another CPU.

That can be easily demonstrated by writing "performance" to
scaling_governor for all CPUs and then switching it to "powersave"
for one of them in which case all of the CPUs will behave as though
their scaling_governor were all "powersave" (even though the policy
still appears to be "performance" for the remaining CPUs).

Fix this problem by modifying intel_pstate_adjust_busy_pstate() to
always set the P-state to the maximum allowed by the current limits
for all CPUs whose policy is set to "performance".

Note that it still is recommended to always change the policy setting
in the same way for all CPUs even with this fix applied to avoid
confusion.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Set P-state upfront in performance mode</title>
<updated>2016-10-21T20:18:22Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2016-10-19T00:57:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a6c6ead14183ea4ec8ce7551e1f3451024b9c4db'/>
<id>urn:sha1:a6c6ead14183ea4ec8ce7551e1f3451024b9c4db</id>
<content type='text'>
After commit a4675fbc4a7a (cpufreq: intel_pstate: Replace timers with
utilization update callbacks) the cpufreq governor callbacks may not
be invoked on NOHZ_FULL CPUs and, in particular, switching to the
"performance" policy via sysfs may not have any effect on them.  That
is a problem, because it usually is desirable to squeeze the last
bit of performance out of those CPUs, so work around it by setting
the maximum P-state (within the limits) in intel_pstate_set_policy()
upfront when the policy is CPUFREQ_POLICY_PERFORMANCE.

Fixes: a4675fbc4a7a (cpufreq: intel_pstate: Replace timers with utilization update callbacks)
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'pm-extra-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm</title>
<updated>2016-10-14T19:46:13Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-10-14T19:46:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ef98988ba369da88bab8a4d457407e71bbe160fa'/>
<id>urn:sha1:ef98988ba369da88bab8a4d457407e71bbe160fa</id>
<content type='text'>
Pull more power management updates from Rafael Wysocki:
 "This includes a couple of fixes for cpufreq regressions introduced in
  4.8, a rework of the intel_pstate algorithm used on Atom processors
  (that took some time to test) plus a fix and a couple of cleanups in
  that driver, a CPPC cpufreq driver fix, and a some devfreq fixes and
  cleanups (core and exynos-nocp).

  Specifics:

   - Fix two cpufreq regressions causing undesirable changes in behavior
     to appear (one in the core and one in the conservative governor)
     introduced during the 4.8 cycle (Aaro Koskinen, Rafael Wysocki).

   - Fix the way the intel_pstate driver accesses MSRs related to the
     hardware-managed P-states (HWP) feature during the initialization
     which currently is unsafe and may cause the processor to generate a
     general protection fault (Srinivas Pandruvada).

   - Rework the intel_pstate's P-state selection algorithm used on Atom
     processors to avoid known problems with the current one and to make
     the computation more straightforward, which also happens to improve
     performance in multiple benchmarks a bit (Rafael Wysocki).

   - Improve two comments in the intel_pstate driver (Rafael Wysocki).

   - Fix the desired performance computation in the CPPC cpufreq driver
     (Hoan Tran).

   - Fix the devfreq core to avoid printing misleading error messages in
     some cases (Tobias Jakobi).

   - Fix the error code path in devfreq_add_device() to use proper
     locking around list modifications (Axel Lin).

   - Fix a build failure and remove a couple of redundant updates of
     variables in the exynos-nocp devfreq driver (Axel Lin)"

* tag 'pm-extra-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: CPPC: Correct desired_perf calculation
  cpufreq: conservative: Fix next frequency selection
  cpufreq: skip invalid entries when searching the frequency
  cpufreq: intel_pstate: Fix struct pstate_adjust_policy kerneldoc
  cpufreq: intel_pstate: Proportional algorithm for Atom
  PM / devfreq: Skip status update on uninitialized previous_freq
  PM / devfreq: Add proper locking around list_del()
  PM / devfreq: exynos-nocp: Remove redundant code
  PM / devfreq: exynos-nocp: Select REGMAP_MMIO
  cpufreq: intel_pstate: Clarify comment in get_target_pstate_use_performance()
  cpufreq: intel_pstate: Fix unsafe HWP MSR access
</content>
</entry>
<entry>
<title>cpufreq: CPPC: Correct desired_perf calculation</title>
<updated>2016-10-13T21:10:41Z</updated>
<author>
<name>Hoan Tran</name>
<email>hotran@apm.com</email>
</author>
<published>2016-10-13T17:33:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c197d758036d8c77923ae3f88571cf198283107e'/>
<id>urn:sha1:c197d758036d8c77923ae3f88571cf198283107e</id>
<content type='text'>
The desired_perf is an abstract performance number. Its value should
be in the range of [lowest perf, highest perf] of CPPC.
The correct calculation is
  desired_perf = freq * cppc_highest_perf / cppc_dmi_max_khz

And cppc_cpufreq_set_target() returns if desired_perf is exactly
the same with the old perf.

Signed-off-by: Hoan Tran &lt;hotran@apm.com&gt;
Reviewed-by: Prashanth Prakash &lt;pprakash@codeaurora.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: conservative: Fix next frequency selection</title>
<updated>2016-10-13T12:42:06Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2016-10-12T19:47:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=abb6627910a1e783c8e034b35b7c80e5e7f98f41'/>
<id>urn:sha1:abb6627910a1e783c8e034b35b7c80e5e7f98f41</id>
<content type='text'>
Commit d352cf47d93e (cpufreq: conservative: Do not use transition
notifications) overlooked the case when the "frequency step" used
by the conservative governor is small relative to the distances
between the available frequencies and broke the algorithm by
using policy-&gt;cur instead of the previously requested frequency
when computing the next one.

As a result, the governor may not be able to go outside of a narrow
range between two consecutive available frequencies.

Fix the problem by making the governor save the previously requested
frequency and select the next one relative that value (unless it is
out of range, in which case policy-&gt;cur will be used instead).

Fixes: d352cf47d93e (cpufreq: conservative: Do not use transition notifications)
Link: https://bugzilla.kernel.org/show_bug.cgi?id=177171
Reported-and-tested-by: Aleksey Rybalkin &lt;aleksey@rybalkin.org&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Cc: 4.8+ &lt;stable@vger.kernel.org&gt; # 4.8+
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Fix struct pstate_adjust_policy kerneldoc</title>
<updated>2016-10-12T18:58:14Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2016-10-11T21:07:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3954517e2f083c8aeb52bfd467b7b2c164232ffc'/>
<id>urn:sha1:3954517e2f083c8aeb52bfd467b7b2c164232ffc</id>
<content type='text'>
It looks like the name of struct pstate_adjust_policy was updated
without updating its kerneldoc comment accordingly, so fix that
mistake.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Proportional algorithm for Atom</title>
<updated>2016-10-12T18:58:13Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2016-10-06T12:07:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0843e83c1a4aa67e08f424430526c948d591d5f1'/>
<id>urn:sha1:0843e83c1a4aa67e08f424430526c948d591d5f1</id>
<content type='text'>
The PID algorithm used by the intel_pstate driver tends to drive
performance to the minimum for workloads with utilization below the
setpoint, which is undesirable, so replace it with a modified
"proportional" algorithm on Atom.

The new algorithm will set the new P-state to be 1.25 times the
available maximum times the (frequency-invariant) utilization during
the previous sampling period except when the target P-state computed
this way is lower than the average P-state during the previous
sampling period.  In the latter case, it will increase the target by
50% of the difference between it and the average P-state to prevent
performance from dropping down too fast in some cases.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Tested-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Clarify comment in get_target_pstate_use_performance()</title>
<updated>2016-10-09T16:54:57Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2016-09-30T01:13:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f00593a4bdd22e0885db89df8ee8afcc6867994f'/>
<id>urn:sha1:f00593a4bdd22e0885db89df8ee8afcc6867994f</id>
<content type='text'>
Make the comment explaining the meaning of the perf_scaled variable
in get_target_pstate_use_performance() more straightforward.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Fix unsafe HWP MSR access</title>
<updated>2016-10-09T16:54:13Z</updated>
<author>
<name>Srinivas Pandruvada</name>
<email>srinivas.pandruvada@linux.intel.com</email>
</author>
<published>2016-10-08T19:42:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f9f4872df6e1801572949f8a370c886122d4b6da'/>
<id>urn:sha1:f9f4872df6e1801572949f8a370c886122d4b6da</id>
<content type='text'>
This is a requirement that MSR MSR_PM_ENABLE must be set to 0x01 before
reading MSR_HWP_CAPABILITIES on a given CPU. If cpufreq init() is
scheduled on a CPU which is not same as policy-&gt;cpu or migrates to a
different CPU before calling msr read for MSR_HWP_CAPABILITIES, it
is possible that MSR_PM_ENABLE was not to set to 0x01 on that CPU.
This will cause GP fault. So like other places in this path
rdmsrl_on_cpu should be used instead of rdmsrl.

Moreover the scope of MSR_HWP_CAPABILITIES is on per thread basis, so it
should be read from the same CPU, for which MSR MSR_HWP_REQUEST is
getting set.

dmesg dump or warning:

[   22.014488] WARNING: CPU: 139 PID: 1 at arch/x86/mm/extable.c:50 ex_handler_rdmsr_unsafe+0x68/0x70
[   22.014492] unchecked MSR access error: RDMSR from 0x771
[   22.014493] Modules linked in:
[   22.014507] CPU: 139 PID: 1 Comm: swapper/0 Not tainted 4.7.5+ #1
...
...
[   22.014516] Call Trace:
[   22.014542]  [&lt;ffffffff813d7dd1&gt;] dump_stack+0x63/0x82
[   22.014558]  [&lt;ffffffff8107bc8b&gt;] __warn+0xcb/0xf0
[   22.014561]  [&lt;ffffffff8107bcff&gt;] warn_slowpath_fmt+0x4f/0x60
[   22.014563]  [&lt;ffffffff810676f8&gt;] ex_handler_rdmsr_unsafe+0x68/0x70
[   22.014564]  [&lt;ffffffff810677d9&gt;] fixup_exception+0x39/0x50
[   22.014604]  [&lt;ffffffff8102e400&gt;] do_general_protection+0x80/0x150
[   22.014610]  [&lt;ffffffff817f9ec8&gt;] general_protection+0x28/0x30
[   22.014635]  [&lt;ffffffff81687940&gt;] ? get_target_pstate_use_performance+0xb0/0xb0
[   22.014642]  [&lt;ffffffff810600c7&gt;] ? native_read_msr+0x7/0x40
[   22.014657]  [&lt;ffffffff81688123&gt;] intel_pstate_hwp_set+0x23/0x130
[   22.014660]  [&lt;ffffffff81688406&gt;] intel_pstate_set_policy+0x1b6/0x340
[   22.014662]  [&lt;ffffffff816829bb&gt;] cpufreq_set_policy+0xeb/0x2c0
[   22.014664]  [&lt;ffffffff81682f39&gt;] cpufreq_init_policy+0x79/0xe0
[   22.014666]  [&lt;ffffffff81682cb0&gt;] ? cpufreq_update_policy+0x120/0x120
[   22.014669]  [&lt;ffffffff816833a6&gt;] cpufreq_online+0x406/0x820
[   22.014671]  [&lt;ffffffff8168381f&gt;] cpufreq_add_dev+0x5f/0x90
[   22.014717]  [&lt;ffffffff81530ac8&gt;] subsys_interface_register+0xb8/0x100
[   22.014719]  [&lt;ffffffff816821bc&gt;] cpufreq_register_driver+0x14c/0x210
[   22.014749]  [&lt;ffffffff81fe1d90&gt;] intel_pstate_init+0x39d/0x4d5
[   22.014751]  [&lt;ffffffff81fe13f2&gt;] ? cpufreq_gov_dbs_init+0x12/0x12

Cc: 4.3+ &lt;stable@vger.kernel.org&gt; # 4.3+
Signed-off-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
