Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4647006rdb; Tue, 12 Dec 2023 05:48:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IH67SrsQSRnz5JT8QHQeYcMjwRdZdpZhCFX773sYGgipexYxewvVOyQm8BP3k74d582UZ3B X-Received: by 2002:a05:6358:78a:b0:170:ddbe:d051 with SMTP id n10-20020a056358078a00b00170ddbed051mr3302410rwj.59.1702388908605; Tue, 12 Dec 2023 05:48:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702388908; cv=none; d=google.com; s=arc-20160816; b=gTWyh6TCZd/q1HUOZL4VFyCSiRzxu86S4wItnc6qgOLlWtsP54o/qZKnuEOOnHZNgP gGNa+Z7EB8m7mD2j+IQK4lMalUXuJUv8fz62CoNw4724JYIDfteah8aRJtaPeea4F4LG hgmRqCmRTek26vL4rSIpvE7IFJnaGIJFnMqOhlvPgQ/wzaPnr4mlbs+5RZa20ql7iLXm d7X+kFBMb6/zzyhs6pifKjDO+8POaodqVOktud/AkVAGT5XHzy9bMYjxo22nvOFMGKdu YoJHv6yTMoPS8e47C+eFJYhyH9eOaqjpQZtd7dOE3k7xASknJR+qD5Dp1eLrAcyakQ5W 57DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=19QUzKvwW99fhIDxw8os6o5drrwDEbcErjoas/3yEB8=; fh=e2V6D7HslNkSxahOU5vFlL1oWCaAbnqjXk69xc4n/QY=; b=xo3gBOC0JsD4/5WF0ksGDHLNCqEHCktRTXMUnjgV36De6EAGqExlNqCUzxY8EQjeIL uiEapJ1P69tzMcyWKa0O2XzdbxEH34/LO+Od1GiP+aQRY6/Z5Lep/UgwhZOmOY0FXREJ 0O87vQpHHOfAmjTXPvsVLgXqGC8ZpmDoqcDpG17gg7Emq9EYn6Xl7eCzGP3LQ+y97VTt Q/Cmq5gXncxaZKv9FG/Z4rEFbL3kQLTYlrj/hOP4kjXqodVt5Ax2TSbqwX0WeA9/C6Y+ QePCbmKJyJSM4VYPqIBwW467sMnamxL5I5iE4JY5yLbiy66oUBOFdv7c3ucQOyHqSiiB 6vFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id o21-20020a634e55000000b005c693ea6618si7900039pgl.523.2023.12.12.05.48.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 05:48:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 5F59C8026C31; Tue, 12 Dec 2023 05:48:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376327AbjLLNro convert rfc822-to-8bit (ORCPT + 99 others); Tue, 12 Dec 2023 08:47:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346637AbjLLNrl (ORCPT ); Tue, 12 Dec 2023 08:47:41 -0500 Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 277E1A1; Tue, 12 Dec 2023 05:47:48 -0800 (PST) Received: by mail-ot1-f50.google.com with SMTP id 46e09a7af769-6d9db92bd71so769625a34.1; Tue, 12 Dec 2023 05:47:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702388867; x=1702993667; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C/X6R0HR+xbXGN5qRhO2As3RreYVAwdxii2KLmKVXIM=; b=Rkhj3hXQDzoRFr4vvAVaxTx7RzPnw16rqj8UMh4FHUqntPxjMt6iwQQ6tCgoQktUfm y7rW6YOmn2JXyocc5Y0qUnQ9yJEsI1UbB2K/ytZzlC3ZkBekIc76uxCc7jw/9vdb/Iaw GUgUn3ZxdFuxaJGRZZWaZIlmYJhhXiqjWHARy4edRxo/RPE8QumFJc+HzST3WNMNwaFc vmCkLcfysfxHJs2gYF0e1lBERWPm0yTYnLrkW0343E+cZ5oWUa3cys0Euz2LjjmtbQHH ZwTqq4mctDhFfW+wwQsFROzHEaQnwcul+xpmfo9Vr2TtP4KV/AINzJhqsCue7PeSaqNp PS7Q== X-Gm-Message-State: AOJu0YwUIew1EEw7PsdYpO2rGd0AS9b6qmqYOcjXBlhdtdx1Pf8SOUBR EiVeWKYuYUTxr8Wy2ybbC27DIxNUecNSRcD+KyeT7G88 X-Received: by 2002:a05:6870:b028:b0:1fb:e5f:c530 with SMTP id y40-20020a056870b02800b001fb0e5fc530mr11532372oae.4.1702388867382; Tue, 12 Dec 2023 05:47:47 -0800 (PST) MIME-Version: 1.0 References: <20231205063537.872834-1-li.meng@amd.com> <20231205063537.872834-3-li.meng@amd.com> In-Reply-To: <20231205063537.872834-3-li.meng@amd.com> From: "Rafael J. Wysocki" Date: Tue, 12 Dec 2023 14:47:36 +0100 Message-ID: Subject: Re: [PATCH V12 2/7] acpi: cppc: Add get the highest performance cppc control To: Meng Li Cc: "Rafael J . Wysocki" , Huang Rui , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, linux-acpi@vger.kernel.org, Shuah Khan , linux-kselftest@vger.kernel.org, Nathan Fontenot , Deepak Sharma , Alex Deucher , Mario Limonciello , Shimmer Huang , Perry Yuan , Xiaojian Du , Viresh Kumar , Borislav Petkov , Oleksandr Natalenko , Wyes Karny Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 12 Dec 2023 05:48:17 -0800 (PST) Please spell ACPI and CPPC in capitals in the subject. On Tue, Dec 5, 2023 at 7:38 AM Meng Li wrote: > > Add support for getting the highest performance to the > generic CPPC driver. This enables downstream drivers > such as amd-pstate to discover and use these values. > > Please refer to the ACPI_Spec for details on continuous > performance control of CPPC. So which section of the spec is the reader supposed to refer to? > Tested-by: Oleksandr Natalenko > Reviewed-by: Mario Limonciello > Reviewed-by: Wyes Karny > Reviewed-by: Perry Yuan > Acked-by: Huang Rui > Signed-off-by: Meng Li > Link: https://uefi.org/specs/ACPI/6.5/08_Processor_Configuration_and_Control.html?highlight=cppc#highest-performance > --- > 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..ad388a0e8484 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; > --