cpufreq: amd-pstate: Add a kernel config option to set default mode
authorMario Limonciello <mario.limonciello@amd.com>
Tue, 20 Jun 2023 17:24:33 +0000 (12:24 -0500)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 21 Jun 2023 16:44:56 +0000 (18:44 +0200)
commitc88ad30e3f861c7be4e3b4995554e2b0754059b7
tree0ae7ddcef8bdbcc0be8583ce6506ce7e1fec1752
parent32f80b9adfdb43f8af248596724f59dde938a190
cpufreq: amd-pstate: Add a kernel config option to set default mode

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 <ray.huang@amd.com>
Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
Co-developed-by: Perry Yuan <perry.yuan@amd.com>
Signed-off-by: Perry Yuan <perry.yuan@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/Kconfig.x86
drivers/cpufreq/amd-pstate.c
include/linux/amd-pstate.h