From nobody Fri Dec 19 19:01:51 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EC54CDB482 for ; Wed, 18 Oct 2023 16:26:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235172AbjJRQ0L (ORCPT ); Wed, 18 Oct 2023 12:26:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232037AbjJRQ0B (ORCPT ); Wed, 18 Oct 2023 12:26:01 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D46D18B for ; Wed, 18 Oct 2023 09:25:55 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-407da05f05aso14989345e9.3 for ; Wed, 18 Oct 2023 09:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697646353; x=1698251153; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=t7+ZpUaEOXwTDOskMxoY9Ba/oJUSgkR/NSgnjv3wTn0=; b=ipmTAHUgvnnKU6BIYUtOTYXmjrAyUAn2EY1fEto63F2wzw4eIEdhBjhvS458WtBpaq CxbmS1ic5rMKYfVoR0zZYn8SZfP5TnpM7CKhoal+c+cqEnI0IrWZi0QCfwVNhgB8mVvj XL/7L84LOyw9DNEvY3fZMs9a+7MHPYzruTkbOiXvX3cRyE5ebqWnM2K9f7r/WcPyOPkw 6f48owIsAM8Fb7ipclTr+IwtRNLQmvoOCpwWDvZFv0R96U7UOZ3rMZPZWO0rvwPrBvx2 yDpTtbqxxE3HccAg9f7eoWyaJaMqwJUjBMB51uwcyiH8pSwMqsgRJHxC+WMNjxOFjbsg qdPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697646353; x=1698251153; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t7+ZpUaEOXwTDOskMxoY9Ba/oJUSgkR/NSgnjv3wTn0=; b=l1hhGDFgDhkM5WEu0iNo4R2MZzung8j11GK68PwnrNV1mR+ra/C152fj54mg+A3Kda nrPVY2p/uNZ7VsMLK+2m+FN35LDajPbSYQPGyFTW9/X8A4Q/GsQwf71ysaG5aTzpExI8 yhTLtNX4v2Lzh4/gRwa8eznA7OJogfvf4AlrI1GviE6nIzIAm3W+qmD8zCMlye0AH8K3 HItvXs9T5XlNVZwXAOzokIiaIq8+Er57oleixre8NyOyCRS9b4w43fKdsunoGxKit8j1 N7Ye9fE5A6s7JEEh66kxWAQVCT1NbK4VduIPmfNwdDI59HJZKCUPnALhiuBwvKC0e0HP FKZA== X-Gm-Message-State: AOJu0Yw8numKMf5HWB7DV4SMIutPaNvMQpoXzcFVy8lVYIV0DTYHScbl uEDUw9yNxlDkhYZ9n0yBu16ZLg== X-Google-Smtp-Source: AGHT+IHrVWXnD1d4i/HyVc0fasvi+mESxaiG3mRXSCtRw2XKxIM1MjO8qqi9mo1y+20lBvT6QGcUKA== X-Received: by 2002:a05:600c:3144:b0:406:54e4:359c with SMTP id h4-20020a05600c314400b0040654e4359cmr4470454wmo.19.1697646353459; Wed, 18 Oct 2023 09:25:53 -0700 (PDT) Received: from vingu-book.. ([2a01:e0a:f:6020:fcf4:9d83:8d0d:39aa]) by smtp.gmail.com with ESMTPSA id q12-20020a05600c2e4c00b0040648217f4fsm2033503wmf.39.2023.10.18.09.25.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 09:25:52 -0700 (PDT) From: Vincent Guittot To: linux@armlinux.org.uk, catalin.marinas@arm.com, will@kernel.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, sudeep.holla@arm.com, gregkh@linuxfoundation.org, rafael@kernel.org, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, viresh.kumar@linaro.org, lenb@kernel.org, robert.moore@intel.com, lukasz.luba@arm.com, ionela.voinescu@arm.com, pierre.gondois@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org, acpica-devel@lists.linuxfoundation.org Cc: conor.dooley@microchip.com, suagrfillet@gmail.com, ajones@ventanamicro.com, lftan@kernel.org, Vincent Guittot Subject: [PATCH v3 5/6] cpufreq/cppc: set the frequency used for computing the capacity Date: Wed, 18 Oct 2023 18:25:39 +0200 Message-Id: <20231018162540.667646-6-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018162540.667646-1-vincent.guittot@linaro.org> References: <20231018162540.667646-1-vincent.guittot@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Save the frequency associated to the performance that has been used when initializing the capacity of CPUs. Also, cppc cpufreq driver can register an artificial energy model. In such case, it needs the frequency for this compute capacity. We moved and renamed cppc_perf_to_khz and cppc_perf_to_khz to use them outside cppc_cpufreq in topology_init_cpu_capacity_cppc(). Signed-off-by: Vincent Guittot Acked-by: Rafael J. Wysocki --- drivers/acpi/cppc_acpi.c | 93 ++++++++++++++++++++++ drivers/base/arch_topology.c | 15 +++- drivers/cpufreq/cppc_cpufreq.c | 141 ++++++--------------------------- include/acpi/cppc_acpi.h | 2 + 4 files changed, 133 insertions(+), 118 deletions(-) diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 7ff269a78c20..72aae5e87788 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -39,6 +39,8 @@ #include #include #include +#include +#include =20 #include =20 @@ -1760,3 +1762,94 @@ unsigned int cppc_get_transition_latency(int cpu_num) return latency_ns; } EXPORT_SYMBOL_GPL(cppc_get_transition_latency); + +/* Minimum struct length needed for the DMI processor entry we want */ +#define DMI_ENTRY_PROCESSOR_MIN_LENGTH 48 + +/* Offset in the DMI processor structure for the max frequency */ +#define DMI_PROCESSOR_MAX_SPEED 0x14 + +/* Callback function used to retrieve the max frequency from DMI */ +static void cppc_find_dmi_mhz(const struct dmi_header *dm, void *private) +{ + const u8 *dmi_data =3D (const u8 *)dm; + u16 *mhz =3D (u16 *)private; + + if (dm->type =3D=3D DMI_ENTRY_PROCESSOR && + dm->length >=3D DMI_ENTRY_PROCESSOR_MIN_LENGTH) { + u16 val =3D (u16)get_unaligned((const u16 *) + (dmi_data + DMI_PROCESSOR_MAX_SPEED)); + *mhz =3D val > *mhz ? val : *mhz; + } +} + +/* Look up the max frequency in DMI */ +static u64 cppc_get_dmi_max_khz(void) +{ + u16 mhz =3D 0; + + dmi_walk(cppc_find_dmi_mhz, &mhz); + + /* + * Real stupid fallback value, just in case there is no + * actual value set. + */ + mhz =3D mhz ? mhz : 1; + + return (1000 * mhz); +} + +/* + * If CPPC lowest_freq and nominal_freq registers are exposed then we can + * use them to convert perf to freq and vice versa. The conversion is + * extrapolated as an affine function passing by the 2 points: + * - (Low perf, Low freq) + * - (Nominal perf, Nominal perf) + */ +unsigned int cppc_perf_to_khz(struct cppc_perf_caps *caps, unsigned int pe= rf) +{ + s64 retval, offset =3D 0; + static u64 max_khz; + u64 mul, div; + + if (caps->lowest_freq && caps->nominal_freq) { + mul =3D caps->nominal_freq - caps->lowest_freq; + div =3D caps->nominal_perf - caps->lowest_perf; + offset =3D caps->nominal_freq - div64_u64(caps->nominal_perf * mul, div); + } else { + if (!max_khz) + max_khz =3D cppc_get_dmi_max_khz(); + mul =3D max_khz; + div =3D caps->highest_perf; + } + + retval =3D offset + div64_u64(perf * mul, div); + if (retval >=3D 0) + return retval; + return 0; +} +EXPORT_SYMBOL_GPL(cppc_perf_to_khz); + +unsigned int cppc_khz_to_perf(struct cppc_perf_caps *caps, unsigned int fr= eq) +{ + s64 retval, offset =3D 0; + static u64 max_khz; + u64 mul, div; + + if (caps->lowest_freq && caps->nominal_freq) { + mul =3D caps->nominal_perf - caps->lowest_perf; + div =3D caps->nominal_freq - caps->lowest_freq; + offset =3D caps->nominal_perf - div64_u64(caps->nominal_freq * mul, div); + } else { + if (!max_khz) + max_khz =3D cppc_get_dmi_max_khz(); + mul =3D caps->highest_perf; + div =3D max_khz; + } + + retval =3D offset + div64_u64(freq * mul, div); + if (retval >=3D 0) + return retval; + return 0; +} +EXPORT_SYMBOL_GPL(cppc_khz_to_perf); diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index 9a073c2d2086..2372ce791bb4 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -350,6 +350,7 @@ bool __init topology_parse_cpu_capacity(struct device_n= ode *cpu_node, int cpu) void topology_init_cpu_capacity_cppc(void) { struct cppc_perf_caps perf_caps; + u64 capacity, capacity_scale; int cpu; =20 if (likely(!acpi_cpc_valid())) @@ -365,6 +366,10 @@ void topology_init_cpu_capacity_cppc(void) (perf_caps.highest_perf >=3D perf_caps.nominal_perf) && (perf_caps.highest_perf >=3D perf_caps.lowest_perf)) { raw_capacity[cpu] =3D perf_caps.highest_perf; + capacity_scale =3D max_t(u64, capacity_scale, raw_capacity[cpu]); + + per_cpu(capacity_ref_freq, cpu) =3D cppc_perf_to_khz(&perf_caps, raw_ca= pacity[cpu]); + pr_debug("cpu_capacity: CPU%d cpu_capacity=3D%u (raw).\n", cpu, raw_capacity[cpu]); continue; @@ -375,7 +380,15 @@ void topology_init_cpu_capacity_cppc(void) goto exit; } =20 - topology_normalize_cpu_scale(); + for_each_possible_cpu(cpu) { + capacity =3D raw_capacity[cpu]; + capacity =3D div64_u64(capacity << SCHED_CAPACITY_SHIFT, + capacity_scale); + topology_set_cpu_scale(cpu, capacity); + pr_debug("cpu_capacity: CPU%d cpu_capacity=3D%lu\n", + cpu, topology_get_cpu_scale(cpu)); + } + schedule_work(&update_topology_flags_work); pr_debug("cpu_capacity: cpu_capacity initialization done\n"); =20 diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index fe08ca419b3d..822376b0cb78 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -27,12 +27,6 @@ =20 #include =20 -/* Minimum struct length needed for the DMI processor entry we want */ -#define DMI_ENTRY_PROCESSOR_MIN_LENGTH 48 - -/* Offset in the DMI processor structure for the max frequency */ -#define DMI_PROCESSOR_MAX_SPEED 0x14 - /* * This list contains information parsed from per CPU ACPI _CPC and _PSD * structures: e.g. the highest and lowest supported performance, capabili= ties, @@ -291,97 +285,9 @@ static inline void cppc_freq_invariance_exit(void) } #endif /* CONFIG_ACPI_CPPC_CPUFREQ_FIE */ =20 -/* Callback function used to retrieve the max frequency from DMI */ -static void cppc_find_dmi_mhz(const struct dmi_header *dm, void *private) -{ - const u8 *dmi_data =3D (const u8 *)dm; - u16 *mhz =3D (u16 *)private; - - if (dm->type =3D=3D DMI_ENTRY_PROCESSOR && - dm->length >=3D DMI_ENTRY_PROCESSOR_MIN_LENGTH) { - u16 val =3D (u16)get_unaligned((const u16 *) - (dmi_data + DMI_PROCESSOR_MAX_SPEED)); - *mhz =3D val > *mhz ? val : *mhz; - } -} - -/* Look up the max frequency in DMI */ -static u64 cppc_get_dmi_max_khz(void) -{ - u16 mhz =3D 0; - - dmi_walk(cppc_find_dmi_mhz, &mhz); - - /* - * Real stupid fallback value, just in case there is no - * actual value set. - */ - mhz =3D mhz ? mhz : 1; - - return (1000 * mhz); -} - -/* - * If CPPC lowest_freq and nominal_freq registers are exposed then we can - * use them to convert perf to freq and vice versa. The conversion is - * extrapolated as an affine function passing by the 2 points: - * - (Low perf, Low freq) - * - (Nominal perf, Nominal perf) - */ -static unsigned int cppc_cpufreq_perf_to_khz(struct cppc_cpudata *cpu_data, - unsigned int perf) -{ - struct cppc_perf_caps *caps =3D &cpu_data->perf_caps; - s64 retval, offset =3D 0; - static u64 max_khz; - u64 mul, div; - - if (caps->lowest_freq && caps->nominal_freq) { - mul =3D caps->nominal_freq - caps->lowest_freq; - div =3D caps->nominal_perf - caps->lowest_perf; - offset =3D caps->nominal_freq - div64_u64(caps->nominal_perf * mul, div); - } else { - if (!max_khz) - max_khz =3D cppc_get_dmi_max_khz(); - mul =3D max_khz; - div =3D caps->highest_perf; - } - - retval =3D offset + div64_u64(perf * mul, div); - if (retval >=3D 0) - return retval; - return 0; -} - -static unsigned int cppc_cpufreq_khz_to_perf(struct cppc_cpudata *cpu_data, - unsigned int freq) -{ - struct cppc_perf_caps *caps =3D &cpu_data->perf_caps; - s64 retval, offset =3D 0; - static u64 max_khz; - u64 mul, div; - - if (caps->lowest_freq && caps->nominal_freq) { - mul =3D caps->nominal_perf - caps->lowest_perf; - div =3D caps->nominal_freq - caps->lowest_freq; - offset =3D caps->nominal_perf - div64_u64(caps->nominal_freq * mul, div); - } else { - if (!max_khz) - max_khz =3D cppc_get_dmi_max_khz(); - mul =3D caps->highest_perf; - div =3D max_khz; - } - - retval =3D offset + div64_u64(freq * mul, div); - if (retval >=3D 0) - return retval; - return 0; -} - static int cppc_cpufreq_set_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) - { struct cppc_cpudata *cpu_data =3D policy->driver_data; unsigned int cpu =3D policy->cpu; @@ -389,7 +295,7 @@ static int cppc_cpufreq_set_target(struct cpufreq_polic= y *policy, u32 desired_perf; int ret =3D 0; =20 - desired_perf =3D cppc_cpufreq_khz_to_perf(cpu_data, target_freq); + desired_perf =3D cppc_khz_to_perf(&cpu_data->perf_caps, target_freq); /* Return if it is exactly the same perf */ if (desired_perf =3D=3D cpu_data->perf_ctrls.desired_perf) return ret; @@ -417,7 +323,7 @@ static unsigned int cppc_cpufreq_fast_switch(struct cpu= freq_policy *policy, u32 desired_perf; int ret; =20 - desired_perf =3D cppc_cpufreq_khz_to_perf(cpu_data, target_freq); + desired_perf =3D cppc_khz_to_perf(&cpu_data->perf_caps, target_freq); cpu_data->perf_ctrls.desired_perf =3D desired_perf; ret =3D cppc_set_perf(cpu, &cpu_data->perf_ctrls); =20 @@ -530,7 +436,7 @@ static int cppc_get_cpu_power(struct device *cpu_dev, min_step =3D min_cap / CPPC_EM_CAP_STEP; max_step =3D max_cap / CPPC_EM_CAP_STEP; =20 - perf_prev =3D cppc_cpufreq_khz_to_perf(cpu_data, *KHz); + perf_prev =3D cppc_khz_to_perf(perf_caps, *KHz); step =3D perf_prev / perf_step; =20 if (step > max_step) @@ -550,8 +456,8 @@ static int cppc_get_cpu_power(struct device *cpu_dev, perf =3D step * perf_step; } =20 - *KHz =3D cppc_cpufreq_perf_to_khz(cpu_data, perf); - perf_check =3D cppc_cpufreq_khz_to_perf(cpu_data, *KHz); + *KHz =3D cppc_perf_to_khz(perf_caps, perf); + perf_check =3D cppc_khz_to_perf(perf_caps, *KHz); step_check =3D perf_check / perf_step; =20 /* @@ -561,8 +467,8 @@ static int cppc_get_cpu_power(struct device *cpu_dev, */ while ((*KHz =3D=3D prev_freq) || (step_check !=3D step)) { perf++; - *KHz =3D cppc_cpufreq_perf_to_khz(cpu_data, perf); - perf_check =3D cppc_cpufreq_khz_to_perf(cpu_data, *KHz); + *KHz =3D cppc_perf_to_khz(perf_caps, perf); + perf_check =3D cppc_khz_to_perf(perf_caps, *KHz); step_check =3D perf_check / perf_step; } =20 @@ -591,7 +497,7 @@ static int cppc_get_cpu_cost(struct device *cpu_dev, un= signed long KHz, perf_caps =3D &cpu_data->perf_caps; max_cap =3D arch_scale_cpu_capacity(cpu_dev->id); =20 - perf_prev =3D cppc_cpufreq_khz_to_perf(cpu_data, KHz); + perf_prev =3D cppc_khz_to_perf(perf_caps, KHz); perf_step =3D CPPC_EM_CAP_STEP * perf_caps->highest_perf / max_cap; step =3D perf_prev / perf_step; =20 @@ -643,6 +549,7 @@ static void cppc_cpufreq_register_em(struct cpufreq_pol= icy *policy) EM_ADV_DATA_CB(cppc_get_cpu_power, cppc_get_cpu_cost); =20 cpu_data =3D policy->driver_data; + em_dev_register_perf_domain(get_cpu_device(policy->cpu), get_perf_level_count(policy), &em_cb, cpu_data->shared_cpu_map, 0); @@ -724,20 +631,20 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_polic= y *policy) * Set min to lowest nonlinear perf to avoid any efficiency penalty (see * Section 8.4.7.1.1.5 of ACPI 6.1 spec) */ - policy->min =3D cppc_cpufreq_perf_to_khz(cpu_data, - caps->lowest_nonlinear_perf); - policy->max =3D cppc_cpufreq_perf_to_khz(cpu_data, - caps->nominal_perf); + policy->min =3D cppc_perf_to_khz(caps, + caps->lowest_nonlinear_perf); + policy->max =3D cppc_perf_to_khz(caps, + caps->nominal_perf); =20 /* * Set cpuinfo.min_freq to Lowest to make the full range of performance * available if userspace wants to use any perf between lowest & lowest * nonlinear perf */ - policy->cpuinfo.min_freq =3D cppc_cpufreq_perf_to_khz(cpu_data, - caps->lowest_perf); - policy->cpuinfo.max_freq =3D cppc_cpufreq_perf_to_khz(cpu_data, - caps->nominal_perf); + policy->cpuinfo.min_freq =3D cppc_perf_to_khz(caps, + caps->lowest_perf); + policy->cpuinfo.max_freq =3D cppc_perf_to_khz(caps, + caps->nominal_perf); =20 policy->transition_delay_us =3D cppc_cpufreq_get_transition_delay_us(cpu); policy->shared_type =3D cpu_data->shared_type; @@ -773,7 +680,7 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy = *policy) boost_supported =3D true; =20 /* Set policy->cur to max now. The governors will adjust later. */ - policy->cur =3D cppc_cpufreq_perf_to_khz(cpu_data, caps->highest_perf); + policy->cur =3D cppc_perf_to_khz(caps, caps->highest_perf); cpu_data->perf_ctrls.desired_perf =3D caps->highest_perf; =20 ret =3D cppc_set_perf(cpu, &cpu_data->perf_ctrls); @@ -863,7 +770,7 @@ static unsigned int cppc_cpufreq_get_rate(unsigned int = cpu) delivered_perf =3D cppc_perf_from_fbctrs(cpu_data, &fb_ctrs_t0, &fb_ctrs_t1); =20 - return cppc_cpufreq_perf_to_khz(cpu_data, delivered_perf); + return cppc_perf_to_khz(&cpu_data->perf_caps, delivered_perf); } =20 static int cppc_cpufreq_set_boost(struct cpufreq_policy *policy, int state) @@ -878,11 +785,11 @@ static int cppc_cpufreq_set_boost(struct cpufreq_poli= cy *policy, int state) } =20 if (state) - policy->max =3D cppc_cpufreq_perf_to_khz(cpu_data, - caps->highest_perf); + policy->max =3D cppc_perf_to_khz(caps, + caps->highest_perf); else - policy->max =3D cppc_cpufreq_perf_to_khz(cpu_data, - caps->nominal_perf); + policy->max =3D cppc_perf_to_khz(caps, + caps->nominal_perf); policy->cpuinfo.max_freq =3D policy->max; =20 ret =3D freq_qos_update_request(policy->max_freq_req, policy->max); @@ -937,7 +844,7 @@ static unsigned int hisi_cppc_cpufreq_get_rate(unsigned= int cpu) if (ret < 0) return -EIO; =20 - return cppc_cpufreq_perf_to_khz(cpu_data, desired_perf); + return cppc_perf_to_khz(&cpu_data->perf_caps, desired_perf); } =20 static void cppc_check_hisi_workaround(void) diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h index 6126c977ece0..3a0995f8bce8 100644 --- a/include/acpi/cppc_acpi.h +++ b/include/acpi/cppc_acpi.h @@ -144,6 +144,8 @@ extern int cppc_set_perf(int cpu, struct cppc_perf_ctrl= s *perf_ctrls); extern int cppc_set_enable(int cpu, bool enable); extern int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps); extern bool cppc_perf_ctrs_in_pcc(void); +extern unsigned int cppc_perf_to_khz(struct cppc_perf_caps *caps, unsigned= int perf); +extern unsigned int cppc_khz_to_perf(struct cppc_perf_caps *caps, unsigned= int freq); extern bool acpi_cpc_valid(void); extern bool cppc_allow_fast_switch(void); extern int acpi_get_psd_map(unsigned int cpu, struct cppc_cpudata *cpu_dat= a); --=20 2.34.1