Commit 9b7e7ff0 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branch 'pm-cpufreq'

Merge cpufreq fixes for 6.10-rc3:

 - Fix a recently introduced unchecked HWP MSR access in the
   intel_pstate driver (Srinivas Pandruvada).

 - Add missing conversion from MHz to KHz to amd_pstate_set_boost()
   to address sysfs inteface inconsistency (Dhananjay Ugwekar).

 - Get rid of an excess global header file used by the amd-pstate
   cpufreq driver (Arnd Bergmann).

* pm-cpufreq:
  cpufreq: intel_pstate: Fix unchecked HWP MSR access
  cpufreq: amd-pstate: Fix the inconsistency in max frequency units
  cpufreq: amd-pstate: remove global header file
parents 1ae08823 1e24c313
...@@ -1107,7 +1107,6 @@ L: linux-pm@vger.kernel.org ...@@ -1107,7 +1107,6 @@ L: linux-pm@vger.kernel.org
S: Supported S: Supported
F: Documentation/admin-guide/pm/amd-pstate.rst F: Documentation/admin-guide/pm/amd-pstate.rst
F: drivers/cpufreq/amd-pstate* F: drivers/cpufreq/amd-pstate*
F: include/linux/amd-pstate.h
F: tools/power/x86/amd_pstate_tracer/amd_pstate_trace.py F: tools/power/x86/amd_pstate_tracer/amd_pstate_trace.py
AMD PTDMA DRIVER AMD PTDMA DRIVER
......
...@@ -26,10 +26,11 @@ ...@@ -26,10 +26,11 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/amd-pstate.h>
#include <acpi/cppc_acpi.h> #include <acpi/cppc_acpi.h>
#include "amd-pstate.h"
/* /*
* Abbreviations: * Abbreviations:
* amd_pstate_ut: used as a shortform for AMD P-State unit test. * amd_pstate_ut: used as a shortform for AMD P-State unit test.
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/static_call.h> #include <linux/static_call.h>
#include <linux/amd-pstate.h>
#include <linux/topology.h> #include <linux/topology.h>
#include <acpi/processor.h> #include <acpi/processor.h>
...@@ -46,6 +45,8 @@ ...@@ -46,6 +45,8 @@
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/cpufeature.h> #include <asm/cpufeature.h>
#include <asm/cpu_device_id.h> #include <asm/cpu_device_id.h>
#include "amd-pstate.h"
#include "amd-pstate-trace.h" #include "amd-pstate-trace.h"
#define AMD_PSTATE_TRANSITION_LATENCY 20000 #define AMD_PSTATE_TRANSITION_LATENCY 20000
...@@ -53,6 +54,37 @@ ...@@ -53,6 +54,37 @@
#define CPPC_HIGHEST_PERF_PERFORMANCE 196 #define CPPC_HIGHEST_PERF_PERFORMANCE 196
#define CPPC_HIGHEST_PERF_DEFAULT 166 #define CPPC_HIGHEST_PERF_DEFAULT 166
#define AMD_CPPC_EPP_PERFORMANCE 0x00
#define AMD_CPPC_EPP_BALANCE_PERFORMANCE 0x80
#define AMD_CPPC_EPP_BALANCE_POWERSAVE 0xBF
#define AMD_CPPC_EPP_POWERSAVE 0xFF
/*
* enum amd_pstate_mode - driver working mode of amd pstate
*/
enum amd_pstate_mode {
AMD_PSTATE_UNDEFINED = 0,
AMD_PSTATE_DISABLE,
AMD_PSTATE_PASSIVE,
AMD_PSTATE_ACTIVE,
AMD_PSTATE_GUIDED,
AMD_PSTATE_MAX,
};
static const char * const amd_pstate_mode_string[] = {
[AMD_PSTATE_UNDEFINED] = "undefined",
[AMD_PSTATE_DISABLE] = "disable",
[AMD_PSTATE_PASSIVE] = "passive",
[AMD_PSTATE_ACTIVE] = "active",
[AMD_PSTATE_GUIDED] = "guided",
NULL,
};
struct quirk_entry {
u32 nominal_freq;
u32 lowest_freq;
};
/* /*
* TODO: We need more time to fine tune processors with shared memory solution * TODO: We need more time to fine tune processors with shared memory solution
* with community together. * with community together.
...@@ -669,7 +701,7 @@ static int amd_pstate_set_boost(struct cpufreq_policy *policy, int state) ...@@ -669,7 +701,7 @@ static int amd_pstate_set_boost(struct cpufreq_policy *policy, int state)
if (state) if (state)
policy->cpuinfo.max_freq = cpudata->max_freq; policy->cpuinfo.max_freq = cpudata->max_freq;
else else
policy->cpuinfo.max_freq = cpudata->nominal_freq; policy->cpuinfo.max_freq = cpudata->nominal_freq * 1000;
policy->max = policy->cpuinfo.max_freq; policy->max = policy->cpuinfo.max_freq;
......
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
/* /*
* linux/include/linux/amd-pstate.h
*
* Copyright (C) 2022 Advanced Micro Devices, Inc. * Copyright (C) 2022 Advanced Micro Devices, Inc.
* *
* Author: Meng Li <li.meng@amd.com> * Author: Meng Li <li.meng@amd.com>
...@@ -12,11 +10,6 @@ ...@@ -12,11 +10,6 @@
#include <linux/pm_qos.h> #include <linux/pm_qos.h>
#define AMD_CPPC_EPP_PERFORMANCE 0x00
#define AMD_CPPC_EPP_BALANCE_PERFORMANCE 0x80
#define AMD_CPPC_EPP_BALANCE_POWERSAVE 0xBF
#define AMD_CPPC_EPP_POWERSAVE 0xFF
/********************************************************************* /*********************************************************************
* AMD P-state INTERFACE * * AMD P-state INTERFACE *
*********************************************************************/ *********************************************************************/
...@@ -108,30 +101,4 @@ struct amd_cpudata { ...@@ -108,30 +101,4 @@ struct amd_cpudata {
bool suspended; bool suspended;
}; };
/*
* enum amd_pstate_mode - driver working mode of amd pstate
*/
enum amd_pstate_mode {
AMD_PSTATE_UNDEFINED = 0,
AMD_PSTATE_DISABLE,
AMD_PSTATE_PASSIVE,
AMD_PSTATE_ACTIVE,
AMD_PSTATE_GUIDED,
AMD_PSTATE_MAX,
};
static const char * const amd_pstate_mode_string[] = {
[AMD_PSTATE_UNDEFINED] = "undefined",
[AMD_PSTATE_DISABLE] = "disable",
[AMD_PSTATE_PASSIVE] = "passive",
[AMD_PSTATE_ACTIVE] = "active",
[AMD_PSTATE_GUIDED] = "guided",
NULL,
};
struct quirk_entry {
u32 nominal_freq;
u32 lowest_freq;
};
#endif /* _LINUX_AMD_PSTATE_H */ #endif /* _LINUX_AMD_PSTATE_H */
...@@ -1153,6 +1153,7 @@ static void intel_pstate_update_policies(void) ...@@ -1153,6 +1153,7 @@ static void intel_pstate_update_policies(void)
static void __intel_pstate_update_max_freq(struct cpudata *cpudata, static void __intel_pstate_update_max_freq(struct cpudata *cpudata,
struct cpufreq_policy *policy) struct cpufreq_policy *policy)
{ {
if (hwp_active)
intel_pstate_get_hwp_cap(cpudata); intel_pstate_get_hwp_cap(cpudata);
policy->cpuinfo.max_freq = READ_ONCE(global.no_turbo) ? policy->cpuinfo.max_freq = READ_ONCE(global.no_turbo) ?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment