<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/cpufreq/intel_pstate.c, branch linux-4.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-07-27T22:10:23Z</updated>
<entry>
<title>cpufreq: intel_pstate: Correct the busy calculation for KNL</title>
<updated>2017-07-27T22:10:23Z</updated>
<author>
<name>Srinivas Pandruvada</name>
</author>
<published>2017-07-13T22:03:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6c8c343fa75f5ce748bb233c6abe5b038b67637c'/>
<id>urn:sha1:6c8c343fa75f5ce748bb233c6abe5b038b67637c</id>
<content type='text'>
commit 6e34e1f23d780978da65968327cbba6d7013a73f upstream.

The busy percent calculated for the Knights Landing (KNL) platform
is 1024 times smaller than the correct busy value.  This causes
performance to get stuck at the lowest ratio.

The scaling algorithm used for KNL is performance-based, but it still
looks at the CPU load to set the scaled busy factor to 0 when the
load is less than 1 percent.  In this case, since the computed load
is 1024x smaller than it should be, the scaled busy factor will
always be 0, irrespective of CPU business.

This needs a fix similar to the turbostat one in commit b2b34dfe4d9a
(tools/power turbostat: KNL workaround for %Busy and Avg_MHz).

For this reason, add one more callback to processor-specific
callbacks to specify an MPERF multiplier represented by a number of
bit positions to shift the value of that register to the left to
copmensate for its rate difference with respect to the TSC.  This
shift value is used during CPU busy calculations.

