<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/include/linux/amd-pstate.h, branch linux-rolling-stable</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2024-06-21T12:40:00Z</updated>
<entry>
<title>cpufreq: amd-pstate: remove global header file</title>
<updated>2024-06-21T12:40:00Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2024-05-28T12:09:23Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=6649e23edb3cb99d9376eabbb8978df747e07c68'/>
<id>urn:sha1:6649e23edb3cb99d9376eabbb8978df747e07c68</id>
<content type='text'>
[ Upstream commit 779b8a14afde110dd3502566be907289eba72447 ]

When extra warnings are enabled, gcc points out a global variable
definition in a header:

In file included from drivers/cpufreq/amd-pstate-ut.c:29:
include/linux/amd-pstate.h:123:27: error: 'amd_pstate_mode_string' defined but not used [-Werror=unused-const-variable=]
  123 | static const char * const amd_pstate_mode_string[] = {
      |                           ^~~~~~~~~~~~~~~~~~~~~~

This header is only included from two files in the same directory,
and one of them uses only a single definition from it, so clean it
up by moving most of the contents into the driver that uses them,
and making shared bits a local header file.

Fixes: 36c5014e5460 ("cpufreq: amd-pstate: optimize driver working mode selection in amd_pstate_param()")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>cpufreq: amd-pstate: Add quirk for the pstate CPPC capabilities missing</title>
<updated>2024-06-21T12:40:00Z</updated>
<author>
<name>Perry Yuan</name>
<email>perry.yuan@amd.com</email>
</author>
<published>2024-04-25T08:07:58Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e11d216b16d938997138c93cb402db5d6833f29c'/>
<id>urn:sha1:e11d216b16d938997138c93cb402db5d6833f29c</id>
<content type='text'>
[ Upstream commit eb8b6c36820214df96e7e86d8614d93f6b028f28 ]

Add quirks table to get CPPC capabilities issue fixed by providing
correct perf or frequency values while driver loading.

If CPPC capabilities are not defined in the ACPI tables or wrongly
defined by platform firmware, it needs to use quick to get those
issues fixed with correct workaround values to make pstate driver
can be loaded even though there are CPPC capabilities errors.

The workaround will match the broken BIOS which lack of CPPC capabilities
nominal_freq and lowest_freq definition in the ACPI table.

$ cat /sys/devices/system/cpu/cpu0/acpi_cppc/lowest_freq
0
$ cat /sys/devices/system/cpu/cpu0/acpi_cppc/nominal_freq
0

Acked-by: Huang Rui &lt;ray.huang@amd.com&gt;
Reviewed-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
Reviewed-by: Gautham R. Shenoy &lt;gautham.shenoy@amd.com&gt;
Tested-by: Dhananjay Ugwekar &lt;Dhananjay.Ugwekar@amd.com&gt;
Signed-off-by: Perry Yuan &lt;perry.yuan@amd.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Stable-dep-of: 779b8a14afde ("cpufreq: amd-pstate: remove global header file")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>cpufreq: amd-pstate: Update amd-pstate preferred core ranking dynamically</title>
<updated>2024-01-31T13:54:50Z</updated>
<author>
<name>Meng Li</name>
<email>li.meng@amd.com</email>
</author>
<published>2024-01-19T09:05:00Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e571a5e2068ef57945fcd5d0fb950f8f96da6dc8'/>
<id>urn:sha1:e571a5e2068ef57945fcd5d0fb950f8f96da6dc8</id>
<content type='text'>
Preferred core rankings can be changed dynamically by the
platform based on the workload and platform conditions and
accounting for thermals and aging.
When this occurs, cpu priority need to be set.

Tested-by: Oleksandr Natalenko &lt;oleksandr@natalenko.name&gt;
Reviewed-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
Reviewed-by: Wyes Karny &lt;wyes.karny@amd.com&gt;
Reviewed-by: Huang Rui &lt;ray.huang@amd.com&gt;
Reviewed-by: Perry Yuan &lt;perry.yuan@amd.com&gt;
Signed-off-by: Meng Li &lt;li.meng@amd.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: amd-pstate: Enable amd-pstate preferred core support</title>
<updated>2024-01-31T13:54:50Z</updated>
<author>
<name>Meng Li</name>
<email>li.meng@amd.com</email>
</author>
<published>2024-01-19T09:04:58Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f3a052391822b772b4e27f2594526cf1eb103cab'/>
<id>urn:sha1:f3a052391822b772b4e27f2594526cf1eb103cab</id>
<content type='text'>
amd-pstate driver utilizes the functions and data structures
provided by the ITMT architecture to enable the scheduler to
favor scheduling on cores which can be get a higher frequency
with lower voltage. We call it amd-pstate preferrred core.

Here sched_set_itmt_core_prio() is called to set priorities and
sched_set_itmt_support() is called to enable ITMT feature.
amd-pstate driver uses the highest performance value to indicate
the priority of CPU. The higher value has a higher priority.

The initial core rankings are set up by amd-pstate when the
system boots.

Add a variable hw_prefcore in cpudata structure. It will check
if the processor and power firmware support preferred core
feature.

Add one new early parameter `disable` to allow user to disable
the preferred core.

Only when hardware supports preferred core and user set `enabled`
in early parameter, amd pstate driver supports preferred core featue.

Tested-by: Oleksandr Natalenko &lt;oleksandr@natalenko.name&gt;
Reviewed-by: Huang Rui &lt;ray.huang@amd.com&gt;
Reviewed-by: Wyes Karny &lt;wyes.karny@amd.com&gt;
Reviewed-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
Co-developed-by: Perry Yuan &lt;Perry.Yuan@amd.com&gt;
Signed-off-by: Perry Yuan &lt;Perry.Yuan@amd.com&gt;
Signed-off-by: Meng Li &lt;li.meng@amd.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq/amd-pstate: Fix scaling_min_freq and scaling_max_freq update</title>
<updated>2023-11-29T16:40:16Z</updated>
<author>
<name>Wyes Karny</name>
<email>wyes.karny@amd.com</email>
</author>
<published>2023-11-17T06:38:39Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=febab20caebac959fdc3d7520bc52de8b1184455'/>
<id>urn:sha1:febab20caebac959fdc3d7520bc52de8b1184455</id>
<content type='text'>
When amd_pstate is running, writing to scaling_min_freq and
scaling_max_freq has no effect. These values are only passed to the
policy level, but not to the platform level. This means that the
platform does not know about the frequency limits set by the user.

To fix this, update the min_perf and max_perf values at the platform
level whenever the user changes the scaling_min_freq and scaling_max_freq
values.

Fixes: ffa5096a7c33 ("cpufreq: amd-pstate: implement Pstate EPP support for the AMD processors")
Acked-by: Huang Rui &lt;ray.huang@amd.com&gt;
Signed-off-by: Wyes Karny &lt;wyes.karny@amd.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: amd-pstate: Add a kernel config option to set default mode</title>
<updated>2023-06-21T16:44:56Z</updated>
<author>
<name>Mario Limonciello</name>
<email>mario.limonciello@amd.com</email>
</author>
<published>2023-06-20T17:24:33Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c88ad30e3f861c7be4e3b4995554e2b0754059b7'/>
<id>urn:sha1:c88ad30e3f861c7be4e3b4995554e2b0754059b7</id>
<content type='text'>
Users are having more success with amd-pstate since the introduction
of EPP and Guided modes.  To expose the driver to more users by default
introduce a kernel configuration option for setting the default mode.

Users can use an integer to map out which default mode they want to use
in lieu of a kernel command line option.

This will default to EPP, but only if:
 1) The CPU supports an MSR.
 2) The system profile is identified
 3) The system profile is identified as a non-server by the FADT.

