cpufreq: amd-pstate: Add guided autonomous mode
authorWyes Karny <wyes.karny@amd.com>
Tue, 7 Mar 2023 11:27:38 +0000 (11:27 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 17 Mar 2023 18:06:23 +0000 (19:06 +0100)
commit2dd6d0ebf74049256160a3d03dabbd92fe0b8599
treeb4e11ac524326526e89b7f57cc0816611839a817
parent3e6e078057640751654bda9fd2278a944f61fa4a
cpufreq: amd-pstate: Add guided autonomous mode

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 <ray.huang@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Signed-off-by: Wyes Karny <wyes.karny@amd.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Documentation/admin-guide/kernel-parameters.txt
drivers/cpufreq/amd-pstate.c
include/linux/amd-pstate.h