<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/cpufreq/cpufreq.c, branch linux-5.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-07-14T14:59:42Z</updated>
<entry>
<title>cpufreq: Make cpufreq_online() call driver-&gt;offline() on errors</title>
<updated>2021-07-14T14:59:42Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2021-06-22T19:11:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ba9e414132ad0f0778b5128fbe2f606429b17486'/>
<id>urn:sha1:ba9e414132ad0f0778b5128fbe2f606429b17486</id>
<content type='text'>
[ Upstream commit 3b7180573c250eb6e2a7eec54ae91f27472332ea ]

In the CPU removal path the -&gt;offline() callback provided by the
driver is always invoked before -&gt;exit(), but in the cpufreq_online()
error path it is not, so -&gt;exit() is expected to somehow know the
context in which it has been called and act accordingly.

That is less than straightforward, so make cpufreq_online() invoke
the driver's -&gt;offline() callback, if present, on errors before
-&gt;exit() too.

This only potentially affects intel_pstate.

Fixes: 91a12e91dc39 ("cpufreq: Allow light-weight tear down and bring up of CPUs")
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>cpufreq: Fix typo in kerneldoc comment</title>
<updated>2021-02-19T15:17:11Z</updated>
<author>
<name>Yue Hu</name>
</author>
<published>2021-02-18T09:53:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4e6df217b73e4e76a3f08d6b905790e5445db63e'/>
<id>urn:sha1:4e6df217b73e4e76a3f08d6b905790e5445db63e</id>
<content type='text'>
Change 'Terget' to 'Target'.

Should be Target.

