From patchwork Wed Dec 7 15:46:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wyes Karny X-Patchwork-Id: 30898 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp259991wrr; Wed, 7 Dec 2022 07:50:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf4oXB8ZFx3Kq1ztZFE9JOh8hGNtCUOuB7UCMlj3CwKLDRC232ZXAGFOk9NEdyWmQvdXRUZq X-Received: by 2002:a17:906:8a4d:b0:7b5:73aa:9988 with SMTP id gx13-20020a1709068a4d00b007b573aa9988mr67323010ejc.597.1670428237584; Wed, 07 Dec 2022 07:50:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1670428237; cv=pass; d=google.com; s=arc-20160816; b=Za7Vg61SlVfAgkNVMkxDD1tmWtv1J2o+EeJjWGhlhwycC93aHSd2cn9llrTyHTfsxa cEK2UHVDIdCahAVzqtc+IRRwb0tM51RA6LhEVncbfnlLgJXWmrxtB/OpdtU6+uogs6hl zDRIavXqyqXevBoAk0bhM8G0nHkSJWYOmmShfXm83Ad/oiKhBKGbWkypq8HjyZ8kvKEq sQEcBvW5esMzhbcBeQRY0FLE7ODOHsnlSbHPtfNfZovd3jSfyT4mpJLdauQaVhcojSqJ QJB2NVT0JBpqeS+OzgtwB8tINBoMbyBpVM3/qs/91QyZNRjmL55ewoonnAAl09v7vSJR PVBA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EZWt16zS7ZLt5Ossyk+ffd6aaDDEXhtOhIs4OjbDz4Y=; b=mNR9hgJKTHE0FtyAfXKGFg2g5bhnkE/tW9CCzbb4jH3t9JQAPOY8iBbnJgX2anwbhz hF/56qZ/Z2vUbhDggf92NOyF8Y3XZZV+Y+gMPaawBk/jTFdK4UoXNTKBuMvmnq4d2yfU lxx8UKCmfWX/v9/P79mBSvaGP5fnFtq5vuMeTVPUzRGONDI1Wz1tCnhL1s0IJfm4IwCr aeLrXDNX9N0aANiXLvfvEhJEsaHQRpeA/Cq2iXHAHEMZk0roBXhRuI0oa0Szl8fNOU+w RjcL+qEPnLFhi1uHNSi4j2zMsAyac3uT9jpnl4euJ3QeFfzkDPtkOTQpshNjluLNGAsU 2AiQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=nRqM9lHI; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id du12-20020a17090772cc00b007bd7e8dbf47si17140116ejc.959.2022.12.07.07.50.11; Wed, 07 Dec 2022 07:50:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=nRqM9lHI; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229806AbiLGPsN (ORCPT + 99 others); Wed, 7 Dec 2022 10:48:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbiLGPsL (ORCPT ); Wed, 7 Dec 2022 10:48:11 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2076.outbound.protection.outlook.com [40.107.244.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD819EE2B; Wed, 7 Dec 2022 07:48:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d+xkajY2OwzUlfLsX6rKtUwxctYOEZh2pgxV/1xuWTbUFJmJuT3ZH0E3yh9uEqWbmtPubjB70HnvViO0rTEj8eqMe8HkJla8dmKqhsX4K1MNxuobe4L1IQGOTTTWHiWWiMF9oMkBmlxNJRMLAR6pBkPGD733vMgVV8SfsEuvNrKD6tS3Y0xSCX40GJ0xVMvNNJau9jDwvvAXgJhbpx895jq7YNZoAffl0tJWyvC1eYbe0eh0KnacotFBQWlv95aFmoCp+oj3jbQC+aeM/jvspc0P2AQ3ot3B/IAphaDqTYXYJMttuGl7zI/5bUAFci8SRxYLu36h76zenU5g87HXPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EZWt16zS7ZLt5Ossyk+ffd6aaDDEXhtOhIs4OjbDz4Y=; b=YD3NpgcJY57C+9ZrABhnyZG1fZ4KOO9SD7Qt9VHDFf+Dh8QQISRaQ/FU53fgPurBsq0KQfVYBpV/cSFTzIHD2eAZrsyS+ImPTtWCuhV2cPPM2pRJe/f62COuk57o9SMYtX3cbZszx5g9w5WAbu5oWK6fBqF2Bmge+qj1sPE+ALe9e5GZzLRlECbJaQtXcszbkkAb8EE9RrjyK65od5XYP4QumzumIQ/GPeZ1S2pXQUoBXO1CI6quef1rYjGc/IsMA+XKexHIS4EAbEo2JC4zLT3Gn6ykKDhOaKeps3cj0chkldYIr/M72wk9l2ubRi7ykyP4wGj/P26HNWHMGvuXYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EZWt16zS7ZLt5Ossyk+ffd6aaDDEXhtOhIs4OjbDz4Y=; b=nRqM9lHI9zz437fh52ExRQtDpPDmVd2xCE5kOd91E83tEf/KGBWPa2hmcdLlQA8RE7kPXDObfNza4Lkg+hmloP/PFhk7+AtVM/63xId59CLEnn5KDoNmdDdN6OsCL/yActRP6yNqRyUlBxp4wemKu8Nl5gpX+q5ZT7utx+YpNwc= Received: from BN9PR03CA0275.namprd03.prod.outlook.com (2603:10b6:408:f5::10) by MW4PR12MB6777.namprd12.prod.outlook.com (2603:10b6:303:1e9::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Wed, 7 Dec 2022 15:48:07 +0000 Received: from BN8NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f5:cafe::4a) by BN9PR03CA0275.outlook.office365.com (2603:10b6:408:f5::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14 via Frontend Transport; Wed, 7 Dec 2022 15:48:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT024.mail.protection.outlook.com (10.13.177.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.15 via Frontend Transport; Wed, 7 Dec 2022 15:48:07 +0000 Received: from beas.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 7 Dec 2022 09:48:03 -0600 From: Wyes Karny To: , , CC: Jonathan Corbet , Huang Rui , "Rafael J . Wysocki" , Viresh Kumar , , , Ananth Narayan , , Wyes Karny Subject: [PATCH 1/4] cpufreq: amd_pstate: Add guided autonomous mode Date: Wed, 7 Dec 2022 15:46:45 +0000 Message-ID: <20221207154648.233759-2-wyes.karny@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221207154648.233759-1-wyes.karny@amd.com> References: <20221207154648.233759-1-wyes.karny@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT024:EE_|MW4PR12MB6777:EE_ X-MS-Office365-Filtering-Correlation-Id: 55df4688-9673-4cd9-0bc0-08dad86a6f69 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xX2noqq4W/nG67WvL+E/u/JdDpThN9zv3vYeNairPTCkBuPRUxVhEj749wjCkAZxRDfNhFNXwabHbpbQMhaJVDtnYwX5VP5S7sCE4mDY4Y7qGnMCYqVpwjxbNu3WSnU7Oj4Zrfnndg1P9NtemhcAluxFuMqyEp0cMfi3rmEIes6bUaHyb96PfhEByNd8MNPp6cl16m4rogoUoKoL0iZJt8TPcNagEehbePmLYq7/iEEXXsasKEoTFkCkV1lLDLh/nDw0dWUuhoylIkOZenNnLEHY9pWeCcKpaLW3fJdojVgGqTF3W2FfRjx1huK1hGiYVn0WtuhvbrbeTSaQ7vAS9ZE84bg5w3SYCnjTwZ3ZBMzunEp8ENOyncBKFNrxYukPHasTv0tHNKtLYXPm9A1ouKyg2qBHmmE4pjYZMw7geVGREyXo8DfCwAS1DxjyYOiK5TRrf7OJ1rBk966rgTyfH9NvAhUzWSnjodeRdxPIkKAxad2/q7/jiJ0rPcTXwJBug7LYQ4GLNseQFbL4JaFwZVcY2nJn8oOeCaLK4+y1liau/IkupRgU5qylE7o63UffD06cTyOQMil+01kCTPQAwuXDF/v8a+Qh2jZwyeiXDgfHe6SuTXeplnZTkVIM26GnDSZ/nOmj2iS3bVh419zbB6s+J7NDs9BtSe9Y4vDVOWWsB3g+EA+glybk8Wy8Gpkzxsqs/TgaoCLEg609xdgSa7ZvFQYpRBm0jolkJI9u6Jo= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(396003)(346002)(39860400002)(136003)(376002)(451199015)(36840700001)(40470700004)(46966006)(36860700001)(83380400001)(81166007)(356005)(82740400003)(86362001)(44832011)(2906002)(5660300002)(40460700003)(4326008)(41300700001)(8936002)(82310400005)(8676002)(6666004)(40480700001)(47076005)(26005)(7696005)(426003)(186003)(16526019)(336012)(2616005)(1076003)(110136005)(70586007)(54906003)(316002)(70206006)(478600001)(36756003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2022 15:48:07.3166 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 55df4688-9673-4cd9-0bc0-08dad86a6f69 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6777 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751570959555393177?= X-GMAIL-MSGID: =?utf-8?q?1751570959555393177?= From ACPI spec below 3 modes for CPPC can be defined: 1. Non autonomous: OS scaling governor specifies operating frequency/ performance level through `Desired Performance` register and PMFW follows that. 2. Guided autonomous: OS scaling governor specifies min and max frequencies/ performance levels through `Minimum Performance` and `Maximum Performance` register, and PMFW can autonomously select an operating frequency in this range. 3. Fully autonomous: OS only hints (via EPP) to PMFW for the required energy performance preference for the workload and PMFW autonomously scales the frequency. Currently (1) is supported by amd_pstate as passive mode, and (3) is implemented by EPP support. This change is to support (2). In guided autonomous mode the min_perf is based on the input from the scaling governor. For example, in case of schedutil this value depends on the current utilization. And max_perf is set to max capacity. To activate guided auto mode ``amd_pstate=guided`` command line parameter has to be passed in the kernel. Signed-off-by: Wyes Karny --- .../admin-guide/kernel-parameters.txt | 4 ++ drivers/cpufreq/amd-pstate.c | 60 +++++++++++++++---- 2 files changed, 53 insertions(+), 11 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 42af9ca0127e..75e57afba77e 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -6970,3 +6970,7 @@ management firmware translates the requests into actual hardware states (core frequency, data fabric and memory clocks etc.) + guided + Activate guided autonomous mode. Driver requests minimum + performance and maximum performance and the PMFW autonomously + selects frequencies in this range. diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 204e39006dda..05e4003a77ee 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -50,6 +50,20 @@ #define AMD_PSTATE_TRANSITION_LATENCY 20000 #define AMD_PSTATE_TRANSITION_DELAY 1000 +enum amd_pstate_mode { + CPPC_DISABLE = 0, + CPPC_PASSIVE, + CPPC_GUIDED, + CPPC_MODE_MAX, +}; + +static const char * const amd_pstate_mode_string[] = { + [CPPC_DISABLE] = "disable", + [CPPC_PASSIVE] = "passive", + [CPPC_GUIDED] = "guided", + NULL, +}; + /* * TODO: We need more time to fine tune processors with shared memory solution * with community together. @@ -60,7 +74,18 @@ * module parameter to be able to enable it manually for debugging. */ static struct cpufreq_driver amd_pstate_driver; -static int cppc_load __initdata; +static int cppc_state = CPPC_DISABLE; + +static inline int get_mode_idx_from_str(const char *str, size_t size) +{ + int i = 0; + + for (; i < CPPC_MODE_MAX; ++i) { + if (!strncmp(str, amd_pstate_mode_string[i], size)) + return i; + } + return -EINVAL; +} static inline int pstate_enable(bool enable) { @@ -212,12 +237,18 @@ static inline bool amd_pstate_sample(struct amd_cpudata *cpudata) } static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf, - u32 des_perf, u32 max_perf, bool fast_switch) + u32 des_perf, u32 max_perf, bool fast_switch, int flags) { u64 prev = READ_ONCE(cpudata->cppc_req_cached); u64 value = prev; des_perf = clamp_t(unsigned long, des_perf, min_perf, max_perf); + + if (cppc_state == CPPC_GUIDED && flags & CPUFREQ_GOV_DYNAMIC_SWITCHING) { + min_perf = des_perf; + des_perf = 0; + } + value &= ~AMD_CPPC_MIN_PERF(~0L); value |= AMD_CPPC_MIN_PERF(min_perf); @@ -272,7 +303,7 @@ static int amd_pstate_target(struct cpufreq_policy *policy, cpufreq_freq_transition_begin(policy, &freqs); amd_pstate_update(cpudata, min_perf, des_perf, - max_perf, false); + max_perf, false, policy->governor->flags); cpufreq_freq_transition_end(policy, &freqs, false); return 0; @@ -306,7 +337,8 @@ static void amd_pstate_adjust_perf(unsigned int cpu, if (max_perf < min_perf) max_perf = min_perf; - amd_pstate_update(cpudata, min_perf, des_perf, max_perf, true); + amd_pstate_update(cpudata, min_perf, des_perf, max_perf, true, + policy->governor->flags); } static int amd_get_min_freq(struct amd_cpudata *cpudata) @@ -627,7 +659,7 @@ static int __init amd_pstate_init(void) * enable the amd_pstate passive mode driver explicitly * with amd_pstate=passive in kernel command line */ - if (!cppc_load) { + if (cppc_state == CPPC_DISABLE) { pr_debug("driver load is disabled, boot with amd_pstate=passive to enable this\n"); return -ENODEV; } @@ -670,16 +702,22 @@ device_initcall(amd_pstate_init); static int __init amd_pstate_param(char *str) { + int size, mode_idx; + if (!str) return -EINVAL; - if (!strcmp(str, "disable")) { - cppc_load = 0; - pr_info("driver is explicitly disabled\n"); - } else if (!strcmp(str, "passive")) - cppc_load = 1; + size = strlen(str); + mode_idx = get_mode_idx_from_str(str, size); - return 0; + if (mode_idx >= CPPC_DISABLE && mode_idx < CPPC_MODE_MAX) { + cppc_state = mode_idx; + if (cppc_state == CPPC_DISABLE) + pr_info("driver is explicitly disabled\n"); + return 0; + } + + return -EINVAL; } early_param("amd_pstate", amd_pstate_param); From patchwork Wed Dec 7 15:46:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wyes Karny X-Patchwork-Id: 30902 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp260373wrr; Wed, 7 Dec 2022 07:51:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf4iVQDPwmTEWptCrFjMO1e5E9fq1afMH1Rj0AOfP8JNk9v41uoKZJthrZPkHwBGs+HBTmlE X-Received: by 2002:a05:6402:290:b0:46b:81d2:e3d0 with SMTP id l16-20020a056402029000b0046b81d2e3d0mr32460779edv.314.1670428292294; Wed, 07 Dec 2022 07:51:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1670428292; cv=pass; d=google.com; s=arc-20160816; b=W1CYi14Au9CMCAL7O6/FmkFldEwPZZp/ogLJfLgrKhVIT3l/W9C1SDeS6EyvogaZiN fQdmo9G8D63e4NbuVoAuVkhqnpVBxJUe0Xoo6MphA38XDMDFEdtuqqrwLR2ciFESoUf7 2oRkZew8e5jRqKti/vgnlrG9YV7HaTPK9qTfxajmDgqywYkoPJlUZUt4+C+75sZ1jTiP F1sNrRZ8M4b6zKpdtd1a7kJTTGWC0JxRCJGxEmnQjsvsNhVClF8l3dtXfpZNh9BfZ1UM XSugRvJW9drOfj5oniMmvWMpSEh+pC+i4iGJ4aj8ZwQEBP+Q7eQo4cLiUHL4uDAErL58 QGlA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eLcjDIeSEGypdO8KnNGuif8V4VRy6SJ9CgWUnp/jg/4=; b=bhoyKzRRvFIrrKy7nyikW/9TODEPFk9UR68bNZILZ1ntanHqH/I2fp2u9uXvlHOcvW Kx/MNPrMMvznJzATN7v6UD02hcDdtlRZHm5Z9nrRO2Rq0zPQr7qz5L+AjTBegBwRynQ8 uEE+BlGqg0AkI7oxH52oXuWnBhg/LgjC78pS4LjEzZvax+MQ5gIEo3Z8fgAIj7PVZ6m8 rASIks24l+t5v91FpC4b0cwJKMQ/SEXrrHPJd7uQqlV08RfgltQm2XPrBR/myFWTE+QE YMvWR9YAMG+CXdNIyQMAl81UgSvKJbf2ahKVyWNdZGi8NbYmuBECnJP23DrtYFpBAGQr OKzA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=f+ih5tvv; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp10-20020a1709073e0a00b007c0d6091781si10095286ejc.639.2022.12.07.07.51.09; Wed, 07 Dec 2022 07:51:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=f+ih5tvv; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229723AbiLGPsw (ORCPT + 99 others); Wed, 7 Dec 2022 10:48:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229543AbiLGPsu (ORCPT ); Wed, 7 Dec 2022 10:48:50 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2084.outbound.protection.outlook.com [40.107.237.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 116C924951; Wed, 7 Dec 2022 07:48:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cJQ58hUq/+1/pxI7ErCcqkE927hd5FX0Ml33ngNiN87UDTeiFjbdWhQJ2uYZ8NGP7Fed471036pWonAjPXqomk5h/MK1Kwdm20NqMBJvTTa54rGyXcvoGTyqjGZGzmoK4JvlJ6bl/HQF23U+vhe13OU66GKZYV1H8bc05XF5JatKeWiRtfZFR6NAAxLTLfvmy8pjxwcEwNxqdBdlNcOwo8GNKGMr9Q5U8KjgeFj1rVVZQjvrPH9OYihUO0TDocX9uPtSeD6f12cLuU+weMmkDPJjJebPNzWy302vbs5c2JPxnZTIA1lpcVXkuot2Q84bqvjYu3cFsQ4HfvDZc4NrAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eLcjDIeSEGypdO8KnNGuif8V4VRy6SJ9CgWUnp/jg/4=; b=n6H+JmS8mRObsBj57t40exPEeTA4pIVx3MQg3r5jcqhshwwhx52bQEGwaKg16zVo48gY9TYEpSDZSDwDJ2Bj5Gwgx0kRqEQXH6QRsoUZOV/gS+ajePBocfWkXDWuF72UAcry+8YWxnd14BltIQ9f/ZvMwRq0wtRQ5u9kEwOAmecniuSiSQES5J+kMngtsbsefATZx5c+MHTLQ++UGTrfgqnxjyBkgwAMdbdDktdTmT0OM4l9SuHASNO0Ql/1cqwU28vt/QgDczsZXMyDbl/oxmH6Yor7rBsXU9eSXqUm37lHMY6QT3zG4BG9UEYtXMNdkYSGuERkor6vVONFmamPug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eLcjDIeSEGypdO8KnNGuif8V4VRy6SJ9CgWUnp/jg/4=; b=f+ih5tvv3eUK6HCr4a7EcF36N5vP5Uec2fwNtFKtOh5oxA/M1NO02XmkPX9B5Yii4mf/oZiTPKkJXvhNNTe6Rvv7zM7GGk69BR6USUIGFjj6HTpZcUJn9NdkFh/1Is45RFflQ+SXLiFb3OZaD9CKNzVB4zDHFwEcgYXxrM1hg8E= Received: from BN9PR03CA0630.namprd03.prod.outlook.com (2603:10b6:408:106::35) by CY8PR12MB7195.namprd12.prod.outlook.com (2603:10b6:930:59::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Wed, 7 Dec 2022 15:48:44 +0000 Received: from BN8NAM11FT059.eop-nam11.prod.protection.outlook.com (2603:10b6:408:106:cafe::f8) by BN9PR03CA0630.outlook.office365.com (2603:10b6:408:106::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14 via Frontend Transport; Wed, 7 Dec 2022 15:48:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT059.mail.protection.outlook.com (10.13.177.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.16 via Frontend Transport; Wed, 7 Dec 2022 15:48:44 +0000 Received: from beas.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 7 Dec 2022 09:48:40 -0600 From: Wyes Karny To: , , CC: Jonathan Corbet , Huang Rui , "Rafael J . Wysocki" , Viresh Kumar , , , Ananth Narayan , , Wyes Karny Subject: [PATCH 2/4] Documentation: amd_pstate: Move amd_pstate param to alphabetical order Date: Wed, 7 Dec 2022 15:46:46 +0000 Message-ID: <20221207154648.233759-3-wyes.karny@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221207154648.233759-1-wyes.karny@amd.com> References: <20221207154648.233759-1-wyes.karny@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT059:EE_|CY8PR12MB7195:EE_ X-MS-Office365-Filtering-Correlation-Id: d8984a30-00ce-46c4-1fba-08dad86a8578 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mDQqxwG6zV78pDDR6l9li95NUW38E7v9Nhvh20ntmCvYP2fcZwJu33RsJ6bMMdDO0QtLQVeJBoiLi2cVP3rRS/hlXo7aH9xe2AT03WXsBa004akPGClZZMasayQPQogna2PzgYAieBZefjJGI3idN4N2+JaiSgED6tgknOiDfGuV4NpKcvflADKG9/MYTdUDWKZPimazSfaArU7my+LwNQrEUv3ckAcbsHjeyBzqdQsAeJ5jDSsuaqgvtLwt9GgCWAybG/fIVBbxn/CUY5PPflYK+EwSKB2MRFOxoNf/lEOsXYeqzcKfkKf1cn2j4niKGX2W4A7eS0qz/grjdnfZuVBnpAn5RQ2ExPUrI+6ylK8ZvddWniRQA5u3pnGaGOedH9GazS+97iiw7mZJWIgNPjkRBIGpSlGXNZT6Duai9teduJjI38k6Xx3VVG5LJdjQZJYSCdxZsVK7XBezK1diXrLDdrzAJygJAVD8yUA2ESZpoEZdNQLSlK/KrAj296k14CIRZEUdZWQZRmbmwgc+EoGIlZQpG5+Iv0BMHQfdtSaeTiEJncqTPdYySO+OZfJSStfJSoQnLzHN2lstx935Dy/k2ncnenER6ZBLrKabJmC2ei/O4O1gtEC2kBcipx38jr/XEWicA12PjwyqSI6AO9YGsVsgIhW97d96ZO5GCOetGuWEc2IUZMxvonnVOSSO7coBtGYhGXNtdXxW8utNqS0WPTth0FQ/aPSKmp6j0+s= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(346002)(39860400002)(376002)(136003)(396003)(451199015)(46966006)(40470700004)(36840700001)(316002)(44832011)(110136005)(82740400003)(86362001)(41300700001)(356005)(54906003)(70586007)(70206006)(82310400005)(47076005)(5660300002)(4326008)(36756003)(8676002)(8936002)(426003)(83380400001)(186003)(1076003)(81166007)(2616005)(336012)(16526019)(40460700003)(36860700001)(26005)(7696005)(40480700001)(478600001)(2906002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2022 15:48:44.3409 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d8984a30-00ce-46c4-1fba-08dad86a8578 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT059.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7195 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751571016974697574?= X-GMAIL-MSGID: =?utf-8?q?1751571016974697574?= Move amd_pstate command line param description to correct alphabetical order. Signed-off-by: Wyes Karny --- .../admin-guide/kernel-parameters.txt | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 75e57afba77e..143a38ce27e5 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -339,6 +339,21 @@ This mode requires kvm-amd.avic=1. (Default when IOMMU HW support is present.) + amd_pstate= [X86] + disable + Do not enable amd_pstate as the default + scaling driver for the supported processors + passive + Use amd_pstate as a scaling driver, driver requests a + desired performance on this abstract scale and the power + management firmware translates the requests into actual + hardware states (core frequency, data fabric and memory + clocks etc.) + guided + Activate guided autonomous mode. Driver requests minimum + performance and maximum performance and the PMFW autonomously + selects frequencies in this range. + amijoy.map= [HW,JOY] Amiga joystick support Map of devices attached to JOY0DAT and JOY1DAT Format: , @@ -6959,18 +6974,3 @@ memory, and other data can't be written using xmon commands. off xmon is disabled. - - amd_pstate= [X86] - disable - Do not enable amd_pstate as the default - scaling driver for the supported processors - passive - Use amd_pstate as a scaling driver, driver requests a - desired performance on this abstract scale and the power - management firmware translates the requests into actual - hardware states (core frequency, data fabric and memory - clocks etc.) - guided - Activate guided autonomous mode. Driver requests minimum - performance and maximum performance and the PMFW autonomously - selects frequencies in this range. From patchwork Wed Dec 7 15:46:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wyes Karny X-Patchwork-Id: 30899 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp260022wrr; Wed, 7 Dec 2022 07:50:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf699d2KlX5H2DidqFqER9EQisePw+mQLl1UDAijZbJtSB/rgc+lC6oxlMd4UGYW5kvHNdVQ X-Received: by 2002:a05:6402:144f:b0:46b:51e5:832a with SMTP id d15-20020a056402144f00b0046b51e5832amr38098281edx.331.1670428241597; Wed, 07 Dec 2022 07:50:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1670428241; cv=pass; d=google.com; s=arc-20160816; b=RZ0gNoyFG/4B+qLlcryXboQzsXuwLUyPuHt3p3Jj8avtnB9WvVuRUYYxrTtMYIWN6k m7oetEglKSkSAbGuWGso6Yv8j8MAo6WC7xSMQ6+/zVluc37WaziWwRZlkaAx7A2WaIE2 K8mhH7XmZw5WWByAdTFOnc6zl84nOAqedWd4t0LqFlayjRPvJx9ZsIkGmtzLXNLJSbZU ZOXR6G8VI5n5+fo/BNz978g+D+mf8aHnNbMOR7CXZDkFgYQfrlsMbSTUoFszpeW8K1AM sfKzl+lBSK2RheGa9SlvzhIqbE1RB+RLp4jRCKJzWiZ3D3iK+x2t7QzgtSEJ/mVxONLe YHsQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=MbU1xFoTsR7cw1bOECIU0HE1PRvSMpX49ZRk/kvkMZM=; b=bP9zOt7jTJGurMesAzRz25Bo35OOCl922bamBW69W7sMOPB1Pab7yTOFEcecAXjyuA 4+8NZs/TOvFCyJtGEUqTp8a1fTcMdXX6/MG3OfqFp3FZ7moQbV6T0nTXNUTj3EVN21Xz HBDCqdzts5CrhhvZ3onLCcVZDnR75knicI91AYIB/LxJ/CKG8HW/EelFEhJ07DNomahC fwtEAnBaBdSx/zPmz122KAfOIoOpKTr3yr/YeQarSwye/g4QmdA/hlkwhkASuj7BCIXL /JLvZ99WxXXyekuE/wwAq8GZCjmKdyOXRrEr2ulneEsr+9pN2NmmTrNW1eaVNQ3+3LHs Jt9g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="jvc/4wUL"; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js22-20020a17090797d600b007b7f39942c1si3085927ejc.632.2022.12.07.07.50.18; Wed, 07 Dec 2022 07:50:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="jvc/4wUL"; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229818AbiLGPtU (ORCPT + 99 others); Wed, 7 Dec 2022 10:49:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229861AbiLGPtK (ORCPT ); Wed, 7 Dec 2022 10:49:10 -0500 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2089.outbound.protection.outlook.com [40.107.95.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A804263BAE; Wed, 7 Dec 2022 07:49:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fhiD8iP+PAcw7pAAcj0JsrAL2vx1Y04kQl0bYkMJJsvSN+p9BJEyc510Sr6AqLR8R4rBkl/osAQKt4wPKWzG1pz9tpIXEgXOjAwU6yuF/xUV/z2uVE4uhu1pREX3d2ASDaKzbR9UquV790p0yifd2HdazO4H6PGlnwQkaUxkWdtnekbh+rZiXRE55jta7K2YaCtlA7gjaKLCRrFDM4OdESvZmhDBJxaihuXE+a8HG2RaPg5HYuPHOwXfST4gKfWvenomFcCPSq1tsDZNXi7mPE2EemRFJvPno+uQ/UrxHAfO/FosW3buqNaPnhlMcXsoXOL/ZX3OSvYi7W9FgFsZzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MbU1xFoTsR7cw1bOECIU0HE1PRvSMpX49ZRk/kvkMZM=; b=hmUxvFCHeeJtdhz0RICFR6vuwPHeGzJVUrYHyhBcKEJ39ZJBXkDsV/qBOoEldHRf+Vgd6KHDGe/Ydhqv7uNXsgtACEiXV/bJaKCR+NBBPbRpqqhbnmlFaUGINBfo0TefQU+cb5h15FGW+DPciasWuDthKLHLvkgfFIgXTJoARqPuMZOp8V4XsXTwtBWGGGMxD9q6LAHPNYUtHz3cxxlli4Xf3Z02WuoWwxZrngO+3QZLwxkda8lbUYhpPwOZ6J2Izv134dE2reTvlQh9pvWgrvcpGuKOKSMKWUB1o2UNeRPowSTQJhz0USi9eQAxu00q3hjl5aVBnq0h9T6COLffnQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MbU1xFoTsR7cw1bOECIU0HE1PRvSMpX49ZRk/kvkMZM=; b=jvc/4wULUUJhExjrFelUU567Ams6cWI4qQN17GcG0ce8RyKBMH5eZUaogLZy2iPdcd46Grq/9RtCX/KRFXAoJG1geB4hDDe5aWuat0j/rhRnzPvcVfnrmFkcMLTaPpm50YSW1IcZcQ7glGec6PrOKFHMAF4JpJS25F2aq2S4CTY= Received: from BN9PR03CA0251.namprd03.prod.outlook.com (2603:10b6:408:ff::16) by DS7PR12MB8345.namprd12.prod.outlook.com (2603:10b6:8:e5::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Wed, 7 Dec 2022 15:49:08 +0000 Received: from BN8NAM11FT088.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ff:cafe::dd) by BN9PR03CA0251.outlook.office365.com (2603:10b6:408:ff::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14 via Frontend Transport; Wed, 7 Dec 2022 15:49:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT088.mail.protection.outlook.com (10.13.177.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.16 via Frontend Transport; Wed, 7 Dec 2022 15:49:07 +0000 Received: from beas.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 7 Dec 2022 09:49:03 -0600 From: Wyes Karny To: , , CC: Jonathan Corbet , Huang Rui , "Rafael J . Wysocki" , Viresh Kumar , , , Ananth Narayan , , Wyes Karny Subject: [PATCH 3/4] cpufreq: amd_pstate: Expose sysfs interface to control state Date: Wed, 7 Dec 2022 15:46:47 +0000 Message-ID: <20221207154648.233759-4-wyes.karny@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221207154648.233759-1-wyes.karny@amd.com> References: <20221207154648.233759-1-wyes.karny@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT088:EE_|DS7PR12MB8345:EE_ X-MS-Office365-Filtering-Correlation-Id: f64d1e1a-2106-484d-bf9c-08dad86a937b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: axjqTzW7WbGdtk+d+Q1FUOPqS3ZlRn4AfvRejHuzbmsnYyj73LWvdrSzYOInyQpIB7s6FQYzc1OICOtqcmuPvDAQBJ5/edSTkClCTztvkvn2BrjiyG8ZqiUMAYXqskm6zWZbaqYv0wfpn8dGfLMT7We941aqN3EByDUey29Iti3N8Xnyb+hzdmLCmBntcMCrx1MmU1kl8mWv7pAFlIGbhjtJjLjdT2cCDnFFKSq7pWMJIbG806ZxD1FlByIuSwzSVR3+daM1DDjfGoHqffFa+4z2KD7FKvrOzXYOuHL8ht4XrY1suwnTZ/hFQhBMkCUrBrGRAddNA5NlKbVG8kWe5QpE3kdqQ84DqhY4PLrjZyhuIpQkVTQq8ajunZ5zakJ+yYX9EGS/QZ0G2ar3weVJCgju5YKIS7HgcYrf5HGMEAOLM2nf4WsxRawCSCMJb26fJWJ3CHixSOUfF8/mWb22BPEVZ9gW2WO6gtnvemfFt1svFuM8au/Ln1z7G5JzCvL+1F+FaESmk5iF/nUFm/PT5xKLmoaIJXD2m4heh9Flg3SQOj/zfCUPBWN3tDg15/+QCf0xsa6WVL2GvGEZ2uZaLoS8QDp6is0G9G4j/5w28lc2AZyp/2aDILxj3tyxrG/t5QSoecBJlGuT3kTVTjp5IcpUvWQgKVR7DzFDeZIhtHKMs+Ij8U8F0Q/oBDobHDK9E9Aa7imJbUKjF4znCQYC+m3oLq00zpRxWmurN6ZMN9w= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(136003)(396003)(346002)(376002)(39860400002)(451199015)(46966006)(36840700001)(40470700004)(82740400003)(54906003)(82310400005)(2906002)(83380400001)(6666004)(16526019)(40480700001)(2616005)(40460700003)(44832011)(316002)(8936002)(1076003)(186003)(41300700001)(478600001)(36756003)(336012)(5660300002)(81166007)(356005)(110136005)(47076005)(7696005)(426003)(70586007)(70206006)(86362001)(4326008)(8676002)(36860700001)(26005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2022 15:49:07.8371 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f64d1e1a-2106-484d-bf9c-08dad86a937b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT088.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB8345 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751570963681659173?= X-GMAIL-MSGID: =?utf-8?q?1751570963681659173?= As amd_pstate is a built-in driver (commit 456ca88d8a52 ("cpufreq: amd-pstate: change amd-pstate driver to be built-in type")), it can't be unloaded. However, it can be registered/unregistered from the cpufreq-core at runtime. Add a sysfs file to show the current amd_pstate status as well as add register/un-register capability to amd_pstate through this file. This sysfs interface can be used to change the driver mode dynamically. To show current state: #cat /sys/devices/system/cpu/amd_pstate/state # disable [passive] guided "[]" indicates current mode. To disable amd_pstate driver: #echo disable > /sys/devices/system/cpu/amd_pstate/state To enable passive mode: #echo passive > /sys/devices/system/cpu/amd_pstate/state To change mode from passive to guided: #echo guided > /sys/devices/system/cpu/amd_pstate/state Signed-off-by: Wyes Karny --- drivers/cpufreq/amd-pstate.c | 142 +++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 8bffcb9f80cf..023c4384a46a 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -50,6 +50,8 @@ #define AMD_PSTATE_TRANSITION_LATENCY 20000 #define AMD_PSTATE_TRANSITION_DELAY 1000 +typedef int (*cppc_mode_transition_fn)(int); + enum amd_pstate_mode { CPPC_DISABLE = 0, CPPC_PASSIVE, @@ -87,6 +89,8 @@ static inline int get_mode_idx_from_str(const char *str, size_t size) return -EINVAL; } +static DEFINE_MUTEX(amd_pstate_driver_lock); + static inline int pstate_enable(bool enable) { return wrmsrl_safe(MSR_AMD_CPPC_ENABLE, enable); @@ -623,6 +627,124 @@ static ssize_t show_amd_pstate_highest_perf(struct cpufreq_policy *policy, return sprintf(&buf[0], "%u\n", perf); } +static int amd_pstate_driver_cleanup(void) +{ + amd_pstate_enable(false); + cppc_state = CPPC_DISABLE; + return 0; +} + +static int amd_pstate_register_driver(int mode) +{ + int ret; + + ret = cpufreq_register_driver(&amd_pstate_driver); + if (ret) { + amd_pstate_driver_cleanup(); + return ret; + } + + cppc_state = mode; + return 0; +} + +static int amd_pstate_unregister_driver(int dummy) +{ + int ret; + + ret = cpufreq_unregister_driver(&amd_pstate_driver); + + if (ret) + return ret; + + amd_pstate_driver_cleanup(); + return 0; +} + +static int amd_pstate_change_driver_mode(int mode) +{ + cppc_state = mode; + return 0; +} + +/* Mode transition table */ +cppc_mode_transition_fn mode_state_machine[CPPC_MODE_MAX][CPPC_MODE_MAX] = { + [CPPC_DISABLE] = { + [CPPC_DISABLE] = NULL, + [CPPC_PASSIVE] = amd_pstate_register_driver, + [CPPC_GUIDED] = amd_pstate_register_driver, + }, + [CPPC_PASSIVE] = { + [CPPC_DISABLE] = amd_pstate_unregister_driver, + [CPPC_PASSIVE] = NULL, + [CPPC_GUIDED] = amd_pstate_change_driver_mode, + }, + [CPPC_GUIDED] = { + [CPPC_DISABLE] = amd_pstate_unregister_driver, + [CPPC_PASSIVE] = amd_pstate_change_driver_mode, + [CPPC_GUIDED] = NULL, + }, +}; + +static int amd_pstate_update_status(const char *buf, size_t size) +{ + int mode_req = 0; + + mode_req = get_mode_idx_from_str(buf, size); + + if (mode_req < 0 || mode_req >= CPPC_MODE_MAX) + return -EINVAL; + + if (mode_state_machine[cppc_state][mode_req]) + return mode_state_machine[cppc_state][mode_req](mode_req); + return -EBUSY; +} + +static ssize_t amd_pstate_show_status(char *buf) +{ + int i, j = 0; + + for (i = 0; i < CPPC_MODE_MAX; ++i) { + if (i == cppc_state) + j += sprintf(buf + j, "[%s] ", amd_pstate_mode_string[i]); + else + j += sprintf(buf + j, "%s ", amd_pstate_mode_string[i]); + } + j += sprintf(buf + j, "\n"); + return j; +} + +static ssize_t state_store(struct kobject *kobj, + struct kobj_attribute *attr, const char *buf, size_t count) +{ + ssize_t ret = 0; + char *p = memchr(buf, '\n', count); + + mutex_lock(&amd_pstate_driver_lock); + ret = amd_pstate_update_status(buf, p ? p - buf : count); + mutex_unlock(&amd_pstate_driver_lock); + + return ret < 0 ? ret : count; +} +static ssize_t state_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + int ret; + + mutex_lock(&amd_pstate_driver_lock); + ret = amd_pstate_show_status(buf); + mutex_unlock(&amd_pstate_driver_lock); + return ret; +} + +static struct kobj_attribute state_attr = __ATTR_RW(state); +static struct attribute *amd_pstate_attrs[] = { + &state_attr.attr, + NULL, +}; + +ATTRIBUTE_GROUPS(amd_pstate); + cpufreq_freq_attr_ro(amd_pstate_max_freq); cpufreq_freq_attr_ro(amd_pstate_lowest_nonlinear_freq); @@ -648,6 +770,25 @@ static struct cpufreq_driver amd_pstate_driver = { .attr = amd_pstate_attr, }; +static struct kobject *amd_pstate_kobject; + +static void __init amd_pstate_sysfs_expose_param(void) +{ + int ret = 0; + + amd_pstate_kobject = kobject_create_and_add("amd_pstate", + &cpu_subsys.dev_root->kobj); + + if (WARN_ON(!amd_pstate_kobject)) + return; + + ret = sysfs_create_groups(amd_pstate_kobject, amd_pstate_groups); + if (ret) { + pr_err("sysfs group creation failed (%d)", ret); + return; + } +} + static int __init amd_pstate_init(void) { int ret; @@ -695,6 +836,7 @@ static int __init amd_pstate_init(void) if (ret) pr_err("failed to register amd_pstate_driver with return %d\n", ret); + amd_pstate_sysfs_expose_param(); return ret; } From patchwork Wed Dec 7 15:46:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wyes Karny X-Patchwork-Id: 30908 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp260987wrr; Wed, 7 Dec 2022 07:52:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf42+0fE3prNFyOagv9XIJbeBZMmmtt12ASPh9vAqrMlSQj1KllPBSk85xbvs56m4gnvXXVH X-Received: by 2002:a17:906:43d8:b0:7bd:7455:a196 with SMTP id j24-20020a17090643d800b007bd7455a196mr44694303ejn.71.1670428370626; Wed, 07 Dec 2022 07:52:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1670428370; cv=pass; d=google.com; s=arc-20160816; b=oZFhK1Hn6W0TQ1UfS55kY6N9Yk5JOSHFNI+A8km8K32gx6xjXpUzwpiMMpJAPnUJfw 0y2sdP+2+A+m+x/Cf05cL4dG9zSfW0toIZ5oQWPIeZntcFyFsVytVFjfFmPKnxOjqAQn GIhKLBDoLeV4DR5SWRdiUvlMdlAMxBe44KbXb/4GCANJ7hacyNcQv6lLxr0PHSkSAZ8f smvXd95i1kaFTpJWJfRM5gABHo0zx7TUF6nPYmsQo9zgrgrLaOPASwOtIszs5oSRmyIu J79N9lROWjtJiIc9R+sZ67Pb2RZLx+BlDR9E1poSPj3tN6HAH/L8g2C/uEZvzO5nxa/V Mk5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tdTCKrYg4Vocmoj1X2D2pS5MTAwtyjEWaMTIrs2/9Fs=; b=E5ruQD3oH60YZaYIzeIPobqp3Wl6K4/bFyie0fSQNtxE+wfkoYUhEdCnaNOeLydpcY 1lqgB2ftTTtFTk1UVjjQcbFUSaRFQ5Xb6hF3pjYjnJ1YqNbTZ6wsostTkR4YteTz6eJc Q32AlWrp7vAAau5J7VIzVNuoSiiCCNY7yheFHEv1uvKRjhRYCf3ehY35uY9L1+wUMjrO 9smAtyOy/PVF1OSePM6fdn1vXPDsnYF1XuEAyh/XcFIR3rAbAqGiKFxTRU163IU5ZTKa KmExyMi0dVXIuaKd8Fc00OninRFItruUeTzlZxKhxdfVesedHvmTtUbCxQJYSi+9SUsN 0vRg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=P9KQHibS; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o13-20020aa7d3cd000000b0044ecd80f257si3897098edr.603.2022.12.07.07.52.27; Wed, 07 Dec 2022 07:52:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=P9KQHibS; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229967AbiLGPuk (ORCPT + 99 others); Wed, 7 Dec 2022 10:50:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbiLGPt6 (ORCPT ); Wed, 7 Dec 2022 10:49:58 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2082.outbound.protection.outlook.com [40.107.220.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01F9E5D690; Wed, 7 Dec 2022 07:49:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IpIAnjDJ3WjWy3BSS3GMVXOAccUUMZ/6OswVjHcW5rjWqJE43+xjIOOXku2Lw/aPlIpMQs8WhQCu/EYgiJOoSt0OIR4R7Et292ume416kZ9f0rg+cJOxfl+NPjRSUj/X6zyXBKZTsLMxcIUrZwmGeCO5GMh0CyzNmWa7Bk6SkRS37fr55SrCVj7Jv0KvupYKJn4S1i2hwBCjcVSDN7+/Znht9jCKx2Avnk+7nsGcW4OJX1ydOM5zaEP3a7OXnRQj0JkKD37ZR/3XVCFJB99yoQDvP8xCdtMEDJCHrSq5hBmPSbYmipqM42XAM1jghPKN6AOvFkBoBXFXvtaHf7mI+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tdTCKrYg4Vocmoj1X2D2pS5MTAwtyjEWaMTIrs2/9Fs=; b=mdZk+yT3heE2Ux+tT4WakgZjb2ATb5yszd1IDCB28y1bKlwKid8UAS4UrJpzbz9K3NdpV5vdMy73Q2EVlNlfNhhFAIhRrwL9z9+eO0rTy75kRqDSq6o8HID7QJiBuNrASEVSc9EWIsOqn/uyEyVV3IprWKrETtQMs8mPh2V5Hebek0DHUBEmZrZO2vbK7hC/6yp3fg9ApoTn0XP+44fPRUMOt/qmwdEBvkaz5f//dU4Pz/zbcWrgVwVm1pB+fnBcdgOg7mkb7rawJ4uXqr5pPjX3/biG2Cp2orNYF81i9oluXz1MvI3dyN69ChksPamNZNMX9VgLEYb4Pe+8ierIGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tdTCKrYg4Vocmoj1X2D2pS5MTAwtyjEWaMTIrs2/9Fs=; b=P9KQHibSNLgJYOpp0vP13j3fi6ba5PhuZuk1o9iGYsBEXhxqiU4MFnJqI3jeJZOF+okwgvFXTZDPGVGzgmPh/pejDPRHJhH9GjjZWGMlZ5GNV6noJFA5pWi2AQQ/cCJ8omvF2G2n9kb+cmpdFkOOAlxPW3TRIAYE4n4lXDrnfVo= Received: from BN8PR04CA0049.namprd04.prod.outlook.com (2603:10b6:408:d4::23) by MW5PR12MB5649.namprd12.prod.outlook.com (2603:10b6:303:19d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Wed, 7 Dec 2022 15:49:56 +0000 Received: from BN8NAM11FT073.eop-nam11.prod.protection.outlook.com (2603:10b6:408:d4:cafe::b3) by BN8PR04CA0049.outlook.office365.com (2603:10b6:408:d4::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14 via Frontend Transport; Wed, 7 Dec 2022 15:49:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT073.mail.protection.outlook.com (10.13.177.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.16 via Frontend Transport; Wed, 7 Dec 2022 15:49:55 +0000 Received: from beas.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 7 Dec 2022 09:49:50 -0600 From: Wyes Karny To: , , CC: Jonathan Corbet , Huang Rui , "Rafael J . Wysocki" , Viresh Kumar , , , Ananth Narayan , , Wyes Karny Subject: [PATCH 4/4] Documentation: amd_pstate: Add amd_pstate state sysfs file Date: Wed, 7 Dec 2022 15:46:48 +0000 Message-ID: <20221207154648.233759-5-wyes.karny@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221207154648.233759-1-wyes.karny@amd.com> References: <20221207154648.233759-1-wyes.karny@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT073:EE_|MW5PR12MB5649:EE_ X-MS-Office365-Filtering-Correlation-Id: 10d2e681-5b36-4222-592b-08dad86ab00b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VhR5+KGNOJ7yhq4E1zsbMURCoDRnhD4Bdzjrhoq0Ztj7hO/R88xYSu92oNhtQ/iZOPVhqcdb3rE/y1BPHAaCiMAehid60iF9ZoTAhbgHmMeF0obn2zCZD+i98paIjpj2yEEcRCchLxNPhWfQvihbpdTlofHtfhVE+Hj9s/j43pKqldtllUaE9/B+RZ5r3MzzcOOCQGekbKrbW0r4E7PG+x2L5yLSiC/cOduRymY5gCkdyOlAVF2jml7DNeLQkCOBvu2AYsBmiMSFCqjQT83v7uFhCDuwyFmj7Vp/o3zekD5uPghxaV/1G2PZo5ZBxhTAlt12GMTSHA+ZBsbMZipSJPqiyRuppwEPZH+ej4y8wydk+OkWmRt/KBfZkvO8QhfsCitSKvnnx+2Og3diS2smU5PtgnMn0qC3wnUHJUsv3m0HVQ0IDDUE12ys5iN59GTc1SO9+ARRLboNs+A7BXiqo/HUJt4xdPBkbj08nirLocGWkCFj4OquCLPs1K4sTGtkZTcDjKVUnQyhRTWIXJpXCbeYYWJRYD38ijvgLJAOtSKasJnYa8wUN1u6R/XQwdqxFtZrsaa7jR2KwFKk0HSD1wYlBOK1SCZ/90bR1HmyyRPb8xI1giBwUByuv91KiG57Dvl0iEVDj+KX5XHgYRShhPTTvGdI8wnOPyHtMKYCVyHdM4g/FU/P/hud0ojVukWnbxc6oc1RmAR4x+5AhklmwY4Q7NDwurVTx05jrCVdW1s= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(346002)(396003)(136003)(376002)(451199015)(40470700004)(46966006)(36840700001)(478600001)(82740400003)(36860700001)(356005)(2616005)(2906002)(81166007)(7696005)(26005)(44832011)(5660300002)(83380400001)(82310400005)(47076005)(36756003)(16526019)(336012)(186003)(86362001)(41300700001)(40460700003)(426003)(54906003)(110136005)(316002)(1076003)(8936002)(4326008)(8676002)(40480700001)(70586007)(70206006)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2022 15:49:55.7544 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 10d2e681-5b36-4222-592b-08dad86ab00b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT073.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR12MB5649 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751571099180084362?= X-GMAIL-MSGID: =?utf-8?q?1751571099180084362?= Add documentation for amd_pstate `state` interface. User can see the current state of the driver with the help of this sysfs interface: # cat /sys/devices/system/cpu/amd_pstate/state # disable [passive] guided User can load/unload driver with the help of `state` sysfs interface. - Load driver with passive mode: # echo passive > /sys/devices/system/cpu/amd_pstate/state - Unload the driver: # echo disable > /sys/devices/system/cpu/amd_pstate/state - To switch to guided mode: # echo guided > /sys/devices/system/cpu/amd_pstate/state Signed-off-by: Wyes Karny --- Documentation/admin-guide/pm/amd-pstate.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst index 06e23538f79c..4d3783516ddc 100644 --- a/Documentation/admin-guide/pm/amd-pstate.rst +++ b/Documentation/admin-guide/pm/amd-pstate.rst @@ -265,6 +265,17 @@ This attribute is read-only. Other performance and frequency values can be read back from ``/sys/devices/system/cpu/cpuX/acpi_cppc/``, see :ref:`cppc_sysfs`. +``state`` + +``amd_pstate`` also exposes a sysfs interface to view and control the driver state. +The driver state can be one of the following: +``disable`` : indicates driver is in unloaded state. +``passive`` : indicates driver is loaded and currently in passive mode. +``guided`` : indicates driver is loaded and currenlty in guided autonomous mode. +This file can be found here: ``/sys/devices/system/cpu/amd_pstate/state``. + +To switch to passive mode: ``echo passive > /sys/devices/system/cpu/amd_pstate/state`` +To switch to guided mode: ``echo guided > /sys/devices/system/cpu/amd_pstate/state`` ``amd-pstate`` vs ``acpi-cpufreq`` ======================================