Fixes: ffb810563c (intel_pstate: Avoid getting stuck in high P-states when idle)
Reported-and-tested-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
Signed-off-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
[ rjw: Changelog ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Avoid division by 0 in min_perf_pct_min()</title>
<updated>2017-06-05T12:51:18Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2017-06-05T12:51:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=57caf4ec2b8bfbcb4f738ab5a12eedf3a8786045'/>
<id>urn:sha1:57caf4ec2b8bfbcb4f738ab5a12eedf3a8786045</id>
<content type='text'>
Commit c5a2ee7dde89 (cpufreq: intel_pstate: Active mode P-state
limits rework) incorrectly assumed that pstate.turbo_pstate would
always be nonzero for CPU0 in min_perf_pct_min() if
cpufreq_register_driver() had succeeded which may not be the case
in virtualized environments.

If that assumption doesn't hold, it leads to an early crash on boot
in intel_pstate_register_driver(), so add a sanity check to
min_perf_pct_min() to prevent the crash from happening.

Fixes: c5a2ee7dde89 (cpufreq: intel_pstate: Active mode P-state limits rework)
Reported-and-tested-by: Jongman Heo &lt;jongman.heo@samsung.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: schedutil: Use policy-dependent transition delays</title>
<updated>2017-04-17T16:37:27Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2017-04-10T22:20:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1b72e7fd304639f1cd49d1e11955c4974936d88c'/>
<id>urn:sha1:1b72e7fd304639f1cd49d1e11955c4974936d88c</id>
<content type='text'>
Make the schedutil governor take the initial (default) value of the
rate_limit_us sysfs attribute from the (new) transition_delay_us
policy parameter (to be set by the scaling driver).

That will allow scaling drivers to make schedutil use smaller default
values of rate_limit_us and reduce the default average time interval
between consecutive frequency changes.

Make intel_pstate set transition_delay_us to 500.

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>cpufreq: intel_pstate: Add support for Gemini Lake</title>
<updated>2017-03-29T20:45:32Z</updated>
<author>
<name>Box, David E</name>
</author>
<published>2017-03-29T16:45:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=630e57573efa20b586c808400005d0ebfb93fc6a'/>
<id>urn:sha1:630e57573efa20b586c808400005d0ebfb93fc6a</id>
<content type='text'>
Use same parameters as INTEL_FAM6_ATOM_GOLDMONT to enable
Gemini Lake.

Signed-off-by: Box, David E &lt;david.e.box@intel.com&gt;
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>
<entry>
<title>cpufreq: intel_pstate: Eliminate intel_pstate_get_min_max()</title>
<updated>2017-03-28T21:12:17Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2017-03-27T22:24:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b02aabe8ab9757a7dd5aa50e201a6d970f7e7a2f'/>
<id>urn:sha1:b02aabe8ab9757a7dd5aa50e201a6d970f7e7a2f</id>
<content type='text'>
Some computations in intel_pstate_get_min_max() are not necessary
and one of its two callers doesn't even use the full result.

First off, the fixed-point value of cpu-&gt;max_perf represents a
non-negative number between 0 and 1 inclusive and cpu-&gt;min_perf
cannot be greater than cpu-&gt;max_perf.  It is not necessary to check
those conditions every time the numbers in question are used.

Moreover, since intel_pstate_max_within_limits() only needs the
upper boundary, it doesn't make sense to compute the lower one in
there and returning min and max from intel_pstate_get_min_max()
via pointers doesn't look particularly nice.

For the above reasons, drop intel_pstate_get_min_max(), add a helper
to get the base P-state for min/max computations and carry out them
directly in the previous callers of intel_pstate_get_min_max().

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Do not walk policy-&gt;cpus</title>
<updated>2017-03-28T21:12:16Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2017-03-27T22:22:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2bfc4cbb5fd3848669f1b95fea793f63d8e77fa0'/>
<id>urn:sha1:2bfc4cbb5fd3848669f1b95fea793f63d8e77fa0</id>
<content type='text'>
intel_pstate_hwp_set() is the only function walking policy-&gt;cpus
in intel_pstate.  The rest of the code simply assumes one CPU per
policy, including the initialization code.

Therefore it doesn't make sense for intel_pstate_hwp_set() to
walk policy-&gt;cpus as it is guaranteed to have only one bit set
for policy-&gt;cpu.

For this reason, rearrange intel_pstate_hwp_set() to take the CPU
number as the argument and drop the loop over policy-&gt;cpus from it.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Introduce pid_in_use()</title>
<updated>2017-03-28T21:12:16Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2017-03-27T22:20:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8ca6ce37014e5a9b127fc076448eb95e2b366d05'/>
<id>urn:sha1:8ca6ce37014e5a9b127fc076448eb95e2b366d05</id>
<content type='text'>
Add a new function pid_in_use() to return the information on whether
or not the PID-based P-state selection algorithm is in use.

That allows a couple of complicated conditions in the code to be
reduced to simple checks against the new function's return value.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Drop struct cpu_defaults</title>
<updated>2017-03-28T21:12:16Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2017-03-27T22:19:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2f49afc2a6f6ec4bacb2e50d5482ecc111b41ab5'/>
<id>urn:sha1:2f49afc2a6f6ec4bacb2e50d5482ecc111b41ab5</id>
<content type='text'>
The cpu_defaults structure is redundant, because it only contains
one member of type struct pstate_funcs which can be used directly
instead of struct cpu_defaults.

For this reason, drop struct cpu_defaults, use struct pstate_funcs
directly instead of it where applicable and rename all of the
variables of that type accordingly.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Move cpu_defaults definitions</title>
<updated>2017-03-28T21:12:16Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2017-03-27T22:18:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=de4a76cb585da13f8b0c9f2161ed6fcf5f2379fc'/>
<id>urn:sha1:de4a76cb585da13f8b0c9f2161ed6fcf5f2379fc</id>
<content type='text'>
Move the definitions of the cpu_defaults structures after the
definitions of utilization update callback routines to avoid
extra declarations of the latter.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Add update_util callback to pstate_funcs</title>
<updated>2017-03-28T21:12:16Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2017-03-27T22:17:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=67dd9bf4416305811d58280dbe108d78ab573d56'/>
<id>urn:sha1:67dd9bf4416305811d58280dbe108d78ab573d56</id>
<content type='text'>
Avoid using extra function pointers during P-state selection by
dropping the get_target_pstate member from struct pstate_funcs,
adding a new update_util callback to it (to be registered with
the CPU scheduler as the utilization update callback in the active
mode) and reworking the utilization update callback routines to
invoke specific P-state selection functions directly.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