Link: https://gitlab.freedesktop.org/hadess/power-profiles-daemon/-/merge_requests/121
Acked-by: Huang Rui &lt;ray.huang@amd.com&gt;
Reviewed-by: Gautham R. Shenoy &lt;gautham.shenoy@amd.com&gt;
Co-developed-by: Perry Yuan &lt;perry.yuan@amd.com&gt;
Signed-off-by: Perry Yuan &lt;perry.yuan@amd.com&gt;
Signed-off-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: amd-pstate: Add guided autonomous mode</title>
<updated>2023-03-17T18:06:23Z</updated>
<author>
<name>Wyes Karny</name>
<email>wyes.karny@amd.com</email>
</author>
<published>2023-03-07T11:27:38Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2dd6d0ebf74049256160a3d03dabbd92fe0b8599'/>
<id>urn:sha1:2dd6d0ebf74049256160a3d03dabbd92fe0b8599</id>
<content type='text'>
From ACPI spec below 3 modes for CPPC can be defined:

 1. Non autonomous: OS scaling governor specifies operating frequency/
    performance level through `Desired Performance` register and platform
    follows that.

 2. Guided autonomous: OS scaling governor specifies min and max
    frequencies/ performance levels through `Minimum Performance` and
    `Maximum Performance` register, and platform can autonomously select an
    operating frequency in this range.

 3. Fully autonomous: OS only hints (via EPP) to platform for the required
    energy performance preference for the workload and platform autonomously
    scales the frequency.

