<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/cpufreq/cppc_cpufreq.c, branch v5.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=v5.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-07-30T05:27:47Z</updated>
<entry>
<title>cpufreq: CPPC: Reuse caps variable in few routines</title>
<updated>2020-07-30T05:27:47Z</updated>
<author>
<name>Xin Hao</name>
<email>xhao@linux.alibaba.com</email>
</author>
<published>2020-07-01T03:26:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4264e02d3e1865549952abe2b6d7c61a1e07ca62'/>
<id>urn:sha1:4264e02d3e1865549952abe2b6d7c61a1e07ca62</id>
<content type='text'>
The 'caps' variable has been defined in cppc_cpufreq_khz_to_perf() and
cppc_cpufreq_perf_to_khz() routines, so there is no need to get
'highest_perf' value through 'cpu-&gt;caps.highest_perf', we can use
'caps-&gt;highest_perf' instead.

Signed-off-by: Xin Hao &lt;xhao@linux.alibaba.com&gt;
[ Viresh: Updated commit log ]
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
</entry>
<entry>
<title>cpufreq: cppc: Reorder code and remove apply_hisi_workaround variable</title>
<updated>2020-07-30T05:27:46Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2020-06-23T05:08:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d88b0f0edb9041be6feff98e83cd6002e4ab534e'/>
<id>urn:sha1:d88b0f0edb9041be6feff98e83cd6002e4ab534e</id>
<content type='text'>
With the current approach we have an extra check in the
cppc_cpufreq_get_rate() callback, which checks if hisilicon's get rate
implementation should be used instead. While it works fine, the approach
isn't very straight forward, over that we have an extra check in the
routine.

Rearrange code and update the cpufreq driver's get() callback pointer
directly for the hisilicon case. This gets the extra variable is removed
and the extra check isn't required anymore as well.

Tested-by: Xiongfeng Wang &lt;wangxiongfeng2@huawei.com&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
</content>
</entry>
<entry>
<title>cpufreq: CPPC: add SW BOOST support</title>
<updated>2020-06-05T12:20:02Z</updated>
<author>
<name>Xiongfeng Wang</name>
<email>wangxiongfeng2@huawei.com</email>
</author>
<published>2020-05-30T02:08:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=54e74df5d76dea824c7c0c9d1b97150bf9b33793'/>
<id>urn:sha1:54e74df5d76dea824c7c0c9d1b97150bf9b33793</id>
<content type='text'>
To add SW BOOST support for CPPC, we need to get the max frequency of
boost mode and non-boost mode. ACPI spec 6.2 section 8.4.7.1 describes
the following two CPC registers.

"Highest performance is the absolute maximum performance an individual
processor may reach, assuming ideal conditions. This performance level
may not be sustainable for long durations, and may only be achievable if
other platform components are in a specific state; for example, it may
require other processors be in an idle state.

Nominal Performance is the maximum sustained performance level of the
processor, assuming ideal operating conditions. In absence of an
external constraint (power, thermal, etc.) this is the performance level
the platform is expected to be able to maintain continuously. All
processors are expected to be able to sustain their nominal performance
state simultaneously."

To add SW BOOST support for CPPC, we can use Highest Performance as the
max performance in boost mode and Nominal Performance as the max
performance in non-boost mode. If the Highest Performance is greater
than the Nominal Performance, we assume SW BOOST is supported.

The current CPPC driver does not support SW BOOST and use 'Highest
Performance' as the max performance the CPU can achieve. 'Nominal
Performance' is used to convert 'performance' to 'frequency'. That
means, if firmware enable boost and provide a value for Highest
Performance which is greater than Nominal Performance, boost feature is
enabled by default.

Because SW BOOST is disabled by default, so, after this patch, boost
feature is disabled by default even if boost is enabled by firmware.

