diff --git a/sys/x86/cpufreq/hwpstate_amd.c b/sys/x86/cpufreq/hwpstate_amd.c --- a/sys/x86/cpufreq/hwpstate_amd.c +++ b/sys/x86/cpufreq/hwpstate_amd.c @@ -137,6 +137,11 @@ "If enabled (1), limit administrative control of P-states to the value in " "CurPstateLimit"); +static bool hwpstate_prefer_msr; +SYSCTL_BOOL(_debug, OID_AUTO, hwpstate_prefer_msr, CTLFLAG_RDTUN, + &hwpstate_prefer_msr, 0, + "If enabled (1), use MSR instead of acpi_perf for P-state information"); + static device_method_t hwpstate_methods[] = { /* Device interface */ DEVMETHOD(device_identify, hwpstate_identify), @@ -379,7 +384,7 @@ */ HWPSTATE_DEBUG(dev, "acpi_perf will take care of pstate transitions.\n"); return (ENXIO); - } else { + } else if (!hwpstate_prefer_msr) { /* * If acpi_perf has INFO_ONLY flag, (_PCT has FFixedHW) * we can get _PSS info from acpi_perf @@ -391,9 +396,9 @@ } } - if (error == 0) { + if (error == 0 && !hwpstate_prefer_msr) { /* - * Now we get _PSS info from acpi_perf without error. + * We got _PSS info from acpi_perf without error. * Let's check it. */ msr = rdmsr(MSR_AMD_10H_11H_LIMIT); @@ -408,7 +413,7 @@ * If we cannot get info from acpi_perf, * Let's get info from MSRs. */ - if (error) + if (error || hwpstate_prefer_msr) error = hwpstate_get_info_from_msr(dev); if (error) return (error);