Currently (1) is supported by amd_pstate as passive mode, and (3) is
implemented by EPP support. This change is to support (2).

In guided autonomous mode the min_perf is based on the input from the
scaling governor. For example, in case of schedutil this value depends
on the current utilization. And max_perf is set to max capacity.

To activate guided auto mode ``amd_pstate=guided`` command line
parameter has to be passed in the kernel.

Acked-by: Huang Rui &lt;ray.huang@amd.com&gt;
Reviewed-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
Tested-by: Oleksandr Natalenko &lt;oleksandr@natalenko.name&gt;
Signed-off-by: Wyes Karny &lt;wyes.karny@amd.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: amd-pstate: implement amd pstate cpu online and offline callback</title>
<updated>2023-02-03T20:59:41Z</updated>
<author>
<name>Perry Yuan</name>
<email>Perry.Yuan@amd.com</email>
</author>
<published>2023-01-31T09:00:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d4da12f8033a123353eccf993cb95ee5bff21e7c'/>
<id>urn:sha1:d4da12f8033a123353eccf993cb95ee5bff21e7c</id>
<content type='text'>
Adds online and offline driver callback support to allow cpu cores go
offline and help to restore the previous working states when core goes
back online later for EPP driver mode.

Acked-by: Huang Rui &lt;ray.huang@amd.com&gt;
Reviewed-by: Mario Limonciello &lt;Mario.Limonciello@amd.com&gt;
Reviewed-by: Wyes Karny &lt;wyes.karny@amd.com&gt;
Tested-by: Wyes Karny &lt;wyes.karny@amd.com&gt;
Signed-off-by: Perry Yuan &lt;Perry.Yuan@amd.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: amd-pstate: implement Pstate EPP support for the AMD processors</title>
<updated>2023-02-03T20:59:41Z</updated>
<author>
<name>Perry Yuan</name>
<email>Perry.Yuan@amd.com</email>
</author>
<published>2023-01-31T09:00:09Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ffa5096a7c338641f70fb06d4778e8cf400181a8'/>
<id>urn:sha1:ffa5096a7c338641f70fb06d4778e8cf400181a8</id>
<content type='text'>
Add EPP driver support for AMD SoCs which support a dedicated MSR for
CPPC.  EPP is used by the DPM controller to configure the frequency that
a core operates at during short periods of activity.

The SoC EPP targets are configured on a scale from 0 to 255 where 0
represents maximum performance and 255 represents maximum efficiency.

The amd-pstate driver exports profile string names to userspace that are
tied to specific EPP values.

The balance_performance string (0x80) provides the best balance for
efficiency versus power on most systems, but users can choose other
strings to meet their needs as well.

$ cat /sys/devices/system/cpu/cpufreq/policy0/energy_performance_available_preferences
default performance balance_performance balance_power power

$ cat /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference
balance_performance

To enable the driver,it needs to add `amd_pstate=active` to kernel
command line and kernel will load the active mode epp driver

Acked-by: Huang Rui &lt;ray.huang@amd.com&gt;
Reviewed-by: Mario Limonciello &lt;Mario.Limonciello@amd.com&gt;
Reviewed-by: Wyes Karny &lt;wyes.karny@amd.com&gt;
Tested-by: Wyes Karny &lt;wyes.karny@amd.com&gt;
Signed-off-by: Perry Yuan &lt;Perry.Yuan@amd.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: amd-pstate: optimize driver working mode selection in amd_pstate_param()</title>
<updated>2023-02-03T20:59:41Z</updated>
<author>
<name>Wyes Karny</name>
<email>wyes.karny@amd.com</email>
</author>
<published>2023-01-31T09:00:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=36c5014e5460963ad7766487c0e22a7ff28681fc'/>
<id>urn:sha1:36c5014e5460963ad7766487c0e22a7ff28681fc</id>
<content type='text'>
The amd-pstate driver may support multiple working modes.
Introduce a variable to keep track of which mode is currently enabled.
Here we use cppc_state var to indicate which mode is enabled.
This change will help to simplify the the amd_pstate_param() to choose
which mode used for the following driver registration.

Acked-by: Huang Rui &lt;ray.huang@amd.com&gt;
Reviewed-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
Tested-by: Wyes Karny &lt;wyes.karny@amd.com&gt;
Signed-off-by: Perry Yuan &lt;perry.yuan@amd.com&gt;
Signed-off-by: Wyes Karny &lt;wyes.karny@amd.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