Signed-off-by: Xiongfeng Wang &lt;wangxiongfeng2@huawei.com&gt;
Suggested-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
[ rjw: Subject ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: Avoid creating excessively large stack frames</title>
<updated>2020-01-27T09:33:33Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2020-01-26T22:40:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1e4f63aecb53e48468661e922fc2fa3b83e55722'/>
<id>urn:sha1:1e4f63aecb53e48468661e922fc2fa3b83e55722</id>
<content type='text'>
In the process of modifying a cpufreq policy, the cpufreq core makes
a copy of it including all of the internals which is stored on the
CPU stack.  Because struct cpufreq_policy is relatively large, this
may cause the size of the stack frame to exceed the 2 KB limit and
so the GCC complains when -Wframe-larger-than= is used.

In fact, it is not necessary to copy the entire policy structure
in order to modify it, however.

First, because cpufreq_set_policy() obtains the min and max policy
limits from frequency QoS now, it is not necessary to pass the limits
to it from the callers.  The only things that need to be passed to it
from there are the new governor pointer or (if there is a built-in
governor in the driver) the "policy" value representing the governor
choice.  They both can be passed as individual arguments, though, so
make cpufreq_set_policy() take them this way and rework its callers
accordingly.  This avoids making copies of cpufreq policies in the
callers of cpufreq_set_policy().

Second, cpufreq_set_policy() still needs to pass the new policy
data to the -&gt;verify() callback of the cpufreq driver whose task
is to sanitize the min and max policy limits.  It still does not
need to make a full copy of struct cpufreq_policy for this purpose,
but it needs to pass a few items from it to the driver in case they
are needed (different drivers have different needs in that respect
and all of them have to be covered).  For this reason, introduce
struct cpufreq_policy_data to hold copies of the members of
struct cpufreq_policy used by the existing -&gt;verify() driver
callbacks and pass a pointer to a temporary structure of that
type to -&gt;verify() (instead of passing a pointer to full struct
cpufreq_policy to it).

While at it, notice that intel_pstate and longrun don't really need
to verify the "policy" value in struct cpufreq_policy, so drop those
check from them to avoid copying "policy" into struct
cpufreq_policy_data (which allows it to be slightly smaller).

Also while at it fix up white space in a couple of places and make
cpufreq_set_policy() static (as it can be so).

Fixes: 3000ce3c52f8 ("cpufreq: Use per-policy frequency QoS")
Link: https://lore.kernel.org/linux-pm/CAMuHMdX6-jb1W8uC2_237m8ctCpsnGp=JCxqt8pCWVqNXHmkVg@mail.gmail.com
Reported-by: kbuild test robot &lt;lkp@intel.com&gt;
Reported-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Cc: 5.4+ &lt;stable@vger.kernel.org&gt; # 5.4+
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: CPPC: put ACPI table after using it</title>
<updated>2019-12-29T21:17:26Z</updated>
<author>
<name>Hanjun Guo</name>
<email>guohanjun@huawei.com</email>
</author>
<published>2019-12-24T01:56:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=80e8b1e59f0399b94a6088bcb9477bd798cc5eba'/>
<id>urn:sha1:80e8b1e59f0399b94a6088bcb9477bd798cc5eba</id>
<content type='text'>
Put the ACPI table to release the table mapping after using it
successfully.

Signed-off-by: Hanjun Guo &lt;guohanjun@huawei.com&gt;
[ rjw: Subject &amp; changelog ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq : CPPC: Break out if HiSilicon CPPC workaround is matched</title>
<updated>2019-12-29T21:17:26Z</updated>
<author>
<name>Hanjun Guo</name>
<email>guohanjun@huawei.com</email>
</author>
<published>2019-12-24T01:56:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c740237937c039c06e9cda32b9a37dde8b0d1e63'/>
<id>urn:sha1:c740237937c039c06e9cda32b9a37dde8b0d1e63</id>
<content type='text'>
Bail out if we match the OEM information, to save some possible
extra iteration.

Also update the code to fix minor coding style issue.

Signed-off-by: Hanjun Guo &lt;guohanjun@huawei.com&gt;
[ rjw: Subject ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441</title>
<updated>2019-06-05T15:37:17Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-06-01T08:08:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b886d83c5b621abc84ff9616f14c529be3f6b147'/>
<id>urn:sha1:b886d83c5b621abc84ff9616f14c529be3f6b147</id>
<content type='text'>
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license as published by
  the free software foundation version 2 of the license

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 315 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Reviewed-by: Armijn Hemel &lt;armijn@tjaldur.nl&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190531190115.503150771@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>cpufreq / cppc: Work around for Hisilicon CPPC cpufreq</title>
<updated>2019-02-18T10:27:42Z</updated>
<author>
<name>Xiongfeng Wang</name>
<email>wangxiongfeng2@huawei.com</email>
</author>
<published>2019-02-17T03:54:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6c8d750f9784cef32a8cffdad74c8a351b4ca3a6'/>
<id>urn:sha1:6c8d750f9784cef32a8cffdad74c8a351b4ca3a6</id>
<content type='text'>
Hisilicon chips do not support delivered performance counter register
and reference performance counter register. But the platform can
calculate the real performance using its own method. We reuse the
desired performance register to store the real performance calculated by
the platform. After the platform finished the frequency adjust, it gets
the real performance and writes it into desired performance register. Os
can use it to calculate the real frequency.

Signed-off-by: Xiongfeng Wang &lt;wangxiongfeng2@huawei.com&gt;
[ rjw: Drop unnecessary braces ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq / CPPC: Mark acpi_ids as used</title>
<updated>2018-10-03T11:36:27Z</updated>
<author>
<name>Nathan Chancellor</name>
<email>natechancellor@gmail.com</email>
</author>
<published>2018-10-02T22:34:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8ff3c22688ff3616ee53c5c54b3ee66a73326175'/>
<id>urn:sha1:8ff3c22688ff3616ee53c5c54b3ee66a73326175</id>
<content type='text'>
Clang warns:

drivers/cpufreq/cppc_cpufreq.c:431:36: warning: variable 'cppc_acpi_ids'
is not needed and will not be emitted [-Wunneeded-internal-declaration]
static const struct acpi_device_id cppc_acpi_ids[] = {
                                   ^
1 warning generated.

Mark the definition as used so that Clang understands we don't want this
warning while not inhibiting Clang's dead code elimination from removing
the unreferenced internal symbol when moving the data it contains to the
globally available symbol via MODULE_DEVICE_TABLE.

$ nm -S drivers/cpufreq/cppc_cpufreq.o | grep acpi | tail -1
0000000000000000 0000000000000040 R __mod_acpi__cppc_acpi_ids_device_table

Suggested-by: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Reviewed-by: Nick Desaulniers &lt;ndesaulniers@google.com&gt;
Signed-off-by: Nathan Chancellor &lt;natechancellor@gmail.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq / CPPC: Add cpuinfo_cur_freq support for CPPC</title>
<updated>2018-07-18T08:13:16Z</updated>
<author>
<name>George Cherian</name>
<email>george.cherian@cavium.com</email>
</author>
<published>2018-07-12T06:07:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=33477d84c26bbfa626da2c032e567a90dd70a528'/>
<id>urn:sha1:33477d84c26bbfa626da2c032e567a90dd70a528</id>
<content type='text'>
Per Section 8.4.7.1.3 of ACPI 6.2, the platform provides performance
feedback via set of performance counters. To determine the actual
performance level delivered over time, OSPM may read a set of
performance counters from the Reference Performance Counter Register
and the Delivered Performance Counter Register.

OSPM calculates the delivered performance over a given time period by
taking a beginning and ending snapshot of both the reference and
delivered performance counters, and calculating:

delivered_perf = reference_perf X (delta of delivered_perf counter / delta of reference_perf counter).

Implement the above and hook this up to the cpufreq-&gt;get method.

Signed-off-by: George Cherian &lt;george.cherian@cavium.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Acked-by: Prashanth Prakash &lt;pprakash@codeaurora.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