Signed-off-by: Yue Hu &lt;huyue2@yulong.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
[ rjw: Subject edits ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: Remove CPUFREQ_STICKY flag</title>
<updated>2021-02-04T18:23:20Z</updated>
<author>
<name>Viresh Kumar</name>
</author>
<published>2021-02-02T04:55:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5ae4a4b45d4396aa7f7c008c4ae9eca981d43f8c'/>
<id>urn:sha1:5ae4a4b45d4396aa7f7c008c4ae9eca981d43f8c</id>
<content type='text'>
During cpufreq driver's registration, if the -&gt;init() callback for all
the CPUs fail then there is not much point in keeping the driver around
as it will only account for more of unnecessary noise, for example
cpufreq core will try to suspend/resume the driver which never got
registered properly.

The removal of such a driver is avoided if the driver carries the
CPUFREQ_STICKY flag. This was added way back [1] in 2004 and perhaps no
one should ever need it now. A lot of drivers do set this flag, probably
because they just copied it from other drivers.

This was added earlier for some platforms [2] because their cpufreq
drivers were getting registered before the CPUs were registered with
subsys framework. And hence they used to fail.

The same isn't true anymore though. The current code flow in the kernel
is:

start_kernel()
-&gt; kernel_init()
   -&gt; kernel_init_freeable()
      -&gt; do_basic_setup()
         -&gt; driver_init()
            -&gt; cpu_dev_init()
               -&gt; subsys_system_register() //For CPUs

         -&gt; do_initcalls()
            -&gt; cpufreq_register_driver()

Clearly, the CPUs will always get registered with subsys framework
before any cpufreq driver can get probed. Remove the flag and update the
relevant drivers.

Link: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/include/linux/cpufreq.h?id=7cc9f0d9a1ab04cedc60d64fd8dcf7df224a3b4d # [1]
Link: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/arch/arm/mach-sa1100/cpu-sa1100.c?id=f59d3bbe35f6268d729f51be82af8325d62f20f5 # [2]
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: Add special-purpose fast-switching callback for drivers</title>
<updated>2020-12-15T18:24:18Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2020-12-14T20:08:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ee2cc4276ba4909438f5894a218877660e1536d9'/>
<id>urn:sha1:ee2cc4276ba4909438f5894a218877660e1536d9</id>
<content type='text'>
First off, some cpufreq drivers (eg. intel_pstate) can pass hints
beyond the current target frequency to the hardware and there are no
provisions for doing that in the cpufreq framework.  In particular,
today the driver has to assume that it should not allow the frequency
to fall below the one requested by the governor (or the required
capacity may not be provided) which may not be the case and which may
lead to excessive energy usage in some scenarios.

Second, the hints passed by these drivers to the hardware need not be
in terms of the frequency, so representing the utilization numbers
coming from the scheduler as frequency before passing them to those
drivers is not really useful.

Address the two points above by adding a special-purpose replacement
for the -&gt;fast_switch callback, called -&gt;adjust_perf, allowing the
governor to pass abstract performance level (rather than frequency)
values for the minimum (required) and target (desired) performance
along with the CPU capacity to compare them to.

Also update the schedutil governor to use the new callback instead
of -&gt;fast_switch if present and if the utilization mertics are
frequency-invariant (that is requisite for the direct mapping
between the utilization and the CPU performance levels to be a
reasonable approximation).

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: Fix cpufreq_online() return value on errors</title>
<updated>2020-12-11T18:54:17Z</updated>
<author>
<name>Wang ShaoBo</name>
</author>
<published>2020-11-26T01:12:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b96f038432362a20b96d4c52cefeb2936e2cfd2f'/>
<id>urn:sha1:b96f038432362a20b96d4c52cefeb2936e2cfd2f</id>
<content type='text'>
Make cpufreq_online() return negative error codes on all errors that
cause the policy to be destroyed, as appropriate.

Signed-off-by: Wang ShaoBo &lt;bobo.shaobowang@huawei.com&gt;
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: Fix up several kerneldoc comments</title>
<updated>2020-12-11T18:54:08Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2020-11-18T19:02:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ec06e586ab921f8eca86d6c3ed32bffefd3ef50f'/>
<id>urn:sha1:ec06e586ab921f8eca86d6c3ed32bffefd3ef50f</id>
<content type='text'>
Fix up the remaining kerneldoc comments that don't adhere to the
expected format and clarify some of them a bit.

No functional changes.

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 back cpufreq updates for v5.11.</title>
<updated>2020-11-16T12:20:31Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2020-11-16T12:20:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ef7ece9a9b1fde9cf6a455981a0f39e342ee0f8c'/>
<id>urn:sha1:ef7ece9a9b1fde9cf6a455981a0f39e342ee0f8c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>cpufreq: Add strict_target to struct cpufreq_policy</title>
<updated>2020-11-10T17:31:17Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2020-11-10T17:26:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ea9364bbadf11f0c55802cf11387d74f524cee84'/>
<id>urn:sha1:ea9364bbadf11f0c55802cf11387d74f524cee84</id>
<content type='text'>
Add a new field to be set when the CPUFREQ_GOV_STRICT_TARGET flag is
set for the current governor to struct cpufreq_policy, so that the
drivers needing to check CPUFREQ_GOV_STRICT_TARGET do not have to
access the governor object during every frequency transition.

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: Introduce governor flags</title>
<updated>2020-11-10T17:31:17Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2020-11-10T17:25:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9a2a9ebc0a758d887ee06e067e9f7f0b36ff7574'/>
<id>urn:sha1:9a2a9ebc0a758d887ee06e067e9f7f0b36ff7574</id>
<content type='text'>
A new cpufreq governor flag will be added subsequently, so replace
the bool dynamic_switching fleid in struct cpufreq_governor with a
flags field and introduce CPUFREQ_GOV_DYNAMIC_SWITCHING to set for
the "dynamic switching" governors instead of it.

No intentional functional impact.

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: Drop restore_freq from struct cpufreq_policy</title>
<updated>2020-11-02T17:32:39Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2020-10-22T11:57:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=56a7ff75cd08987812209971e319f78156ea2bb1'/>
<id>urn:sha1:56a7ff75cd08987812209971e319f78156ea2bb1</id>
<content type='text'>
The restore_freq field in struct cpufreq_policy is only used by
__target_index() in one place and a local variable in that function
may as well be used instead of it, so drop it and modify
__target_index() accordingly.

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>
</feed>
