Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3807350rdb; Wed, 27 Dec 2023 23:57:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IFrSU2Vn2PRe5gojh6a25cyyNfs3hbulgv9mIu4DzOOQcUqR48BVagr+l1m37bn/DKi0bnB X-Received: by 2002:a17:90b:945:b0:28b:730a:f122 with SMTP id dw5-20020a17090b094500b0028b730af122mr3101061pjb.83.1703750267814; Wed, 27 Dec 2023 23:57:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703750267; cv=none; d=google.com; s=arc-20160816; b=TJls0gu94B8Jj6BXKqDtMKiHtDfEVxADI/1/l0hp3n0Q+EEkXJEZawqJGpQBSjNqif 2Gi4UKTwS8lBgqfkFEAdAsRrfCYr3thFZwqxcmqhm0LkER6YTY6zIEggjjsGHTns0+rN aN/rWtU3wufbeuX7P5nl+LT+3I4xGiDL4IjK7Of5P1eWRidd79v5neBuver/E/wcG36Z kMtxbsp0VLDIBGYh8IlOkHzg7DOKmdwy9AimqoToabXK10piUkgB11teGegOT9wxgKMu YyhtnmVp7PFNcVIA+tjzMxktpgop5PpO5u1jNNTd+u06eWJv+vWCMU+eqcjjWPYkvzbv APMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=zUjCUGvv0RjgwqY7cveXvDYZv8N3rtEFjuhRFNaLjXU=; fh=aRZZFfYpFsbONXxr7ZI6QaRKfYRbAmgYyJx4zno9nrw=; b=k2nNnKT8YBrvjoijOkBbIYOWkSYLMSYm2Q4YjvQEu7hpy3OXPfaRZvUA+CzxCRD/qj 39MiIejHeH4QNFkOeasjM56Gl3vDucAolGiSfD6ZXLEV6VqBQ9YTlQiDU+d3rVJtSqUH ERj1iaCRdXegzVZ79r4R07zJBce3YdV89s3mhwt7rx93cIiXM4SDC71dt/SsLFwICxWx PvvSJsLvZpY5qiQL62egUmYzOJO+sM7vHcsqNOUSRaPbzNNxYd9M+ACxS2WUVyq7/xcq hM9Ysy3hBNakJ/2GFeb1hn3y0bIaexO6DGGMecsSWGMICS29Z9hd+VM3GNSuFctkiJEL 9cFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12500-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12500-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s23-20020a17090aad9700b0028bbcd027aasi15584690pjq.94.2023.12.27.23.57.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 23:57:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12500-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12500-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12500-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 79002283E7E for ; Thu, 28 Dec 2023 07:57:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7EA866AA2; Thu, 28 Dec 2023 07:57:23 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mx2.zhaoxin.com (mx2.zhaoxin.com [203.110.167.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4BA163CA for ; Thu, 28 Dec 2023 07:57:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=zhaoxin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zhaoxin.com X-ASG-Debug-ID: 1703750232-1eb14e0c7c074d0001-xx1T2L Received: from ZXSHMBX3.zhaoxin.com (ZXSHMBX3.zhaoxin.com [10.28.252.165]) by mx2.zhaoxin.com with ESMTP id GouFeNEGeQhMwn5d (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 28 Dec 2023 15:57:12 +0800 (CST) X-Barracuda-Envelope-From: TonyWWang-oc@zhaoxin.com X-Barracuda-RBL-Trusted-Forwarder: 10.28.252.165 Received: from zxbjmbx1.zhaoxin.com (10.29.252.163) by ZXSHMBX3.zhaoxin.com (10.28.252.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 28 Dec 2023 15:57:11 +0800 Received: from tony.zhaoxin.com (10.32.65.162) by zxbjmbx1.zhaoxin.com (10.29.252.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 28 Dec 2023 15:57:08 +0800 X-Barracuda-RBL-Trusted-Forwarder: 10.28.252.165 From: Tony W Wang-oc X-Barracuda-RBL-Trusted-Forwarder: 10.29.252.163 To: , , , , , , , , , , , , , , , , , , CC: , , , Subject: [PATCH 1/3] ACPI: CPPC: Add get the highest perf register value support Date: Thu, 28 Dec 2023 15:57:03 +0800 X-ASG-Orig-Subj: [PATCH 1/3] ACPI: CPPC: Add get the highest perf register value support Message-ID: <20231228075705.26652-2-TonyWWang-oc@zhaoxin.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231228075705.26652-1-TonyWWang-oc@zhaoxin.com> References: <20231228075705.26652-1-TonyWWang-oc@zhaoxin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: zxbjmbx1.zhaoxin.com (10.29.252.163) To zxbjmbx1.zhaoxin.com (10.29.252.163) X-Barracuda-Connect: ZXSHMBX3.zhaoxin.com[10.28.252.165] X-Barracuda-Start-Time: 1703750232 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://10.28.252.36:4443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at zhaoxin.com X-Barracuda-Scan-Msg-Size: 2149 X-Barracuda-BRTS-Status: 0 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.118665 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Add function cppc_get_highest_perf in generic CPPC driver to get the highest perf register value for specified core. Signed-off-by: Tony W Wang-oc --- drivers/acpi/cppc_acpi.c | 13 +++++++++++++ include/acpi/cppc_acpi.h | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 7ff269a78c20..1a77c514d007 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -1154,6 +1154,19 @@ int cppc_get_nominal_perf(int cpunum, u64 *nominal_perf) return cppc_get_perf(cpunum, NOMINAL_PERF, nominal_perf); } +/** + * cppc_get_highest_perf - Get the highest performance register value. + * @cpunum: CPU from which to get highest performance. + * @highest_perf: Return address. + * + * Return: 0 for success, -EIO otherwise. + */ +int cppc_get_highest_perf(int cpunum, u64 *highest_perf) +{ + return cppc_get_perf(cpunum, HIGHEST_PERF, highest_perf); +} +EXPORT_SYMBOL_GPL(cppc_get_highest_perf); + /** * cppc_get_epp_perf - Get the epp register value. * @cpunum: CPU from which to get epp preference value. diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h index 6126c977ece0..c0b69ffe7bdb 100644 --- a/include/acpi/cppc_acpi.h +++ b/include/acpi/cppc_acpi.h @@ -139,6 +139,7 @@ struct cppc_cpudata { #ifdef CONFIG_ACPI_CPPC_LIB extern int cppc_get_desired_perf(int cpunum, u64 *desired_perf); extern int cppc_get_nominal_perf(int cpunum, u64 *nominal_perf); +extern int cppc_get_highest_perf(int cpunum, u64 *highest_perf); extern int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs); extern int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls); extern int cppc_set_enable(int cpu, bool enable); @@ -165,6 +166,10 @@ static inline int cppc_get_nominal_perf(int cpunum, u64 *nominal_perf) { return -ENOTSUPP; } +static inline int cppc_get_highest_perf(int cpunum, u64 *highest_perf) +{ + return -ENOTSUPP; +} static inline int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs) { return -ENOTSUPP; -- 2.25.1