amd-pstate.c (e059c184da47e92c6236f26b0fdaf9e92f0d55b5) amd-pstate.c (60e10f896dbf6d78f912e4972081bd4119131376)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * amd-pstate.c - AMD Processor P-state Frequency Driver
4 *
5 * Copyright (C) 2021 Advanced Micro Devices, Inc. All Rights Reserved.
6 *
7 * Author: Huang Rui <ray.huang@amd.com>
8 *

--- 30 unchanged lines hidden (view full) ---

39
40#include <acpi/processor.h>
41#include <acpi/cppc_acpi.h>
42
43#include <asm/msr.h>
44#include <asm/processor.h>
45#include <asm/cpufeature.h>
46#include <asm/cpu_device_id.h>
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * amd-pstate.c - AMD Processor P-state Frequency Driver
4 *
5 * Copyright (C) 2021 Advanced Micro Devices, Inc. All Rights Reserved.
6 *
7 * Author: Huang Rui <ray.huang@amd.com>
8 *

--- 30 unchanged lines hidden (view full) ---

39
40#include <acpi/processor.h>
41#include <acpi/cppc_acpi.h>
42
43#include <asm/msr.h>
44#include <asm/processor.h>
45#include <asm/cpufeature.h>
46#include <asm/cpu_device_id.h>
47#include "amd-pstate-trace.h"
47
48#define AMD_PSTATE_TRANSITION_LATENCY 0x20000
49#define AMD_PSTATE_TRANSITION_DELAY 500
50
51/*
52 * TODO: We need more time to fine tune processors with shared memory solution
53 * with community together.
54 *

--- 160 unchanged lines hidden (view full) ---

215 value |= AMD_CPPC_MIN_PERF(min_perf);
216
217 value &= ~AMD_CPPC_DES_PERF(~0L);
218 value |= AMD_CPPC_DES_PERF(des_perf);
219
220 value &= ~AMD_CPPC_MAX_PERF(~0L);
221 value |= AMD_CPPC_MAX_PERF(max_perf);
222
48
49#define AMD_PSTATE_TRANSITION_LATENCY 0x20000
50#define AMD_PSTATE_TRANSITION_DELAY 500
51
52/*
53 * TODO: We need more time to fine tune processors with shared memory solution
54 * with community together.
55 *

--- 160 unchanged lines hidden (view full) ---

216 value |= AMD_CPPC_MIN_PERF(min_perf);
217
218 value &= ~AMD_CPPC_DES_PERF(~0L);
219 value |= AMD_CPPC_DES_PERF(des_perf);
220
221 value &= ~AMD_CPPC_MAX_PERF(~0L);
222 value |= AMD_CPPC_MAX_PERF(max_perf);
223
224 trace_amd_pstate_perf(min_perf, des_perf, max_perf,
225 cpudata->cpu, (value != prev), fast_switch);
226
223 if (value == prev)
224 return;
225
226 WRITE_ONCE(cpudata->cppc_req_cached, value);
227
228 amd_pstate_update_perf(cpudata, min_perf, des_perf,
229 max_perf, fast_switch);
230}

--- 281 unchanged lines hidden ---
227 if (value == prev)
228 return;
229
230 WRITE_ONCE(cpudata->cppc_req_cached, value);
231
232 amd_pstate_update_perf(cpudata, min_perf, des_perf,
233 max_perf, fast_switch);
234}

--- 281 unchanged lines hidden ---