From patchwork Mon Jun 5 15:11:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 690051 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 35183C7EE2D for ; Mon, 5 Jun 2023 15:13:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232916AbjFEPNW (ORCPT ); Mon, 5 Jun 2023 11:13:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233190AbjFEPNL (ORCPT ); Mon, 5 Jun 2023 11:13:11 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2078.outbound.protection.outlook.com [40.107.220.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA1AB19BF; Mon, 5 Jun 2023 08:12:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GUzQatWOIBafNen1TbSzfE89iblQgK+KlDUx4DJG7D6VVlQdyOqO9JlFhxjmOB9PQ0/yER3Bc6MG9RoJQ0aBHxhhJcR+HK35OIRW9qBx3yuLof92yfI5GvgFykFef8/Nm5fu3Jdwd11U1+xiLn7YEa7eg8zFISbtPZPuy8x7xem3Z5PjJKktnalNHYhqfjg+V9c/YG271dXOsrJxmf6pM1vBfLBXaV0aHM+miC8Gk23CxbKI+C6ahCx82pNqGh+92UH0MSmfhMbi0iSPZerSHxSqJaemY4DnbonlFfqNus6FvIuFqQYd8Y2TBRpamo3oQutrs9PLFXNISs64c0nGNQ== 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=l+09+kDNMWYV43WnV3d+/pfY/d0oRazO3wK43obyAVA=; b=ceY5rZyyds3XEIJ+KIBNYxzyCrBcQlG4Oz6almazb6XyPl/w8evQxMIWF5dGDN7/s1mpzPH2ymL07iF1dI9HMWdym+nCOWJlThcoazRfmLfb8gDVGW9fJeH3EzGhU7dNroZJc/3SRZkoAjcbDaxSdzf+4DCg/VHi63sdObChlMO/c1wzuY667/asneKdxngR9ZD6IeFaMmciqPL+4sCZ/baiJMvKixT3BoVDJmOb87GKUCY2QPfI86czkV6eAtKYpw9KnxYnkVV5dF5qIAidPNjyP0A2f3pecBa+1+zJ8IUUVMlGBxShigJWCgHE+DFdAYiJISCnxb5hkFVnmibDXQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linux.intel.com 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=l+09+kDNMWYV43WnV3d+/pfY/d0oRazO3wK43obyAVA=; b=xqxDRQKXe+Ej3y/hVEMEu6mKKJ2872l+glt4JGk2gw6Ld616Yesnz5kzTYaeIP+k2iHad0ishjyzUMWKk4a/8YbhWM6twxTJPYATC3ZqkTs2RzGHM7WYWlDXriC3MguLxA+WJT3YnKUm1ASXnfeOY55Dtjldty8HQlFp8ngGCX8= Received: from BN0PR10CA0012.namprd10.prod.outlook.com (2603:10b6:408:143::10) by IA0PR12MB8975.namprd12.prod.outlook.com (2603:10b6:208:48f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33; Mon, 5 Jun 2023 15:12:05 +0000 Received: from BN8NAM11FT007.eop-nam11.prod.protection.outlook.com (2603:10b6:408:143:cafe::92) by BN0PR10CA0012.outlook.office365.com (2603:10b6:408:143::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33 via Frontend Transport; Mon, 5 Jun 2023 15:12:05 +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 BN8NAM11FT007.mail.protection.outlook.com (10.13.177.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6455.33 via Frontend Transport; Mon, 5 Jun 2023 15:12:05 +0000 Received: from SITE-L-T34-2.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; Mon, 5 Jun 2023 10:12:03 -0500 From: Mario Limonciello To: Huang Rui , Srinivas Pandruvada CC: "Rafael J . Wysocki" , Len Brown , Viresh Kumar , Robert Moore , , , , , Gautham Ranjal Shenoy , "Wyes Karny" , Perry Yuan , "Mario Limonciello" Subject: [PATCH 1/4] ACPI: CPPC: Add a symbol to check if the preferred profile is a server Date: Mon, 5 Jun 2023 10:11:30 -0500 Message-ID: <20230605151133.2615-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230605151133.2615-1-mario.limonciello@amd.com> References: <20230605151133.2615-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT007:EE_|IA0PR12MB8975:EE_ X-MS-Office365-Filtering-Correlation-Id: 7700be57-2833-4ef4-5da2-08db65d7390d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kLDPJH4gA7haWpOtCF+VK0Tju/dt7u91pNi3jSDU4OtQNeGsctnegIKMM4MP9JOeykL83y2E64h1cNzbWslEmIu85YX78kawRviFKOUvw8q8pfF3mk5iO4ong7sHP+hnBr1Nr1AIb8uYYsDg4qFRC2soTOVl5smXcSLIfabeA2/BRz1geyCr2ehmVCa0DriRlohS1JV0Fq9e4rSaAZoij9i4oQIe8VC0+c+8qPXY/uek6mE2oHkKZpzNwEUdrRc0VE0DwIFmNTtqP3fgv3bh1rYVliXQsSFYrFT5k6nl5KtaCIkcAUlNhsnyNc2BGdqafV5dXVVGsoulWOO2mCbjcFD8BgIBVBJEkP0rC5jIy1S2GKvHA9f6rj8i2oxKUDapEnJ1Y7D++0HkPeap/mdoLY8elS0cNy3J1nALkq+vnINyTcUVfyYSPdPU8umwzIeols2SflfyVz+9WbAkIueF4Wnqbi2I6MIldSlq+XDroqTas2AVif0Cz7TFnogfjSL1AXqa0fyGLzWFOrlDs4+3m0OlnacoC+IQ+Gp33IApbtdva+0E2WwFXMkALJCk7XDobduVyDWDrN1EwD/5+fIjelj8q24BoKiFYmI8UdfHyuAjd0We7oxAKV2wZ4CanArEu1BERsAGPBBgLkn4RezBtVctw1K4sQ/Tp7vQW1Ghgs63nQnCoRYnI+pifqDdsNzagr/QKWOkLd/Mxj3Ie5rTHWqmTA6MadKqY5HB7wUy3nVW207Pkd6CQ00Oaq6ZftpKURWEFyWkHf88Wjo9HhH0Dg== 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:(13230028)(4636009)(396003)(39860400002)(136003)(346002)(376002)(451199021)(36840700001)(40470700004)(46966006)(7696005)(6666004)(82740400003)(2906002)(356005)(81166007)(70586007)(70206006)(36756003)(110136005)(54906003)(8936002)(5660300002)(44832011)(86362001)(8676002)(41300700001)(4326008)(40480700001)(316002)(478600001)(40460700003)(336012)(426003)(2616005)(966005)(26005)(1076003)(16526019)(186003)(36860700001)(82310400005)(83380400001)(47076005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2023 15:12:05.2139 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7700be57-2833-4ef4-5da2-08db65d7390d 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: BN8NAM11FT007.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8975 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This symbol will be used by intel-pstate and amd-pstate for making decisions based on what the FADT indicates the system pm profile is. Suggested-by: Gautham Ranjal Shenoy Link: https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/05_ACPI_Software_Programming_Model/ACPI_Software_Programming_Model.html#fixed-acpi-description-table-fadt Signed-off-by: Mario Limonciello --- drivers/acpi/cppc_acpi.c | 34 ++++++++++++++++++++++++++++++++++ include/acpi/actbl.h | 3 ++- include/acpi/processor.h | 10 ++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 7ff269a78c20..d8827eae3ba4 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -941,6 +941,40 @@ void acpi_cppc_processor_exit(struct acpi_processor *pr) } EXPORT_SYMBOL_GPL(acpi_cppc_processor_exit); + +/** + * acpi_pm_profile_server() - Check if the system is a server. + * + * Return: true for server profiles, false for anything else + */ +bool acpi_pm_profile_server(void) +{ + switch (acpi_gbl_FADT.preferred_profile) { + case PM_ENTERPRISE_SERVER: + case PM_SOHO_SERVER: + case PM_PERFORMANCE_SERVER: + return true; + } + return false; +} +EXPORT_SYMBOL_GPL(acpi_pm_profile_server); + +/** + * acpi_pm_profile_undefined() - Check if the system is an undefined pm profile. + * + * Return: true for undefined profiles, false for anything else + */ +bool acpi_pm_profile_undefined(void) +{ + if (acpi_gbl_FADT.preferred_profile == PM_UNSPECIFIED) + return true; + if (acpi_gbl_FADT.preferred_profile >= NR_PM_PROFILES) + return true; + return false; +} +EXPORT_SYMBOL_GPL(acpi_pm_profile_undefined); + + /** * cpc_read_ffh() - Read FFH register * @cpunum: CPU number to read diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index e5dfb6f4de52..451f6276da49 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h @@ -307,7 +307,8 @@ enum acpi_preferred_pm_profiles { PM_SOHO_SERVER = 5, PM_APPLIANCE_PC = 6, PM_PERFORMANCE_SERVER = 7, - PM_TABLET = 8 + PM_TABLET = 8, + NR_PM_PROFILES = 9 }; /* Values for sleep_status and sleep_control registers (V5+ FADT) */ diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 94181fe9780a..05a45ebddaea 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -360,6 +360,8 @@ int acpi_get_cpuid(acpi_handle, int type, u32 acpi_id); #ifdef CONFIG_ACPI_CPPC_LIB extern int acpi_cppc_processor_probe(struct acpi_processor *pr); extern void acpi_cppc_processor_exit(struct acpi_processor *pr); +extern bool acpi_pm_profile_server(void); +extern bool acpi_pm_profile_undefined(void); #else static inline int acpi_cppc_processor_probe(struct acpi_processor *pr) { @@ -369,6 +371,14 @@ static inline void acpi_cppc_processor_exit(struct acpi_processor *pr) { return; } +static inline bool acpi_pm_profile_server(void) +{ + return false; +} +static inline bool acpi_pm_profile_undefined(void) +{ + return true; +} #endif /* CONFIG_ACPI_CPPC_LIB */ /* in processor_pdc.c */ From patchwork Mon Jun 5 15:11:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 689622 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 ECC06C7EE2F for ; Mon, 5 Jun 2023 15:13:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233223AbjFEPNX (ORCPT ); Mon, 5 Jun 2023 11:13:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233071AbjFEPNL (ORCPT ); Mon, 5 Jun 2023 11:13:11 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2070.outbound.protection.outlook.com [40.107.101.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0194CE8; Mon, 5 Jun 2023 08:12:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YYU8TQdtODqQI75lRA7JqdoIfFdnuioavtgCbyP7bzUoEwZB46Zj41B8wU1AGe1aL+yosczzA3ah3AKOjr3atPVQiwzpDy/oiQEOE1Bm4dgjZp/DxCGpWyM8I/1FgqLjteZSBj9uzOKXA8KGPNd5gel+Z5kyYzWM9VT92D0h3AU4q4G7bu/cybATYPV2TUQbg+Lm3u5wez962ANV/MkshqKtZCoRPlrdkEcexZmZng3wJfIn3YfRibMvxHb9jFtSXzvC8mkfH+CIl+LPMISg3RR1H7aC+qSoJ+RQvMVy3sFghoYBqGSxEq3tFH8Tt2yZa0akcKUvQpCiijuCWEdV/g== 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=ChaQ9lNPtNyKNnZV71xB2tlKUgQQktowOWEwvfHQxDQ=; b=iQEyaK5VEC/UQ2dmNZsjf5trCJ+94qJBa9+gZ+6O7QBuXWLYMBmiIJDmPYvW/TPbTqmjC8KFYxU0sGfP0D01UqngKWPCy/aLHDTfmKNJ4TTg1BYew5ZYh2VS8vqLlXOtTnXe55wzbaK6PdZWAyPAL2w4JKEsx9VUYFxlJ0qXkI49cHi2ScOD4LlEURE1pnUwol5CixTxCEyoxkZqM6zBqf4C71Iw3Xuz7UW/GTzq6KO5NE2oBdGwwuMksn6UY0MzEl3ClRRzNWSsEjXNGP1vBvrbfctfHxrAtaR6UI254HZ4nSS6AfaposJPVks2gRHdiwQMJOuf7sFsUVqN8URD7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linux.intel.com 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=ChaQ9lNPtNyKNnZV71xB2tlKUgQQktowOWEwvfHQxDQ=; b=z0ywWqvV1XamHcfFkKNoL12SZ3U/Dm4u+yJvIoJuuO6SzOzkRBf+bbrQjed5wLmPPtBL+5UPM5FaaFaZQY8aVqzFqcxvbBrDojWy0VGL9xfDLpgkfs0QEQf8954A3e+V7E1m1Scyur2NZ9RHXKJX6Uz7GmINJ03o34kivUzcuEA= Received: from BN0PR10CA0025.namprd10.prod.outlook.com (2603:10b6:408:143::22) by LV3PR12MB9117.namprd12.prod.outlook.com (2603:10b6:408:195::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Mon, 5 Jun 2023 15:12:06 +0000 Received: from BN8NAM11FT007.eop-nam11.prod.protection.outlook.com (2603:10b6:408:143:cafe::cc) by BN0PR10CA0025.outlook.office365.com (2603:10b6:408:143::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33 via Frontend Transport; Mon, 5 Jun 2023 15:12:06 +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 BN8NAM11FT007.mail.protection.outlook.com (10.13.177.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6455.33 via Frontend Transport; Mon, 5 Jun 2023 15:12:06 +0000 Received: from SITE-L-T34-2.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; Mon, 5 Jun 2023 10:12:05 -0500 From: Mario Limonciello To: Huang Rui , Srinivas Pandruvada CC: "Rafael J . Wysocki" , Len Brown , Viresh Kumar , Robert Moore , , , , , Gautham Ranjal Shenoy , "Wyes Karny" , Perry Yuan , "Mario Limonciello" Subject: [PATCH 2/4] cpufreq: amd-pstate: Set a fallback policy based on preferred_profile Date: Mon, 5 Jun 2023 10:11:31 -0500 Message-ID: <20230605151133.2615-3-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230605151133.2615-1-mario.limonciello@amd.com> References: <20230605151133.2615-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT007:EE_|LV3PR12MB9117:EE_ X-MS-Office365-Filtering-Correlation-Id: 50eba676-5bee-4bf9-ec79-08db65d739e3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: usBS75djn7c3byEiLIEfHBeOZ3Nj6jsAIc44AUFg4Nt1oWk50Trw3jjv3VihqXiBfPXAIW0AcB/y3nCv9B4VzKGCW9VkSE5ljnZe+WOCPsrUsBsn6oiILVgORG8CRjakX2t+/Wx0dxsBPCIUkqQ4TN4UqvOl6/lsh5j1RBW8LsB2Rz8GS8m/H1By+UUj3YhW/FGgF+egqT+Ez0HyZY7HK+t/SNz+Jbs90JxPxmplqsQJPPVymzEndXE+1iOBXSu5QhRrCa6xX0AcQRrMUtJBCGuo5ABsoPFhR8Et2Wt7HEtAlx/47qUbJr/2/OWoR3Kv1gyJl2Azn3q4kAwrB2Y3mfQzJI93iFCoOlS9xNCaZMOq97DblUSGu6DQ7Uokqgk65gcBoEKbd5R394JipGKl8nUKQ3Uip0rS0Nr8M0D5vzJ22v2oWcG/G9tmNW9CP04lDOoqxJ8CzZk/FAHbuBTmPQ/097HRvYc9F2BQ5WAJv1PawOvPUxvIXtks8PbH6kITAfmaBYTVUDPc18zTQ6UuGhAQwcPfmLu1mJss2hqobI5+8qVgY/0pHKw+Pzl+0EhoFGNm5QUtu3yLJruIAGk6mQbyC3fSp68FJtpLGcjxVbzVqIuB4nJ33u0AyzwdrQviD7FoLtlvlhkeV+9tN75XscNZ2ILVmLS2OE0WmhrIdMbCTV78LBIfqNVOlJ+pqCK1lURUE1nOra1rwYOrfqofelFumynr7sTHgtMV3XD41xTgIkdPp4/wbP0jH+mfTKG8qVvJK+b7AXCaI2PBgRaVXw== 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:(13230028)(4636009)(376002)(39860400002)(396003)(346002)(136003)(451199021)(46966006)(40470700004)(36840700001)(70586007)(70206006)(2906002)(478600001)(316002)(4326008)(8936002)(8676002)(41300700001)(54906003)(110136005)(44832011)(5660300002)(6666004)(7696005)(40460700003)(1076003)(26005)(966005)(16526019)(82740400003)(356005)(2616005)(40480700001)(186003)(47076005)(83380400001)(426003)(336012)(81166007)(36860700001)(36756003)(82310400005)(86362001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2023 15:12:06.6357 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 50eba676-5bee-4bf9-ec79-08db65d739e3 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: BN8NAM11FT007.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9117 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org If a user's configuration doesn't explicitly specify the cpufreq scaling governor then the code currently explicitly falls back to 'powersave'. This default is fine for notebooks and desktops, but servers and undefined machines should default to 'performance'. Look at the 'preferred_profile' field from the FADT to set this policy accordingly. Link: https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/05_ACPI_Software_Programming_Model/ACPI_Software_Programming_Model.html#fixed-acpi-description-table-fadt Suggested-by: Wyes Karny Reviewed-by: Gautham R. Shenoy Signed-off-by: Mario Limonciello --- drivers/cpufreq/amd-pstate.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index ddd346a239e0..c9d296ebf81e 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -1102,10 +1102,13 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) policy->max = policy->cpuinfo.max_freq; /* - * Set the policy to powersave to provide a valid fallback value in case + * Set the policy to provide a valid fallback value in case * the default cpufreq governor is neither powersave nor performance. */ - policy->policy = CPUFREQ_POLICY_POWERSAVE; + if (acpi_pm_profile_server() || acpi_pm_profile_undefined()) + policy->policy = CPUFREQ_POLICY_PERFORMANCE; + else + policy->policy = CPUFREQ_POLICY_POWERSAVE; if (boot_cpu_has(X86_FEATURE_CPPC)) { ret = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, &value); From patchwork Mon Jun 5 15:11:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 689621 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 BCA80C7EE37 for ; Mon, 5 Jun 2023 15:13:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234759AbjFEPNY (ORCPT ); Mon, 5 Jun 2023 11:13:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233142AbjFEPNM (ORCPT ); Mon, 5 Jun 2023 11:13:12 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2067.outbound.protection.outlook.com [40.107.223.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DCE2E41; Mon, 5 Jun 2023 08:12:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hD+tbAv1vhnm2JVj5htWrwJG56T+qDfe77fDPK6wiPYAKTj1KgHBrZ2OAEX03Zt9GtAoGbSSp+Q3nCuoSoZ2apQWbPGV+jWsqMXrqURP70Dc7RP1BCOerFlIyTY8cfmrgycAYH5smcceMxGPJxAZz5gCpDzEZRxWaMOIjNKoWYbFVuIUWizCwimyPb28yja0N3rUIins15XldWT+DFYgnDLE8swr0qutv8srcoY8sejaAJJIq/0kfqlJ3VVY2EU+64lnkF0cV15VejiYkSR+AtCj6CSKVAsSSeLVFVpF2xYVVyq2fnZMHayAFmOEvAj6VaLDTMp/B9m7hg1Mn2HoNA== 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=CzQ2KWMXjRSVTAL+fx2erOuQCj62nylaK5GzwzkvDJY=; b=UCfTtImEwWVCX1pD2t84FZbL8CMrFDgc3zcx1wNAnWc0hrI8vuaNXQLIrrEwzwXadqkGR9ZjquKmJbnAMyltqdkXs5cZ7Y1Hi7Trgp3iADO8/5rqOblt9HwXI0jopyMAnFFETjV4JGSyYUZvzGSQiVZXsstW6T8AbwIKeF6waZzSAPQ+g8ahROKLPxxjQzOt9VQ7EU3IvJ0IVGVh4oU9N2KvpscgHeQ9q+4fLTVdqwB+QCMKB/H9rsXHUZOCs/ME+sc8P4LgsrgSYm2TCF3Md2rOfo4amYFMrVrfzmkFyz8F4nZ6BeuVTXC13g0br7x591BmtEebNqjGtn2pDsY5Fw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linux.intel.com 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=CzQ2KWMXjRSVTAL+fx2erOuQCj62nylaK5GzwzkvDJY=; b=bs30l8MGsPtHmMPd9UHeAnCyJB8clFaCY6BEQUW4vv60gC3DQC+pIcS4Y5tLBQGX2kFKpU+Wrbf6LWGdMrUcw0M+idMroQWIPD2hffEyn5X4rLzyMx5oq7VLwydM3usHLFLwhJd4b0XAUjOHUrZ1PBueIZVOBT56GCeP1FNn+us= Received: from BN0PR10CA0024.namprd10.prod.outlook.com (2603:10b6:408:143::15) by DM6PR12MB4877.namprd12.prod.outlook.com (2603:10b6:5:1bb::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Mon, 5 Jun 2023 15:12:07 +0000 Received: from BN8NAM11FT007.eop-nam11.prod.protection.outlook.com (2603:10b6:408:143:cafe::71) by BN0PR10CA0024.outlook.office365.com (2603:10b6:408:143::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33 via Frontend Transport; Mon, 5 Jun 2023 15:12: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 BN8NAM11FT007.mail.protection.outlook.com (10.13.177.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6455.33 via Frontend Transport; Mon, 5 Jun 2023 15:12:07 +0000 Received: from SITE-L-T34-2.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; Mon, 5 Jun 2023 10:12:06 -0500 From: Mario Limonciello To: Huang Rui , Srinivas Pandruvada CC: "Rafael J . Wysocki" , Len Brown , Viresh Kumar , Robert Moore , , , , , Gautham Ranjal Shenoy , "Wyes Karny" , Perry Yuan , "Mario Limonciello" Subject: [PATCH 3/4] cpufreq: amd-pstate: Add a kernel config option to set default mode Date: Mon, 5 Jun 2023 10:11:32 -0500 Message-ID: <20230605151133.2615-4-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230605151133.2615-1-mario.limonciello@amd.com> References: <20230605151133.2615-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT007:EE_|DM6PR12MB4877:EE_ X-MS-Office365-Filtering-Correlation-Id: b499e21b-5261-4aba-4869-08db65d73a43 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PkH0RsyjfbUtACG70U6F/fw9qFT5fFXwn7SsHZXXnE/FtETiGCBJhZ1qj1w8Dg6r9u/cLJBIL5GmanFHzVJym/2xUTvkqyTfAdKzs0cOk0Yo7TAUCgngipB5EuxvlDEeQeTwsIf5Qi/+lPmZuZSyrpIS4driwBrWAMuy/iE1HHoZ7yXIaV85ruHL11gUSpQaQ3mK0gXSU68g0iKsaP4szA0X1RJDJginIoyAjM4PBeMXeFFQ6wnw1tYjbPzBgt4pVFPGtC/lHZx4/due34ImiwMj8lLpycsmniJglyk9Y/Zosc5VYVxZeWFu3t8LLdbSuGk8wZdCLGE4Fs8mSeYYl8AOvsv3nmny+QAXzZzlNdDjWijl2h0ysP3URvrn/zC/27yKAWGMq/0hKNi8d+6DxwQ2GjY/ktOoyu94AJyUx6NDRCdMHXRshfRLKZIoqbpWADNjSKeqGS1IPgkBQft0sA2cGlIEGJdXpYOmgyyNGo7W9l0jp14eyS4M/NU+wsoVAooKBPmZyGtHwa+WCEE2K2LqUPVLyJOx//uN9IO3NEVnSyCfgjrTa44yDAGd+EMFiZJgVznDoq05TZk/hGj7BnMnp0YUlszUEbI0k0pjZ/azhz9+FUriblmZUGZd6eqMV7SELwxpWoFJxbax4N+vVQ2CLCivJeamBIuOaymqTA+Cy/fn+nW0XeFABjVnzVbST/aS4nWLU0lZJd0PXe7Gw9ebzHtrYKeFFHUznRM3RWM= 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:(13230028)(4636009)(136003)(346002)(39860400002)(376002)(396003)(451199021)(36840700001)(46966006)(40470700004)(1076003)(16526019)(186003)(26005)(2616005)(966005)(426003)(336012)(83380400001)(47076005)(36756003)(6666004)(36860700001)(82310400005)(7696005)(2906002)(40460700003)(8676002)(8936002)(40480700001)(82740400003)(44832011)(54906003)(110136005)(478600001)(5660300002)(86362001)(4326008)(316002)(41300700001)(356005)(81166007)(70586007)(70206006)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2023 15:12:07.2606 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b499e21b-5261-4aba-4869-08db65d73a43 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: BN8NAM11FT007.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4877 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Users are having more success with amd-pstate since the introduction of EPP and Guided modes. To expose the driver to more users by default introduce a kernel configuration option for setting the default mode. Users can use an integer to map out which default mode they want to use in lieu of a kernel command line option. This will default to EPP, but only if: 1) The CPU supports an MSR. 2) The system profile is identified 3) The system profile is identified as a non-server by the FADT. Link: https://gitlab.freedesktop.org/hadess/power-profiles-daemon/-/merge_requests/121 Reviewed-by: Gautham R. Shenoy Co-developed-by: Perry Yuan Signed-off-by: Perry Yuan Signed-off-by: Mario Limonciello --- drivers/cpufreq/Kconfig.x86 | 17 +++++++++ drivers/cpufreq/amd-pstate.c | 73 ++++++++++++++++++++++++------------ include/linux/amd-pstate.h | 4 +- 3 files changed, 68 insertions(+), 26 deletions(-) diff --git a/drivers/cpufreq/Kconfig.x86 b/drivers/cpufreq/Kconfig.x86 index 00476e94db90..438c9e75a04d 100644 --- a/drivers/cpufreq/Kconfig.x86 +++ b/drivers/cpufreq/Kconfig.x86 @@ -51,6 +51,23 @@ config X86_AMD_PSTATE If in doubt, say N. +config X86_AMD_PSTATE_DEFAULT_MODE + int "AMD Processor P-State default mode" + depends on X86_AMD_PSTATE + default 3 if X86_AMD_PSTATE + range 1 4 + help + Select the default mode the amd-pstate driver will use on + supported hardware. + The value set has the following meanings: + 1 -> Disabled + 2 -> Passive + 3 -> Active (EPP) + 4 -> Guided + + For details, take a look at: + . + config X86_AMD_PSTATE_UT tristate "selftest for AMD Processor P-State driver" depends on X86 && ACPI_PROCESSOR diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index c9d296ebf81e..b400d1ee8e64 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -62,7 +62,7 @@ static struct cpufreq_driver *current_pstate_driver; static struct cpufreq_driver amd_pstate_driver; static struct cpufreq_driver amd_pstate_epp_driver; -static int cppc_state = AMD_PSTATE_DISABLE; +static int cppc_state = AMD_PSTATE_UNDEFINED; /* * AMD Energy Preference Performance (EPP) @@ -1363,6 +1363,25 @@ static struct cpufreq_driver amd_pstate_epp_driver = { .attr = amd_pstate_epp_attr, }; +static int __init amd_pstate_set_driver(int mode_idx) +{ + if (mode_idx >= AMD_PSTATE_DISABLE && mode_idx < AMD_PSTATE_MAX) { + cppc_state = mode_idx; + if (cppc_state == AMD_PSTATE_DISABLE) + pr_info("driver is explicitly disabled\n"); + + if (cppc_state == AMD_PSTATE_ACTIVE) + current_pstate_driver = &amd_pstate_epp_driver; + + if (cppc_state == AMD_PSTATE_PASSIVE || cppc_state == AMD_PSTATE_GUIDED) + current_pstate_driver = &amd_pstate_driver; + + return 0; + } + + return -EINVAL; +} + static int __init amd_pstate_init(void) { struct device *dev_root; @@ -1370,15 +1389,6 @@ static int __init amd_pstate_init(void) if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) return -ENODEV; - /* - * by default the pstate driver is disabled to load - * enable the amd_pstate passive mode driver explicitly - * with amd_pstate=passive or other modes in kernel command line - */ - if (cppc_state == AMD_PSTATE_DISABLE) { - pr_info("driver load is disabled, boot with specific mode to enable this\n"); - return -ENODEV; - } if (!acpi_cpc_valid()) { pr_warn_once("the _CPC object is not present in SBIOS or ACPI disabled\n"); @@ -1389,6 +1399,33 @@ static int __init amd_pstate_init(void) if (cpufreq_get_current_driver()) return -EEXIST; + switch (cppc_state) { + case AMD_PSTATE_UNDEFINED: + /* Disable on the following configs by default: + * 1. Undefined platforms + * 2. Server platforms + * 3. Shared memory designs + */ + if (acpi_pm_profile_undefined() || + acpi_pm_profile_server() || + !boot_cpu_has(X86_FEATURE_CPPC)) { + pr_info("driver load is disabled, boot with specific mode to enable this\n"); + return -ENODEV; + } + ret = amd_pstate_set_driver(CONFIG_X86_AMD_PSTATE_DEFAULT_MODE); + if (ret) + return ret; + break; + case AMD_PSTATE_DISABLE: + return -ENODEV; + case AMD_PSTATE_PASSIVE: + case AMD_PSTATE_ACTIVE: + case AMD_PSTATE_GUIDED: + break; + default: + return -EINVAL; + } + /* capability check */ if (boot_cpu_has(X86_FEATURE_CPPC)) { pr_debug("AMD CPPC MSR based functionality is supported\n"); @@ -1441,21 +1478,7 @@ static int __init amd_pstate_param(char *str) size = strlen(str); mode_idx = get_mode_idx_from_str(str, size); - if (mode_idx >= AMD_PSTATE_DISABLE && mode_idx < AMD_PSTATE_MAX) { - cppc_state = mode_idx; - if (cppc_state == AMD_PSTATE_DISABLE) - pr_info("driver is explicitly disabled\n"); - - if (cppc_state == AMD_PSTATE_ACTIVE) - current_pstate_driver = &amd_pstate_epp_driver; - - if (cppc_state == AMD_PSTATE_PASSIVE || cppc_state == AMD_PSTATE_GUIDED) - current_pstate_driver = &amd_pstate_driver; - - return 0; - } - - return -EINVAL; + return amd_pstate_set_driver(mode_idx); } early_param("amd_pstate", amd_pstate_param); diff --git a/include/linux/amd-pstate.h b/include/linux/amd-pstate.h index c10ebf8c42e6..446394f84606 100644 --- a/include/linux/amd-pstate.h +++ b/include/linux/amd-pstate.h @@ -94,7 +94,8 @@ struct amd_cpudata { * enum amd_pstate_mode - driver working mode of amd pstate */ enum amd_pstate_mode { - AMD_PSTATE_DISABLE = 0, + AMD_PSTATE_UNDEFINED = 0, + AMD_PSTATE_DISABLE, AMD_PSTATE_PASSIVE, AMD_PSTATE_ACTIVE, AMD_PSTATE_GUIDED, @@ -102,6 +103,7 @@ enum amd_pstate_mode { }; static const char * const amd_pstate_mode_string[] = { + [AMD_PSTATE_UNDEFINED] = "undefined", [AMD_PSTATE_DISABLE] = "disable", [AMD_PSTATE_PASSIVE] = "passive", [AMD_PSTATE_ACTIVE] = "active", From patchwork Mon Jun 5 15:11:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 689620 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 2B14CC7EE2C for ; Mon, 5 Jun 2023 15:13:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234149AbjFEPNa (ORCPT ); Mon, 5 Jun 2023 11:13:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234177AbjFEPNN (ORCPT ); Mon, 5 Jun 2023 11:13:13 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 175FEE56; Mon, 5 Jun 2023 08:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NqrqNhXvlFuO99NdwWgEYLaHFWQQjSlEK/PFFpMoGGuthQp78Z5CWTLyhG606ybdShmbd6EKWsNT0W1G9d9RAmetkiIlAw4dG0lvG8zbh7V9ZYzIDCu1xtn7n7H2UCpDlZRME0gut09wVvoiqW+elYFvlRY9m/XGnPkoFWMIazQJGzVn0pTTWGOadJlMst19brryhJz19Cc3tLXWtJezTy6lC0ow8fcZAKZBM4BwBpuv3c3jQknii2zNTn6xyCvKbotjh7OEcw5pcTQpiFRZvHWfh7AAr38MRhP25N0aQgWR20Xf9OBTNsM/SmGYJdseohRmyeetLfCpQfgZWx6AAw== 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=iH6Y3AwplmndhbWiF/4vPmKuIQ0dTJEF/RNe1z7wNcY=; b=ObB0u1OiGUXDlNxyfaFHIPPD72Decrg7jaQYcE2aIb4W7EijVSDBZwCoXyZxcFaNTOIeDY793d+0/Nwe9KzfUC34vRj2bOHGA46mwLvoVWwNZGSU3xeiMgvqW+y7em7mZSF4QkPi/GfjyC9/gvz4OddXa+vowddIBkDvxgzfz3G/dwC7oJMDJJn2rgK4LlEOGC7UEtvqPjRj3i24D7YDcqyVY5HUqKakBvYBhLMiy89/8Ygr9c3EBYDu1pEe/RTyNuAgkD9XTUx4SiPLDQpeNYhSQL7cdzjTauYoGsehbFCInckDUYx16jq+5OZm9a1TXKPeAHEiEBreKvDQ2Q+ewA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linux.intel.com 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=iH6Y3AwplmndhbWiF/4vPmKuIQ0dTJEF/RNe1z7wNcY=; b=D6SdUA3FXXtxDwXsayeJWxhemzYKd00iGdMpYQQ9pJwC1ztuPJKilsFffOPBK61a0uq51RQEBG3niLu34csvYbORHzsQsifMBvwF/SfQNl3ClwX2l2XSOoivia1ndS9o5xOHkHVTnLmLEpdGUAPqTDLG+INGR1uPHYSfICSqolY= Received: from BN9PR03CA0955.namprd03.prod.outlook.com (2603:10b6:408:108::30) by IA0PR12MB7508.namprd12.prod.outlook.com (2603:10b6:208:440::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Mon, 5 Jun 2023 15:12:09 +0000 Received: from BN8NAM11FT076.eop-nam11.prod.protection.outlook.com (2603:10b6:408:108:cafe::6c) by BN9PR03CA0955.outlook.office365.com (2603:10b6:408:108::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32 via Frontend Transport; Mon, 5 Jun 2023 15:12:09 +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 BN8NAM11FT076.mail.protection.outlook.com (10.13.176.174) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6455.33 via Frontend Transport; Mon, 5 Jun 2023 15:12:08 +0000 Received: from SITE-L-T34-2.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; Mon, 5 Jun 2023 10:12:07 -0500 From: Mario Limonciello To: Huang Rui , Srinivas Pandruvada CC: "Rafael J . Wysocki" , Len Brown , Viresh Kumar , Robert Moore , , , , , Gautham Ranjal Shenoy , "Wyes Karny" , Perry Yuan , "Mario Limonciello" Subject: [PATCH 4/4] cpufreq: intel_pstate: Use the acpi_pm_profile_server() symbol Date: Mon, 5 Jun 2023 10:11:33 -0500 Message-ID: <20230605151133.2615-5-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230605151133.2615-1-mario.limonciello@amd.com> References: <20230605151133.2615-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT076:EE_|IA0PR12MB7508:EE_ X-MS-Office365-Filtering-Correlation-Id: 56d1ae03-fdf0-40ee-6282-08db65d73b06 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: baq6J5a2bmcp4jh3GdqrrIRJ7RqWSP93apXIpEZ3k5XQl4IS7N8GHiYEjuWUrWNZwaECVXSzbqBoGKs5bMpSgJYUp3n8VhhUh+H1y6OZxIhLqS7lPeug7bPVt0WU/UjxP/4F7WhlYckHLqkRLnx+brOZ8p7QtGPRPGvCls3YEwl9gUqHITQQr3jXqL2QeWVLHfg1UGcH78X5aAPSKJmhtadAAejNQyQ0RMonIzSgRT90BNOVJoBXGPje8BZr2wTyrS69zD6Fh/T+0msBFDGG8jlLTYGAvVvUdxejtvrscA9MDQ2h+fNf2V+6Vn9N1Z7M+L1r8ePovG3vELgDD7zdqGCQ2T00yf7g77aO3Zp4b4x1xj4lwm0eZMeLNh4aUQHWoFCy7Hb6cl/QrQoWmuXrOzm5xh4n0qSEGuUCakOdK/LPmsd0XYO0kUMfhOOgEXlD5+jxVL3H1Jh6d3cx5AqFk1cos+sDbmHGKHKXniMSiesF+rVh8Qczcg0JRfpFcFQsIKeroLeY0lqZpJ4YydnupLWnG2vSiMXiHlbrBDitbj5MOTBRhdw/FH86FYHfm2IXGX7oz7ejniGeP+opln0NwEBR4lCRranqqQ1zbeFayyTQmCR9oCjs1MFaFXqHsyQz7I4xxj1IDw+HFaOsrDhNiyjS6sRqNpIa+HpWUQsv0s1AGE9G7JlC5AChvuicxlbo8vj0s3QGX9aCYLN/AtO9EnsWxw8oMvKZMpDO3cd8hIiB8pDLxV12oPJnbu4O/7VnimyD3pqb054+uT5QJooEVQ== 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:(13230028)(4636009)(376002)(39860400002)(136003)(396003)(346002)(451199021)(40470700004)(46966006)(36840700001)(70586007)(70206006)(2906002)(478600001)(316002)(4326008)(8936002)(8676002)(41300700001)(54906003)(110136005)(44832011)(6666004)(5660300002)(7696005)(40460700003)(1076003)(26005)(16526019)(82740400003)(356005)(2616005)(40480700001)(186003)(47076005)(83380400001)(426003)(336012)(81166007)(36860700001)(36756003)(82310400005)(86362001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2023 15:12:08.5236 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 56d1ae03-fdf0-40ee-6282-08db65d73b06 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: BN8NAM11FT076.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7508 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Avoid duplication of functionality by using the generic symbol. This does have a functional change that intel-pstate will now match "SOHO server" as well. Reviewed-by: Gautham R. Shenoy Signed-off-by: Mario Limonciello --- drivers/cpufreq/intel_pstate.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 2548ec92faa2..3a36c0169d82 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -313,18 +313,9 @@ static DEFINE_MUTEX(intel_pstate_limits_lock); #ifdef CONFIG_ACPI -static bool intel_pstate_acpi_pm_profile_server(void) -{ - if (acpi_gbl_FADT.preferred_profile == PM_ENTERPRISE_SERVER || - acpi_gbl_FADT.preferred_profile == PM_PERFORMANCE_SERVER) - return true; - - return false; -} - static bool intel_pstate_get_ppc_enable_status(void) { - if (intel_pstate_acpi_pm_profile_server()) + if (acpi_pm_profile_server()) return true; return acpi_ppc; @@ -481,10 +472,6 @@ static inline void intel_pstate_exit_perf_limits(struct cpufreq_policy *policy) { } -static inline bool intel_pstate_acpi_pm_profile_server(void) -{ - return false; -} #endif /* CONFIG_ACPI */ #ifndef CONFIG_ACPI_CPPC_LIB @@ -2407,7 +2394,7 @@ static int intel_pstate_init_cpu(unsigned int cpunum) if (hwp_active) { intel_pstate_hwp_enable(cpu); - if (intel_pstate_acpi_pm_profile_server()) + if (acpi_pm_profile_server()) hwp_boost = true; } } else if (hwp_active) {