From patchwork Thu Jul 7 16:51:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 12909963 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 28499C43334 for ; Thu, 7 Jul 2022 16:52:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235991AbiGGQwE (ORCPT ); Thu, 7 Jul 2022 12:52:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235367AbiGGQwB (ORCPT ); Thu, 7 Jul 2022 12:52:01 -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 025CE326D9; Thu, 7 Jul 2022 09:52:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DJEPunSvkxCrkUA4zx3yPBndF7+tZnbcA1Tpv9M6TC0PJvcOesODZFqR6IsvMcQQVRzx3w0P/Ik28B+jhpIeeNZ72P7zdfosQuXGZz9/APIjGSCIsDjcjXNIuNrqSkWYHwYOw8bWPFfkICUBQdvuu6nbOi4t4vAERKwL+kO8RaSXF8tkIigR+sbS3dMpGpf0FgTByrVd4K3IuUWmpqhzg7YIoTFXCc5xlSTPsejTQITlm793sm7cwL/ErdprntoUK/PBbOZKC44hNS3E50FJmAmicT9BhAOoSMld5rsX7E59gDJ80ecfg6yaSh+siBnCfP74YHk95ymnYlBBAxyW7g== 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=AZjYVInbbsLWr3JkIKw3CSb4z2A1d1LNPl48JfqA8SQ=; b=X0Q/U84aXODsN5x09fz9j2A0SEYey74Gf/NlpjkbLmuVYgg6Apt2OdQjSiaE31RHQqYR7+rs1+ZCP7TLhYn932DICcDkiNT6egIigE/mQc46bA5bEURJlYhFeH5gwMCIXcY49iutEdILgpecAPtOtegvB90ehlJyOmNWrDv0QDO2lc1gexSycdrnaC1jUn8Mpxca3o6sIda8rSCO7ECUIvEf8Xcebde4BcYOKiQkgsXC73lhELrTnV1+UpAlGEpsJyryGI8XvLCMVIKuYlF2lSrIS5vMPD/Ul4DR/uQsQESQh8WjpAbMF4y9auxNeLFfKwVNv0flL2oNl8A3xZAmjg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=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=AZjYVInbbsLWr3JkIKw3CSb4z2A1d1LNPl48JfqA8SQ=; b=e3KbPufNfZy9gri57HOvnTksqY/ehHZ5Exnf6X4PeW2l3DLrG11UD+nLGgsVgyfusqxeXxNOgK+tPj3f/RD7w7FIfqD1gAZz13c2rT80XJc7jnSzRiE9C5UdH5eO/U0ufkK+BmKYaoAS9LJRoO1sRgNM+7FVH4TDeVRYicfnvyw= Received: from BN6PR22CA0028.namprd22.prod.outlook.com (2603:10b6:404:37::14) by BN6PR1201MB2482.namprd12.prod.outlook.com (2603:10b6:404:ac::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Thu, 7 Jul 2022 16:51:57 +0000 Received: from BN8NAM11FT009.eop-nam11.prod.protection.outlook.com (2603:10b6:404:37:cafe::77) by BN6PR22CA0028.outlook.office365.com (2603:10b6:404:37::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Thu, 7 Jul 2022 16:51:57 +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 BN8NAM11FT009.mail.protection.outlook.com (10.13.176.65) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Thu, 7 Jul 2022 16:51:57 +0000 Received: from pyuan-desktop.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.28; Thu, 7 Jul 2022 11:51:50 -0500 From: Perry Yuan To: , , , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , , "H. Peter Anvin" , Peter Zijlstra , Adrian Hunter , Pawan Gupta , Alexander Shishkin , Perry Yuan , "Chang S. Bae" , Huang Rui , Tony Luck , Ricardo Neri , CC: , , , , , , , , Subject: [PATCH 01/12] x86/msr: Add the MSR definition for AMD CPPC hardware control. Date: Thu, 7 Jul 2022 12:51:36 -0400 Message-ID: <20220707165137.211400-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 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-Office365-Filtering-Correlation-Id: aa90c8af-c751-48b2-a3d4-08da6039013b X-MS-TrafficTypeDiagnostic: BN6PR1201MB2482:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hmDu6B4aqLihL8HtdUZRsU4bJ9pNWPfxEkWH/XIAybSdW1V2i60WUAmdkJfJb7JDfIBXSMJx4w0MjnYl8Vl/ScUYeY+EWZBBHtYUA7Bv2u9cLOqTk97ydwOrkZwmyXSeiepSVjtTY52mvv4wOfDhhCtIBGbLu5+HFCBdR/U6kti6Z8fRmpKumcm7QPVfxMnrLrxzwo84AsAG/UuKdaMK2O4NTiRYBDDRFknZveaNn0rudk1a6ZvbWgDAEF4oJTiN2oaIwkMQC8ZiY6RW30Qkkivi8VDy2xtfK+UXU03se29A1kMcP+AWVl39oxFIqZf8qJllIICQ75LA/hVDyY8/Iz48/D/2/OZQiCxi91SCN/cv8rY3emQJddKWXEXXOc1vpHBWerlA79f1zN3RwMBZSgJkQrwVGBnwN3MzZlCWnX/uojAGRsPUlUA94inNmn9vtklXC3ObttL5uUw9DZMfBPn/rbacb+p4+FeQuaIP6+DiHyTxCzEYta/JZnLBzMoi/axeOp1C2PRAPmlmf0MghLKVTghL8W20qg6CkNtRHvSBFAhcl6sJwe0NVojNAJpa6Q4LhOWrNg27leaZlM4r/oxQGDRDAFNEeKhLwu8bJE7yxhVYOMOgm6O9k2KHei+mq1da5FxJYPdQXNK4tELkzWFlFeudJePJX7P3nRCn93WEqRXEhMp4/Wtk0HZCJwNzu+cQ2rXB9KnwtxMKNcORXi5+KM+1honSpv1q2/Zyzb9Q2ed6I922xq39q/peLnmQUTXGeL6MQGXsPL+ErhCvJPpLomUE//DL+zgR3r5cZYS3vVbzqTMzYsdlI3IHeU1/H2Lx+yrYT02w6hpH71Jum0hf3e1mlXD4mUuwvAkhZN74Ag7bPHAGdJQ3ShYMOIH7Q1LW40n1kPjAXUlkrkowyswcYP696Pr4Y8g7nG5jGdiTon00vlQRE1REMN64LAxo5hnPWX2/MNxFoUJTLOniBYawJR8LL1fM4HK96A+XfzU= 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:(13230016)(4636009)(376002)(136003)(346002)(396003)(39860400002)(40470700004)(36840700001)(46966006)(82310400005)(316002)(36860700001)(54906003)(40460700003)(110136005)(426003)(186003)(47076005)(36756003)(26005)(16526019)(34020700004)(336012)(7696005)(70206006)(4744005)(5660300002)(2906002)(8676002)(86362001)(1076003)(7416002)(478600001)(70586007)(81166007)(4326008)(6666004)(41300700001)(966005)(40480700001)(82740400003)(921005)(2616005)(356005)(8936002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2022 16:51:57.5653 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aa90c8af-c751-48b2-a3d4-08da6039013b 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: BN8NAM11FT009.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1201MB2482 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This MSR can be used for controlling whether the CPU boost state is enabled in the hardware. AMD Processor Programming Reference (PPR) Link: https://www.amd.com/system/files/TechDocs/40332.pdf [p1095] Link: https://www.amd.com/system/files/TechDocs/56569-A1-PUB.zip [p162] Signed-off-by: Perry Yuan --- arch/x86/include/asm/msr-index.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index d27e0581b777..869508de8269 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -548,6 +548,7 @@ #define MSR_AMD_CPPC_CAP2 0xc00102b2 #define MSR_AMD_CPPC_REQ 0xc00102b3 #define MSR_AMD_CPPC_STATUS 0xc00102b4 +#define MSR_AMD_CPPC_HW_CTL 0xc0010015 #define AMD_CPPC_LOWEST_PERF(x) (((x) >> 0) & 0xff) #define AMD_CPPC_LOWNONLIN_PERF(x) (((x) >> 8) & 0xff) From patchwork Thu Jul 7 16:55:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 12909966 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 57A0DC43334 for ; Thu, 7 Jul 2022 16:55:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235437AbiGGQzw (ORCPT ); Thu, 7 Jul 2022 12:55:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230313AbiGGQzv (ORCPT ); Thu, 7 Jul 2022 12:55:51 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2048.outbound.protection.outlook.com [40.107.93.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF5F11D335; Thu, 7 Jul 2022 09:55:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aRRgHLikBi/dXAgUX5JzoxuGvwHkH2eK3aHr/Fj2C01sVUF9wJlyWe46spABlI/pDean1g2L7xFTEcZd3e8l9N6CX1R5pi3PmLemJn4R25MkrBRExUsEGlqXOYF8H9s7Sn/x61q2y6QpW4TtkBcvNFApuT6NI4cU4+3HqTPCYTu7cqD2MDEY4HcfLCkSik4TQO8x1XV1YLNfVWZPnMb8eSQGjRIfvWtpwRFsQthJgDrMfVG5Snnk3/tCkfmAGFDZSi/do/52NRWNPzA9zcOihrGmJq5pScPvQSlHXrpsTB5imkNhRN0fpOKg8sN7Py9yO/Uk5W9O/idS4HEg3cMPgg== 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=DE1xs5A8thrUl5LPVV7c/9fZki/WFGQ1WGIKHjPsX8k=; b=WMxwQlHI/F8NdBCBoSl+52UOgiawNypMbdfXMhmmm98PC8PikqdpRCq3YPcFdINA2HpFAsN4XG4/L7PPfLAypcsB3AOrm5Ca2/P7GX0ogY1mZEGzDVmYNRs3G9qIM/G1ZOnTM3pHtkrCP6RW4+j6QYxmagZBgVFEwGFesjZAl2fmto7Eb+s/kRk2hc0aEQw07fWvOugDB73ui5V5rsGlAxJ2WVpke9bF7QVrvAtIepRVe/d04iRqc89cTrC6+sIUD22tDhQC57mYFHaq2BEdiDMrskF8QnojmK8rh1EtYYHAV9xzfkKm8WS6kcK/IWKFS2CiICY9baCH0qwiePQAvQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=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=DE1xs5A8thrUl5LPVV7c/9fZki/WFGQ1WGIKHjPsX8k=; b=aGquq+dbGnnAzbUhdSfb7ZiS6MX883syOZpztsor+5XLIFXW/NwGMo2SnGjJoHWAUd3ca4gVbx+2j3MfzTg74r+kpYeshwOg6oODuT0mps+BoATuPnDVRt7WYzkpcgGouG0qIJJP7NP9+M1PuCcqMv6p4sJqrp1fWd9IJVBxXvY= Received: from BN9P223CA0012.NAMP223.PROD.OUTLOOK.COM (2603:10b6:408:10b::17) by CY4PR12MB1416.namprd12.prod.outlook.com (2603:10b6:903:44::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.18; Thu, 7 Jul 2022 16:55:48 +0000 Received: from BN8NAM11FT026.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10b:cafe::ba) by BN9P223CA0012.outlook.office365.com (2603:10b6:408:10b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Thu, 7 Jul 2022 16:55:47 +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 BN8NAM11FT026.mail.protection.outlook.com (10.13.177.51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Thu, 7 Jul 2022 16:55:47 +0000 Received: from pyuan-desktop.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.28; Thu, 7 Jul 2022 11:55:40 -0500 From: Perry Yuan To: , , , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , , "H. Peter Anvin" , Huang Rui , "Rafael J. Wysocki" , Peter Zijlstra , Adrian Hunter , Pawan Gupta , Perry Yuan , Alexander Shishkin , Tony Luck , Stephane Eranian , Ricardo Neri , , CC: , , , , , , , Subject: [PATCH 02/12] cpufreq: amd-pstate: enable AMD Precision Boost mode switch Date: Thu, 7 Jul 2022 12:55:21 -0400 Message-ID: <20220707165522.212990-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 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-Office365-Filtering-Correlation-Id: e440c9b4-e136-4bb6-e215-08da60398a5d X-MS-TrafficTypeDiagnostic: CY4PR12MB1416:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9tCIUVGvmgusYDmk5/HMVr+tVNSehD6/srb/IR7pJAWatVSTzplAKy6ofMt2uoYjWScbzc5MSFEC/+yXSCVjYExUONOauTSg8vvnGlDebZFIfk43FA9eiz6l82tHk71NkUZCvmNnxNmwKP3YYTy5KRZ2pxAuD0UvDSCjA9iYPhdP39kYmn9KaC8QxYNPVJDikfhhunZCLx/I4z44haC1RbHz18bT5Fval7b/GjQkIdC4UYcNNMi4aE1GyLLYRockuEmExIL8BvLwhQ9K6P/peCRnl8ixytgWFRSd2JhGy+Ehr1lNoZf7ul0wsUpxG4tu1p4PrD4nNgb/JJdfelushEW1Vlnm+Xu73z44qWwvydT/X6DwuCYfmXFSf11mX4LNZZq3WXokQ6lhK+Lq+OUvIc8BG/theH0g9xzJIPrtqxJvkxxEGk/xFXykfzmh1SpnGHTWOB9coEV25izNi3MhS3bvaBM7tyfyxLnHSkTdPQB1/aCzsAo5AspN1nFVPan+tdNf1O8cbrxjCTLRG1VHwQ85BvMVM82r0X8uHt2OLxIo4nPf5RmNn0B++rwtVZXJ6VN26XSFKraPdaZJCGB5zMAHnyfKv4JuLc7x4B/84STiATPpD1jPisLrlKD7++gTo62Q1/33yE5xU3bNyrVzRX+pdCgvbbFfM3Udr9mM6sikjBNtZxnFXdU7QDLgHGacmLoBRoYuv2TsP+ILg6vcpV/+VnfrUUx3PfYjoJZuYxX4JcXi3qVFHCRGTT5KC2Jt3C0WlciaB5c1AE5ptjdsrTBo7/X+Zn9lsfQFF7/gLmmSaUtGaKl2f6dpl+bA4kN+AK2Ap+UKQmUMi45KGXCu2vY9mHfrRT6ilM61XGsxrUqKGu7yxMSxxizc0Bx/cK0TG5k7raqeEtX73ag3dqVqvQ== 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:(13230016)(4636009)(346002)(39860400002)(396003)(136003)(376002)(46966006)(36840700001)(40470700004)(8676002)(70206006)(70586007)(82310400005)(4326008)(5660300002)(356005)(8936002)(921005)(86362001)(2906002)(336012)(7416002)(82740400003)(81166007)(426003)(47076005)(83380400001)(41300700001)(16526019)(7696005)(40480700001)(6666004)(1076003)(40460700003)(110136005)(36860700001)(54906003)(2616005)(478600001)(186003)(36756003)(316002)(26005)(34020700004)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2022 16:55:47.6376 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e440c9b4-e136-4bb6-e215-08da60398a5d 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: BN8NAM11FT026.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1416 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Add support to switch AMD precision boost state to scale cpu max frequency that will help to improve the processor throughput. when set boost state to be enabled, user will need to execute below commands, the CPU will reach absolute maximum performance level or the highest perf which CPU physical support. This performance level may not be sustainable for long durations, it will help to improve the IO workload tasks. * turn on CPU boost state under root echo 1 > /sys/devices/system/cpu/cpufreq/boost If user set boost off,the CPU can reach to the maximum sustained performance level of the process, that level is the process can maintain continously working and definitely it can save some power compared to boost on mode. * turn off CPU boost state under root echo 0 > /sys/devices/system/cpu/cpufreq/boost Signed-off-by: Perry Yuan --- arch/x86/include/asm/msr-index.h | 2 ++ drivers/cpufreq/amd-pstate.c | 22 +++++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index 869508de8269..b952fd6d6916 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -559,6 +559,8 @@ #define AMD_CPPC_MIN_PERF(x) (((x) & 0xff) << 8) #define AMD_CPPC_DES_PERF(x) (((x) & 0xff) << 16) #define AMD_CPPC_ENERGY_PERF_PREF(x) (((x) & 0xff) << 24) +#define AMD_CPPC_PRECISION_BOOST_BIT 25 +#define AMD_CPPC_PRECISION_BOOST_ENABLED BIT_ULL(AMD_CPPC_PRECISION_BOOST_BIT) /* AMD Performance Counter Global Status and Control MSRs */ #define MSR_AMD64_PERF_CNTR_GLOBAL_STATUS 0xc0000300 diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 9ac75c1cde9c..188e055e24a2 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -122,6 +122,7 @@ struct amd_cpudata { u64 freq; bool boost_supported; + u64 cppc_hw_conf_cached; }; static inline int pstate_enable(bool enable) @@ -438,18 +439,27 @@ static int amd_pstate_set_boost(struct cpufreq_policy *policy, int state) { struct amd_cpudata *cpudata = policy->driver_data; int ret; + u64 value; if (!cpudata->boost_supported) { pr_err("Boost mode is not supported by this processor or SBIOS\n"); return -EINVAL; } - if (state) + ret = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_HW_CTL, &value); + if (ret) + return ret; + + if (state) { + value |= AMD_CPPC_PRECISION_BOOST_ENABLED; policy->cpuinfo.max_freq = cpudata->max_freq; - else + } else { + value &= ~AMD_CPPC_PRECISION_BOOST_ENABLED; policy->cpuinfo.max_freq = cpudata->nominal_freq; - + } policy->max = policy->cpuinfo.max_freq; + WRITE_ONCE(cpudata->cppc_hw_conf_cached, value); + wrmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_HW_CTL, value); ret = freq_qos_update_request(&cpudata->req[1], policy->cpuinfo.max_freq); @@ -478,6 +488,7 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) int min_freq, max_freq, nominal_freq, lowest_nonlinear_freq, ret; struct device *dev; struct amd_cpudata *cpudata; + u64 value; dev = get_cpu_device(policy->cpu); if (!dev) @@ -542,6 +553,11 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) policy->driver_data = cpudata; + ret = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_HW_CTL, &value); + if (ret) + return ret; + WRITE_ONCE(cpudata->cppc_hw_conf_cached, value); + amd_pstate_boost_init(cpudata); return 0; From patchwork Thu Jul 7 16:58:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 12909974 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 26BEAC433EF for ; Thu, 7 Jul 2022 16:59:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235961AbiGGQ7O (ORCPT ); Thu, 7 Jul 2022 12:59:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235072AbiGGQ7M (ORCPT ); Thu, 7 Jul 2022 12:59:12 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2085.outbound.protection.outlook.com [40.107.212.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80588B86B; Thu, 7 Jul 2022 09:59:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d1dBsKqON4FQBDaKhXhSHp4yAGnE4IPjppy3C1OPP7cgzGjIdiOG0eURdjUCZzAVNjJB+q9waZvpWWJnWvqayTFG4Jvra4AO9D58WmbyR+melkjaRblOczsNjMz/hX+8ychZLZRvsawZT+mY5+V57a24HMMcLI1tTiUB381YZf0nf4HcavGSlJZ4XI/RkTpW/q2oeZsrtbVCt+O5odm6aCPGEKowpU9gs+Qe/EXL+3T553xLsWreV05nmp1my908H9PJSesnIkM8rhye8ipWsi89BPpCbsLusYZctjktnSc+V3iiyZICUfULyUB5ctaTQM0etX+NTiSiHuOcVqdT4g== 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=uN5+9MjVFTE9bOeD33YGoFoU/Kg+Vigkk4Cy9BhX4dg=; b=LUaaQkSAmSr0eBs8elr2RqUpR0PvwEvzlkZ6to9wnfg1LwC5ubosWEyn8PdH9ig9a+xVDNfzBsvC3MesOe7gl1o98N/58m+VH7z3dJzKY5MceccmmdBlQtDnT2Bq8ByCEwP8ge9uFWSTzQMiTZgREacswTAOpkerZzI+ctuNb+JVRPR0Q34dVu/Bh5djvBEe5I0FUh6r/Ws5J2f++HdsnYNvbuJx3SWDmcYhzSKhp1K2SZPpDr7d3EfIXgnPpprnw5bQsbD7n68BLPovYqicqQzpWv9qD1BKGg//xew6A7CyKpUT1dD4W65HveqjxUNu2vlGu4+dSlOMJ1WVWx04nw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=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=uN5+9MjVFTE9bOeD33YGoFoU/Kg+Vigkk4Cy9BhX4dg=; b=16wwSLRyWfePWB3H0m5bvtVvnK36Z2IsIn4D5YOULQwW+4qy95buqmO9B8p/llFohKk205/evdv2Cuvz2OvEW9PHifSUhLlIXudbcyoJnnP0503wXH2XbZFp0oTvpYjKSRi6InGA427Je/Zz926C0ckLWfOu//G7YqcMTBLbidQ= Received: from BN9PR03CA0099.namprd03.prod.outlook.com (2603:10b6:408:fd::14) by CY5PR12MB6107.namprd12.prod.outlook.com (2603:10b6:930:28::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16; Thu, 7 Jul 2022 16:59:09 +0000 Received: from BN8NAM11FT065.eop-nam11.prod.protection.outlook.com (2603:10b6:408:fd:cafe::f2) by BN9PR03CA0099.outlook.office365.com (2603:10b6:408:fd::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.17 via Frontend Transport; Thu, 7 Jul 2022 16:59: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 BN8NAM11FT065.mail.protection.outlook.com (10.13.177.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Thu, 7 Jul 2022 16:59:08 +0000 Received: from pyuan-desktop.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.28; Thu, 7 Jul 2022 11:59:04 -0500 From: Perry Yuan To: , , , Huang Rui , "Rafael J. Wysocki" , , CC: , , , , , , , , Perry Yuan Subject: [PATCH 03/12] cpufreq: amd-pstate: cleanup the unused and duplicated headers declaration Date: Thu, 7 Jul 2022 12:58:49 -0400 Message-ID: <20220707165849.215254-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 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-Office365-Filtering-Correlation-Id: aea82e83-7c77-4965-eea9-08da603a025d X-MS-TrafficTypeDiagnostic: CY5PR12MB6107:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H8F9pqHsuoEoLkvM5aZoe3SaK3VOf15leVz5fdAcmatYEFDUWw0d1IcmNWdbmw6z49Aiqe8A+yu4HkEDAo0e1r8LDIRY/XNsEOVm+/7/iGmaN30LFfj0AeUKjLfU9ChSxGvfFVsBbaZaUimXmo7YicIMbZbGk66tx+rbZQ+gwx6r6R0qw8UUdtjnXyXnNhqslZ232DrpeULKD4B9lvz1bmR/XjzM3cIMfpfaUVbYHnWctks1cHt20dSFMsJFm7PAKBiYv1v6DlQBFyoZCQYanRI3jFB4+7Z+sPm9L3Qjrha0qWm4W9aJyk5NyOFKgf43mxlbK/HBu1GnR12EZhKuzPrxOtHVtuV3e3l9VwnMWUJJq2MWMUvjJRSTZAk7iHz7Lwqux1DAt2Pp6sBUKnBm6FLgyax3TVA5BLBfPsiTtIgtdcPkLeQF55CtEIvBjm8melSheuCmyazt0fXeJ5FRv2vTYancQ64MsshkBpLvFOWlhwguprvOYtdDl69F0ChBV6SSqutxj6ZFLpH+Bgq9ioe8v79JdZcAe4wp3srxvjZmcnFhKNYvU/r1j+UN+cr4L2DzMFY5hAhCIxgqJuiQDhxpYFlJD3bKpmGT72FGCAaVIfAHkPWpMBous1Bkbmeq8NtU12n3uicdFCWmNlCaWu4xqlcNBLCHnMDQWoVwH7yPP5ckpm3KK76DJmivjJ/z771wHkEI8KIkgINCKe12oWCq4GXu3LPuaFM/kjp2PtSudC0HiHT+romGI/S0z7LXyfSXzrwx8m/p4S6QzNAqPAh1H4grPsMottiHc5K3ilAxory7qMpDnakYAG1cKeYpJToRB/GqCbTGTUz4j82CBQXuNQTYn6lC0AZKX9huZkur0bOEjp/OS7xJ2eGkTo4y 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:(13230016)(4636009)(39860400002)(376002)(346002)(396003)(136003)(36840700001)(40470700004)(46966006)(86362001)(110136005)(41300700001)(6666004)(26005)(2906002)(40460700003)(7696005)(478600001)(8936002)(5660300002)(82310400005)(4744005)(2616005)(1076003)(336012)(426003)(47076005)(16526019)(40480700001)(186003)(81166007)(82740400003)(34020700004)(83380400001)(356005)(36860700001)(70206006)(70586007)(36756003)(54906003)(8676002)(316002)(4326008)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2022 16:59:08.9801 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aea82e83-7c77-4965-eea9-08da603a025d 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: BN8NAM11FT065.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6107 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Cleanup the headers declaration which are not used actually and some duplicated declaration which is declarated in some other headers already, it will help to simplify the header part. Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 188e055e24a2..43e6df9f67f6 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -31,19 +31,14 @@ #include #include #include -#include #include #include #include #include -#include #include #include -#include -#include -#include #include "amd-pstate-trace.h" #define AMD_PSTATE_TRANSITION_LATENCY 0x20000 From patchwork Thu Jul 7 16:59:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 12909975 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 3A02DC43334 for ; Thu, 7 Jul 2022 16:59:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236399AbiGGQ7g (ORCPT ); Thu, 7 Jul 2022 12:59:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236365AbiGGQ7c (ORCPT ); Thu, 7 Jul 2022 12:59:32 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2053.outbound.protection.outlook.com [40.107.100.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95B11B86B; Thu, 7 Jul 2022 09:59:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lavoXZ2S8Ne0S67MyN0sQ3+vRXMqFzW13XfQ+rZ3mBaXGQ/nA5V1ZaDrLbd/S9JT/HWMbE4hCDrYvKYwR/Gu2HR5FqSNeBoaJiAWabc/tSzbvbxOnDHh0WuJNhQngBWIe87Zj3DuzYgMi9J6PxMlJ+GJWbVpMXR57ae4dHDSLP5kF8KJkEVc7Z3N0zbW5dsYCx/FUMhHNoYbgDK11Qshr1v+Y77k4Doj3FkEtgxyiererhiVZuxAiihrI4JytMDsfJgtA/S0/TsA18d7Y+aF95ePLIWidQbk23hn0Ky5MFUg4GoFAINI+TAbRZKMHocROqta0ggSFKhrRUKyS3ezvg== 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=avaRGQ+ve4o1uu4LCzGTIuVJV9ZowH+vjGRU3vPbpQw=; b=eclYcKIhfhD9pX1vZgQBvIerwTp3uIe/oWzxfRTEbbgud+4G3i0MMn0RZhKfKbPXyXr2XTWX/XUWSaGYTIpdgdcboPm/W3WWDQD+wg6R+TXNBnuqYIQFvQ7BjbVDwbUDkFgXm2khgxYLzhnSef9OjxurEw939SqrZuh/CB68Feo2L/12PdS5oPeMAMFzei7P57w3FnoobBJnxYTs1ckbLFN5oiCifQUe03rtJNJgLft8D0C+6FrA2fvkGKMJyJuzgvPJUxTMQJtkFqeynWApyu5fstg5MD6aR2UlDq1LLNnXi6ujqyrXMscVkHFw7ZahwV8q4Hyj/lek/LUs+w7SpQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=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=avaRGQ+ve4o1uu4LCzGTIuVJV9ZowH+vjGRU3vPbpQw=; b=TypFAJ80M4G2vu49kazZkCP0ZcCRNfhA+eK3bVQAKpyh7tn3hXIpqjZA5212EKUedfxHKbX2QiPwekHicu8Zp9DSMyVfJJIuWyZT+hGg59HAhD4o73SnJYJtqoIwWeAPpLIIdrxAlHIArm3Amt3so1WW5CHwDucARVFrjs3+YbY= Received: from BN9PR03CA0285.namprd03.prod.outlook.com (2603:10b6:408:f5::20) by BL1PR12MB5173.namprd12.prod.outlook.com (2603:10b6:208:308::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Thu, 7 Jul 2022 16:59:28 +0000 Received: from BN8NAM11FT037.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f5:cafe::cb) by BN9PR03CA0285.outlook.office365.com (2603:10b6:408:f5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16 via Frontend Transport; Thu, 7 Jul 2022 16:59:28 +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 BN8NAM11FT037.mail.protection.outlook.com (10.13.177.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.16 via Frontend Transport; Thu, 7 Jul 2022 16:59:28 +0000 Received: from pyuan-desktop.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.28; Thu, 7 Jul 2022 11:59:23 -0500 From: Perry Yuan To: , , , Huang Rui , "Rafael J. Wysocki" , , CC: , , , , , , , , Perry Yuan Subject: [PATCH 04/12] cpufreq: amd-pstate: prefetch cppc_req_cached value in amd_pstate_cpu_init() Date: Thu, 7 Jul 2022 12:59:08 -0400 Message-ID: <20220707165908.215470-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 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-Office365-Filtering-Correlation-Id: f9b65588-a995-4982-cc68-08da603a0dce X-MS-TrafficTypeDiagnostic: BL1PR12MB5173:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CUCnx2nkeI0x1OYNeTkH2ssziac+l2YECRfuifCXWZNtLct3a9nC+d6DjcBzpjvIPYNwRs0/ZaOxPNDtWmSoGHrjMQROSH6YWfne5K8h5KMSoh5C05r0dKsxtaQkCOyGguf3RrQpCk9cQ5UaqLgN8FxwMmkqbSdmVnXJy/qv4LR27bPrSlv9msDHsg7qtoz6DzDVi0OILj0KmRENPMam3/PUiDuRCfSpSZcj4e9MV2koAJxYPwW6JTummTe+rRCgxDo6alzPLYShKvhjBxvBtlBUMwJBgRNrQlp68cKkf2cmnH6ObfPbtqWKvGHyBpPbqNY1NR5UVFYJEQnbsXvZz31bPFRagyMbnSkDu494B+2Mq3H9XF1u9VcK9xHwp2UB2rAqj608nc6yjOBANNyCMA+6WPpBn07QH2D42Il+hMEvDcwbA4CrsE5g/iz2+lfDo9owPCZKl6ixYJjAcIpyqusL0c5cdidUSCqniv45E2oQU1Sg8ghuTqF/CTUy8AJIcMG1XiYIGK6MUtAFb6iphI8ZvKjtEXl7aKt+0NNZd/gHNfY4fsr+365SMfgGh3wNqhzy/aczSM8x5m2bdceGIWKQSIeG+CQOc/hSyyjsMcnmyD2jBWx+J+kU8LBboTJrMi+WeYahX2uY7NmLbDZ5V/tLvk7hf8TBhQrjVMqFav+fxVZrGnV3bijyAMpA4iYasz6NrEIX2c8gu7cLVMZE3hxJqpHgnaX2k0B0iVP0jnLq0VUkLK3QPuh1pIFT1wMyk9Z3m2zJJDcTM48eSirZ7kCfj7bLSBfsqS3Q7ZCe3RzZYYK2UZp7lnWJdPPS7qtObQ0KIneCDkicS7l5GGfS6+/WY6LIobMketMW2d0FhUqUMAx/6o/IXIKcrz/nr9df 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:(13230016)(4636009)(136003)(346002)(376002)(396003)(39860400002)(46966006)(40470700004)(36840700001)(8936002)(2906002)(2616005)(36860700001)(478600001)(4326008)(40460700003)(86362001)(16526019)(26005)(186003)(1076003)(34020700004)(47076005)(426003)(336012)(82310400005)(82740400003)(70206006)(5660300002)(8676002)(7696005)(316002)(81166007)(70586007)(110136005)(6666004)(41300700001)(36756003)(83380400001)(40480700001)(356005)(54906003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2022 16:59:28.1747 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f9b65588-a995-4982-cc68-08da603a0dce 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: BN8NAM11FT037.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5173 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This cppc_req_cached valued should be prefetched during amd_pstate_cpu_init call period, then the amd_pstate_update() will get correct cached value before updating the perf to change the cpu perf level. Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 43e6df9f67f6..e4904da54541 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -547,12 +547,17 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) cpudata->lowest_nonlinear_freq = lowest_nonlinear_freq; policy->driver_data = cpudata; + if (!shared_mem) { + ret = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_HW_CTL, &value); + if (ret) + return ret; + WRITE_ONCE(cpudata->cppc_hw_conf_cached, value); - ret = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_HW_CTL, &value); - if (ret) - return ret; - WRITE_ONCE(cpudata->cppc_hw_conf_cached, value); - + ret = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, &value); + if (ret) + return ret; + WRITE_ONCE(cpudata->cppc_req_cached, value); + } amd_pstate_boost_init(cpudata); return 0; From patchwork Thu Jul 7 16:59:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 12909976 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 341EFC43334 for ; Thu, 7 Jul 2022 17:00:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236500AbiGGRA3 (ORCPT ); Thu, 7 Jul 2022 13:00:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231320AbiGGRAO (ORCPT ); Thu, 7 Jul 2022 13:00:14 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2045.outbound.protection.outlook.com [40.107.220.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A276C599DC; Thu, 7 Jul 2022 10:00:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hri5LPJ3x9sFKoNR2XVHrJFxN6juTLceIcUjMdFdVL5ya8MX5dENg2SDQUp6sb9+VWvFU/U2lQUSHVqJGrBtfwSQHE3qpPpvlRPtkmCQE27k9NyXy5U280dkXI3hAUaketBwoaSg0WRkgmAfx4DhVfS/+VBSk7iTkxSeAed/xOyO1cU+j3rNr+3jx/EEuTIqHI3zMOKnI9/6Wzn7WUeF9JXvKWeNW7CEHR7AtVPw30CkMAQ2gkscXcXxnugTNSYa6XvMkN5Po52YnKV7QdyPbGAHjPj9TAKapepimY5tmRY4IxDEyDIZfVbFuVwdsIjs050amCou5vcWgfMOXafyiw== 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=76f2SBmh7P/rRxfMHYyBcgNGlGwGPtXKjcuhDvE1FVA=; b=EfImrCVOcK7eXGwuspwrFEGRnq8bnSCOOr6HNPGp02R7LgBzIYoL3KjFtBmIUliQn2iQE6gudhjk1JSJ8JCyAS0j/AolgGck/f+1YB3ohSqHmuXKVhRR4MT47K2Fj7NDl4rI0072lm+s38J+Jry6hVue72DykPjxWIlLa1J4+4KwWaKJuzz4fFiv7BiTzjEV5Ae/Ns18CD2WIkns/8KIt2uDEXa1p6rnLsaeDi2Z0F/oziQC8HeuKgc7cIQ1S+Ltw8pkF15muBszProFEd7deAuS+vaJdLKqJy6TfDOMcfb5bnKWk1W7SzWLjRvUBR9GkgObQUSk9+ObHL9BkHuckA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=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=76f2SBmh7P/rRxfMHYyBcgNGlGwGPtXKjcuhDvE1FVA=; b=E5M6+o8ZtvdtDNHsfQqNzQTquVtSBM96fXzaE6EKgdhkBjk0I9MHFlKlyzo/z1jfqpiw+7ngyWbxWNg6hWcXatcf9aUa1BFLs6cwm5XUt3/euCajOhE29zLtkwD/U6fx1HdcD6QhSunUDXfSiRRZKRZecCJU11jfkLAXSA4e12k= Received: from BN8PR16CA0024.namprd16.prod.outlook.com (2603:10b6:408:4c::37) by DM5PR12MB4664.namprd12.prod.outlook.com (2603:10b6:4:a1::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Thu, 7 Jul 2022 17:00:08 +0000 Received: from BN8NAM11FT061.eop-nam11.prod.protection.outlook.com (2603:10b6:408:4c:cafe::90) by BN8PR16CA0024.outlook.office365.com (2603:10b6:408:4c::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.20 via Frontend Transport; Thu, 7 Jul 2022 17:00:08 +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 BN8NAM11FT061.mail.protection.outlook.com (10.13.177.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Thu, 7 Jul 2022 17:00:08 +0000 Received: from pyuan-desktop.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.28; Thu, 7 Jul 2022 12:00:00 -0500 From: Perry Yuan To: , , , Huang Rui , "Rafael J. Wysocki" , , CC: , , , , , , , , Perry Yuan Subject: [PATCH 05/12] cpufreq: amd-pstate: simplify cpudata pointer assignment Date: Thu, 7 Jul 2022 12:59:28 -0400 Message-ID: <20220707165928.215684-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 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-Office365-Filtering-Correlation-Id: 1f9c517c-a67e-407a-1304-08da603a25b3 X-MS-TrafficTypeDiagnostic: DM5PR12MB4664:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FA4ErcmA63nmZ63TDBot9ajk+HcmMNPW6Rm4LL8Tn2hEi5GVhmyUXUvu0DOF+XPHmBWuPtYXTGs9eF9AStWl37c4YXsBTzw1qdsNFYiKPx/CfSfa8ubO+ipOvco0gO9/0cCrFi0UoluoxRmlOmW14pXet4MMLv92dDUitbnn+k4NKjxPtvcvlU/SYrx61UHKw/syZW0eGmMlaSAgtPw+pYNlwI0c2mGvpdbywZ8bxQWQzTbw9l2Rz7S9s6V6qWazPwKEvXTxVAhQBudDkSiGoKJTub7QOuMLSVddGM+WSU49l2l3VlhMDpw1WLEgi7VZ0cgjweDDWMwa480ik9c/qaH/5t8S9oo93iwTO1KfhsRY2X1HO1qgIFIkuyRoptw6fKJ8VU4zYOE/Xlx2XjaBbW1otW4bi8vPbBWHE7yv0P6F1BdKh7tz5Ow2pq8E9gwoiXUPs//0EsuJQr7w/hRoqb8/6jHwI2Yukr6nFwYCu/e1KIuNNXk3+IvLHHslQFSt+YMjUjRh4h+L2ujJj/eMyeilvaKSnozzb61Umnp0+1/ZqCImULciiuu1lbt0347+Kj2Y/MVAGh97UinhJM/RCgcvlC/grCpI0wREGm77xyeki+4GJcjY0cgjtmPpu12+INiFSGp3Tw5NJAMAct8UrDfhFek33k6HOMlKa12gfCDeleYuHaW4XDXlNH0Zwy+bSE0m2LXQjBtAoaaX+RyTrjvjkFeV7lACavpo2HdnCkOYJZEkIqm7Hi8oc0n5LxGaEPRskI8138bujjp80h5iOwYdbw5kyrJ6uO1e3ecOrABSHcWe0n1TpWSAQWUeGvfTFP7NKVbJvLig9byoWShivx1UHttDPvc2kuBBuw/AJLmghOwdrhTOV3pcS4J+XCw+ 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:(13230016)(4636009)(136003)(376002)(346002)(396003)(39860400002)(36840700001)(40470700004)(46966006)(478600001)(34020700004)(1076003)(186003)(16526019)(40480700001)(36756003)(41300700001)(7696005)(2616005)(110136005)(6666004)(2906002)(81166007)(316002)(8936002)(5660300002)(54906003)(82740400003)(426003)(82310400005)(47076005)(336012)(356005)(26005)(8676002)(70586007)(86362001)(83380400001)(70206006)(36860700001)(40460700003)(4326008)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2022 17:00:08.2584 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1f9c517c-a67e-407a-1304-08da603a25b3 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: BN8NAM11FT061.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB4664 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org move the cpudata assignment to cpudata declaration which will simplify the functions. No functional change intended. Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index e4904da54541..fc0de9fd643b 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -571,9 +571,7 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) static int amd_pstate_cpu_exit(struct cpufreq_policy *policy) { - struct amd_cpudata *cpudata; - - cpudata = policy->driver_data; + struct amd_cpudata *cpudata = policy->driver_data; freq_qos_remove_request(&cpudata->req[1]); freq_qos_remove_request(&cpudata->req[0]); @@ -615,9 +613,7 @@ static ssize_t show_amd_pstate_max_freq(struct cpufreq_policy *policy, char *buf) { int max_freq; - struct amd_cpudata *cpudata; - - cpudata = policy->driver_data; + struct amd_cpudata *cpudata = policy->driver_data; max_freq = amd_get_max_freq(cpudata); if (max_freq < 0) @@ -630,9 +626,7 @@ static ssize_t show_amd_pstate_lowest_nonlinear_freq(struct cpufreq_policy *poli char *buf) { int freq; - struct amd_cpudata *cpudata; - - cpudata = policy->driver_data; + struct amd_cpudata *cpudata = policy->driver_data; freq = amd_get_lowest_nonlinear_freq(cpudata); if (freq < 0) From patchwork Thu Jul 7 17:00:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 12909977 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 C3795C43334 for ; Thu, 7 Jul 2022 17:00:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236468AbiGGRAm (ORCPT ); Thu, 7 Jul 2022 13:00:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236494AbiGGRA1 (ORCPT ); Thu, 7 Jul 2022 13:00:27 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2059.outbound.protection.outlook.com [40.107.94.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E0E95A479; Thu, 7 Jul 2022 10:00:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QN3ppaexZWIkfH5SDasXnNfjejOAIu/Ds/MAC7LBkFQr+SYNkpvxM2zbp/Jw//SRbvzi33x0w+b7mgh4z0TjICGfxklf2QiEU5hHIJ+8zoQlIvySMa5S3Y4YpPdSWuYq/lPKjNXLIVBBDUEb5DmiaP5P06IpcOnaMDPuDBje2XX0KGPTsF+jqZlBHwzi+TnrwsM3ynymGjDbkCMXFOKVYrjZ8MYMZn0RvN1keca7c6ei5amAFTbvutYHoX62xOESXS0bH09XDsaD3ea3atWP5w7UrtNPWH7eHYv6DoH/Xz7SMKG5smZjiRQSaHqpn/ySPPza75T64wx80zFsM4iB4w== 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=7IF95Ie9bB81+bMsjtP8dBQ0hXdlo4sdYb4W3ShgO7w=; b=RWAhiVyKN/fJLlHV9AKobRdILQZmIXggdZZAJ9EhFSNX2lBGgtFydsPe50puqWdFvrQ7symFrVnqBLAcwJgAL8ao06nwDpZx7N71wkIE2cFYScx9qRLU6tbBsW5uLIkUvuienLvU3dWR+AaruRcSvOhvM49nWk8frmrXdpotIWnRBvmQfdetK8lyikOuHbrVWdzYbHnK9RJ7M6oD76XMCzp/So+m6nk75AM0TpJgxwoT4dHZ/uoRTFUaXVVhuImrlKbYyfFH1MbDmPDFefEsSi658SnTXQOX/RPoUhgYFb8haFQB/cAIRLg6uGpqXi26p8ca0ZCEFjBXbPsfj2xQRA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=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=7IF95Ie9bB81+bMsjtP8dBQ0hXdlo4sdYb4W3ShgO7w=; b=0P9cVPiHASkviAL1shLlATiaz8SKUEScrqSVP0XzjPzBkHXKkVtf3GYBiJxfp0jIbiXknHkYyr/YmYuPpH19ehH8yAA4ITSvLgVlpdZoV10cUyjs2uWFisT3b42XOMVkEMaIMZlHZNixaeBl+HXnHzYbHgsGrNiOxDSUkndcWEw= Received: from BN8PR15CA0012.namprd15.prod.outlook.com (2603:10b6:408:c0::25) by DM5PR1201MB0266.namprd12.prod.outlook.com (2603:10b6:4:57::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.18; Thu, 7 Jul 2022 17:00:22 +0000 Received: from BN8NAM11FT038.eop-nam11.prod.protection.outlook.com (2603:10b6:408:c0:cafe::f6) by BN8PR15CA0012.outlook.office365.com (2603:10b6:408:c0::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.21 via Frontend Transport; Thu, 7 Jul 2022 17:00:22 +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 BN8NAM11FT038.mail.protection.outlook.com (10.13.176.246) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Thu, 7 Jul 2022 17:00:22 +0000 Received: from pyuan-desktop.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.28; Thu, 7 Jul 2022 12:00:17 -0500 From: Perry Yuan To: , , , Huang Rui , "Rafael J. Wysocki" , , CC: , , , , , , , , Perry Yuan , Su Jinzhou Subject: [PATCH 06/12] cpufreq: amd_pstate: fix wrong lowest perf fetch Date: Thu, 7 Jul 2022 13:00:04 -0400 Message-ID: <20220707170004.216002-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 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-Office365-Filtering-Correlation-Id: 64d010f6-c74e-4a3a-c2d7-08da603a2e23 X-MS-TrafficTypeDiagnostic: DM5PR1201MB0266:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TaXWP7R1TJeTk429vJc+fDtor6bxjKpYgLaJnuBDENHf914W4j6d8PGfQ4EAy83APTS5i+Yf5RjpJ5rTWFUHkv0sLkRFGQnQhztB3ghoVFJQHdEFiH6hSoBbObhGG/viEB6jGKQ8UutxOEjCaOpTFZq0pSrsUOmpz56n4a1U47k2PugqIQXtbXeg7CKG2sd3NlWfeJWLsUPGLZc8sU4jFl53GVzsRKRouEr+QjL9HZ+PefR38eoiH4apJPlEZRBgWQxtLo9wQF1qlN3n+7gBZwgM2KFfb8fEvastlYf81+4Mfz4UJ6nxH3R3HM8Y4Xuu/VossQASb06Oq+bERZxkEW4811J9Xz7eGJjUr+Wsrastx6AZEAD9tgh+GknxtamfGUnfdqok8AcYobex4Mc9lr3sEaG1RU4bhXOdbYZtNQ5MlUwzlW+qh/EdJPRLrsj91M+tQT76w0LZr+jRPlmcyljvOf1BQvWPO+k+/vXmoxwgWTzbZwoViZ9HeN/civ+2lCT8EslfNjlwRr53yhvHeYCLh4IaeKqetu1FrA3ywoasSmXbjWne3+e3MxNeg9cBhh8q0dvPS6q1R2qkwWcgmksjUy9KYJxMJUpMRQSbT82djBmaFYBhGqVHOjLefXgCzXIwQl/c9dPRei+N2sdSZANdFrkFGcFaqbNtbUcXmDt207DK9p78qFeaCxNI9pr4edCveCzoAa19QLgRVnEEHFH6JvWRp+SVL2dcOMuVSw9oDEXhT+h7CRQQidl3qV+eSqhRMIzZbUt1as3gG1lCAFTHOzMr+LrhAWZjdzI0X6JuZa9sXawYt+ANet/LejaehJPFybTkjfA908zvSabUzlLfUUfnHj88AlFvOj0bFB/DRiZytcH3i1ov0kOL/PHX 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:(13230016)(4636009)(346002)(39860400002)(376002)(396003)(136003)(46966006)(36840700001)(40470700004)(36756003)(7696005)(26005)(2616005)(2906002)(40460700003)(34020700004)(47076005)(336012)(1076003)(478600001)(40480700001)(83380400001)(82740400003)(186003)(16526019)(8676002)(81166007)(86362001)(70206006)(36860700001)(82310400005)(8936002)(426003)(5660300002)(54906003)(316002)(41300700001)(70586007)(4326008)(110136005)(4744005)(6666004)(356005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2022 17:00:22.4186 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 64d010f6-c74e-4a3a-c2d7-08da603a2e23 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: BN8NAM11FT038.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0266 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Fix the wrong lowest perf value reading which is used for new des_perf calculation by governor requested, the incorrect min_perf will get incorrect des_perf to be set , that will cause the system frequency changing unexpectedly. Signed-off-by: Perry Yuan Signed-off-by: Su Jinzhou --- drivers/cpufreq/amd-pstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index fc0de9fd643b..7c51f4125263 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -308,7 +308,7 @@ static int amd_pstate_target(struct cpufreq_policy *policy, return -ENODEV; cap_perf = READ_ONCE(cpudata->highest_perf); - min_perf = READ_ONCE(cpudata->lowest_nonlinear_perf); + min_perf = READ_ONCE(cpudata->lowest_perf); max_perf = cap_perf; freqs.old = policy->cur; From patchwork Thu Jul 7 17:00:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 12909978 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 2B509CCA479 for ; Thu, 7 Jul 2022 17:00:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236129AbiGGRAp (ORCPT ); Thu, 7 Jul 2022 13:00:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236448AbiGGRAj (ORCPT ); Thu, 7 Jul 2022 13:00:39 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2046.outbound.protection.outlook.com [40.107.220.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D6345A2D7; Thu, 7 Jul 2022 10:00:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WXN+58/LE7VjUeOZ1ezUdZMFntgcWhir1q7EcQhguSU02/sUeFDQdpszHDKPrE8hIHhcv4+f0W6zk4DExdUqt1HD3+YjMCXo8ah+OFobnuHSQ6ZqPFgdxqzKeKGXj5I5s/7lHnf93MJQDx7M9Vm950n0YV6TipNNQEx4yFGqyd4J70Jj/oGYC/aMWjnnvtcYzrU1M1JuAn+EUWs4mvGlhuK9GDYTYtIL0DbKJ8leHf9sxy4Bm1sTHbMSNVlKX92Zj469vMlILsR40m4nFTwN4gJgnheovc7z5jbFq87S8FouzA8YUgyOAcB2JyTqqC3wLxawWxrx72FobfSnsTb8vw== 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=jO3WrzBohaF2MGyFlIjb8L5AhA+D+Aiscygxe+O0FAo=; b=XSQFI7T4Y/vzSmEk5eeI7uTsBX4uHm6AF3dIi8TYITCv96I8Ir4jEUv8mTFjPq7Ud5t85zpnUUUVv/11fGyv4dU+tuf0vgs7udfERQhu5LelTZPXX7Nw8LOwji2bSKwGGuwWKCmJ3qJU0eSSjmd3qcv2VhMPkjXhcxGaD0+/8wK0lQTQVsf3buLrnLcLJvD5PiSKgofOF/LGu3d18w9qiBsT6Baah9p3OPbSoLv3HG4+WehnjwBnuN8yiDXZWmy7PXnsrxJOFrdQYKCg2m22RRSlJ09ys4mkPIVmwNMpKCpj+h80H6sNVojaVT3Yfn51KotHQ/Nhez+PMCcn86wjEg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=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=jO3WrzBohaF2MGyFlIjb8L5AhA+D+Aiscygxe+O0FAo=; b=Je6FU4WgM9gg6Jqybh+l0z3Qy9ni8PN0oQ/rkcjBEKi22hL3qOcqzG4cJUXUoZvdRBnn0AicrXIN08xTL8sIK6Riom2/vCTjTWVd/FAu3efDGimZiAe8dgMU8TCaEFIpOiBx2ImA48TaDH85x1uPraxpxrUbh5RVcrCGiDmi8sc= Received: from BN8PR16CA0035.namprd16.prod.outlook.com (2603:10b6:408:4c::48) by MN2PR12MB3821.namprd12.prod.outlook.com (2603:10b6:208:16f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15; Thu, 7 Jul 2022 17:00:36 +0000 Received: from BN8NAM11FT061.eop-nam11.prod.protection.outlook.com (2603:10b6:408:4c:cafe::71) by BN8PR16CA0035.outlook.office365.com (2603:10b6:408:4c::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.18 via Frontend Transport; Thu, 7 Jul 2022 17:00:36 +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 BN8NAM11FT061.mail.protection.outlook.com (10.13.177.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Thu, 7 Jul 2022 17:00:36 +0000 Received: from pyuan-desktop.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.28; Thu, 7 Jul 2022 12:00:31 -0500 From: Perry Yuan To: , , , Huang Rui , "Rafael J. Wysocki" , , CC: , , , , , , , , Perry Yuan Subject: [PATCH 07/12] cpufreq: amd_pstate: map desired perf into pstate scope for powersave governor Date: Thu, 7 Jul 2022 13:00:22 -0400 Message-ID: <20220707170022.216202-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 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-Office365-Filtering-Correlation-Id: 04d256c7-8575-4ebc-f244-08da603a3654 X-MS-TrafficTypeDiagnostic: MN2PR12MB3821:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q2HvMzdK4OuFYvf4XI6Sso5stDCblN3HAi/9LRXeSf2COvhPgjJPRJBmSIXCdveAsNzGsP3NIXw1vBFsZbaJKgYhpjX5toVqpqcS7WzAPQ+vY2qr5UN+79wsJupQjfp0Bk8V0PnyE5nKzORciQz0UDEotWZUbHMlrO2hvpmFeuMMWV1BKyqWKrwkCVwI7s1i/lzh7HWThMjFEvWKVQQPZFCcFEU5XEWQueoEd5pR30wxm13k+ZMKr2N55vTa9lo5mEFwTx4TZccoFYj8CWzxvaBP92Rcu8RVlfWHEMIMk/5VK7jdra8w+4LO4LzrDIenxAWJAJ2tlcVhU4d5euQDUNFyaRpapqYyCI/0ScfLrgB+UoLYRkTIX2NPal/UwggH3VarIsJu9NtckmGW+bs8dvxyxk30cuFEZwHEkapMunagmSgvRwPF4DFMXiG8myA89G1R7qyMZoYvEF4AAOj2NL5ECfl1ZcLHHtDocv2QUDvTJcRUhZ8glKnK/ZdGQaoKuVkT5WOVjh2dPcObVz1M9MCIfmepuo+yveVq3M7Cb+aXHH8LYv6CQzRv0kqXDFkcPXofsFTkMO7JhMPgrD5ZxkEZ3nqU3tM0hsD+GTjVvV4IpuIIyLwFn5jnMa9qWh9v/CI08JJuFkWhDDRg7RzhrQks3//FQ2hDJ/bcJ46/FB7LmJgJh60v4TsagJ4wSXcmDJOJrQrrbvAdVoqDi4D9tjan1RjxjwjShYONor7B1QSv0Vd4IUIptiyaVW5QeQOVcDllK/bmjzCAfk7AH9nbKcBqsT09S4idOL3DjCSnMbEIS0lSb/ps/23i6Za0ziSuOmGwqkaa5cNQSbs+WjuypXYeXkVRBSpYBeMBCcL5wwfwcsa6oqQiZtiC2A/iHuvr 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:(13230016)(4636009)(39860400002)(346002)(136003)(396003)(376002)(46966006)(40470700004)(36840700001)(83380400001)(110136005)(2906002)(54906003)(8676002)(40480700001)(70586007)(6666004)(478600001)(40460700003)(82740400003)(356005)(4326008)(81166007)(36756003)(4744005)(70206006)(8936002)(86362001)(5660300002)(316002)(1076003)(186003)(26005)(16526019)(2616005)(82310400005)(336012)(34020700004)(426003)(41300700001)(7696005)(36860700001)(47076005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2022 17:00:36.1627 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 04d256c7-8575-4ebc-f244-08da603a3654 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: BN8NAM11FT061.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3821 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The patch will fix the invalid desired perf value for powersave governor. This issue is found when testing on one AMD EPYC system, the actual des_perf is smaller than the min_perf value, that is invalid value. because the min_perf is the lowest_perf system can support in idle state. Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 7c51f4125263..154eed849f38 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -317,6 +317,7 @@ static int amd_pstate_target(struct cpufreq_policy *policy, des_perf = DIV_ROUND_CLOSEST(target_freq * cap_perf, cpudata->max_freq); + des_perf = clamp_t(unsigned long, des_perf, min_perf, max_perf); cpufreq_freq_transition_begin(policy, &freqs); amd_pstate_update(cpudata, min_perf, des_perf, max_perf, false); From patchwork Thu Jul 7 17:00:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 12909979 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 DC106C433EF for ; Thu, 7 Jul 2022 17:01:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235976AbiGGRBD (ORCPT ); Thu, 7 Jul 2022 13:01:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236261AbiGGRA5 (ORCPT ); Thu, 7 Jul 2022 13:00:57 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D530F5A440; Thu, 7 Jul 2022 10:00:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CwFDsyXqtWAXOfxyJimDL17fxUuRIQB/T04C6G0fdNCDS4F7NTDouavVDTxrJoD2SLPadrZ9XAO3mVwbWxw6Biwxg88fDFtuWT2VESQ5m/RNr3OhtRIBTmn4FBvHEzy/b/G78cQZwUNIhdQQAUtCobm76DhaekzjYfTpw9C04RCfqOydFy/yuLzJGZ+GhcPf2bfPHDVp8xlzQm3t5B+qZa5KY7qYxVPOCYS4F0K87EjaohqEke1oB0/rC0YsXdmZ/7jaUjZFNGTMHeZg7D1n9s7pNamC0JS658BtZmKUFSrtkmrnR5q0L/qtxf19YUUzOq8LIC13xZSM92nO1Pktqw== 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=v6TzfMK3OcoMv5+cmDJ2RkwEixU0K61j6qyFoKP/mpY=; b=WYJ+hrISTPHWbrzAOyNEsquifw5h3beAIUvRZoEexONfr28DTYpPDAXmR6xIBwlKP/ClPaqx5NFRSE5wMYDD5Nu43b/5Q0nTJy1VZTWNBbbsKZC+NNH/ibc/bJqsi+N41ptoJISS/iJxwzN4Ax3PW0wE93/0GZaZ/g+F2tg7ikiZnh12MNQmbQ3GVU75/qwZcUaqpCTmvyOdq0GnEIPoM4ghNUlsJqqa9JI8GZS6J0SUld1oz9vf7hK9fXLjRDBtp0qyv9Go/GQwh8BQvcCIYUT8NBQWwTeuBKVZofE9XKpZn5uqAXsEd1O7RSMq7EpwyakAvaf89w1T9M8+7QTlYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=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=v6TzfMK3OcoMv5+cmDJ2RkwEixU0K61j6qyFoKP/mpY=; b=s8WStfJhHh1AJ/wZjrDfIAN4lhoxFvff4bhv/fNJZo1NisewUlkbyY1DL+qN4mc7DHMYtIrh0TTk6vK9uMlw8R+gOzg9kT+eb3qno6Mia7q/uZXz+nNZuqnoF11c22PBYrhhZ+wMh63MqpPUo4/dGxWRG62JbZVazvrKHtnMJbM= Received: from BN6PR18CA0010.namprd18.prod.outlook.com (2603:10b6:404:121::20) by CH2PR12MB4860.namprd12.prod.outlook.com (2603:10b6:610:6c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Thu, 7 Jul 2022 17:00:51 +0000 Received: from BN8NAM11FT031.eop-nam11.prod.protection.outlook.com (2603:10b6:404:121:cafe::ca) by BN6PR18CA0010.outlook.office365.com (2603:10b6:404:121::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.17 via Frontend Transport; Thu, 7 Jul 2022 17:00:50 +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 BN8NAM11FT031.mail.protection.outlook.com (10.13.177.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Thu, 7 Jul 2022 17:00:50 +0000 Received: from pyuan-desktop.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.28; Thu, 7 Jul 2022 12:00:45 -0500 From: Perry Yuan To: , , , Huang Rui , "Rafael J. Wysocki" , , CC: , , , , , , , , Perry Yuan Subject: [PATCH 08/12] cpufreq: amd-pstate: fix white-space Date: Thu, 7 Jul 2022 13:00:36 -0400 Message-ID: <20220707170036.216382-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 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-Office365-Filtering-Correlation-Id: 76a3df22-2071-4af4-d020-08da603a3ef2 X-MS-TrafficTypeDiagnostic: CH2PR12MB4860:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xhKN/9AIyU+l/NTWKDEcqmfEYlzSPtxb2ZFkheYLKxpk1z1IBChczSjH6LbQeaIUnt+LdEPrFX0qsaujwPZ+LpRtEXn7EVgQHe6PSCg2DciOO2zPw2dcVk3JMy4aQq+sQulCaaRM5a6ihSWyNRm5R+lLrBKi+2cVIVJnppMdTFULwWhvLPkwWtOur2J/s09Jxs+p/gBsG71jbURfMIdHdB3WmCmkA76iSyOzBsT4810BAgEbWmJv7w4CbV7RXqbmt51cwZ+HspwasXoAz8lDse0ehjxDSE/A06iFFxFK7FnxD0x5JqI95bQRh9wsNs7UUZg7dDvEinpNSSZfxu4txFLSUo/QntSjCKJqWcYjRG7Dye38ytt6P9LdQkf/bzE+3EzlEDlcgFt2BH2UNEG9CkwAkw9kprbeLDfGNtAyEX6Us3xtFVBUpagb6JhUoPf5G94HKeTIVrJVJUJRk+8X5aVsv/O2eE5+h174/fSK7yMOU6hGbmQLa3LShuLm/lOvnSFpJAZri+8/bdo2shrmyW8X5V8HEk4v4R4i/xGjP83P0L5Oa1bFOsUL27P5OI+CV/+t7Jb3k/wIM+ocKvU0F7KvxnPLdm4u5sbJkc145fRko4ugFrvEfveTpsTT5F3MEtQo6+ZXic+2wOJtwf0I/FMf0CjsVEe/RX7dYF++3pd+CK3Aj97qwAip3bV8kch3nsrF+8b/N0qLqa+99XVA1F4i/RQW39C2vV7bPmY9JH2Ps0ayfNtxqjKitT72xwSDiLrB0W49dba7x9aEAwcT00Df1FVmItqnKjU+N9QZXT514S3lriuUaElcrDAMIrSs7J65xpC8X4pfuYNGnqhimQ0C0+rCEw7GHoEZyRSX3qOS6pTTUyVjDHxx8wWCKbqP 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:(13230016)(4636009)(39860400002)(136003)(346002)(396003)(376002)(40470700004)(46966006)(36840700001)(4326008)(40460700003)(186003)(82310400005)(426003)(110136005)(6666004)(41300700001)(54906003)(336012)(7696005)(26005)(316002)(36756003)(81166007)(83380400001)(16526019)(47076005)(8676002)(2906002)(82740400003)(1076003)(8936002)(4744005)(5660300002)(40480700001)(70586007)(356005)(86362001)(36860700001)(34020700004)(478600001)(70206006)(2616005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2022 17:00:50.6191 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 76a3df22-2071-4af4-d020-08da603a3ef2 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: BN8NAM11FT031.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4860 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Remove the white space and correct mixed-up indentation Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 154eed849f38..173a45cf292a 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -115,7 +115,7 @@ struct amd_cpudata { struct amd_aperf_mperf cur; struct amd_aperf_mperf prev; - u64 freq; + u64 freq; bool boost_supported; u64 cppc_hw_conf_cached; }; @@ -673,7 +673,7 @@ static struct cpufreq_driver amd_pstate_driver = { .resume = amd_pstate_cpu_resume, .set_boost = amd_pstate_set_boost, .name = "amd-pstate", - .attr = amd_pstate_attr, + .attr = amd_pstate_attr, }; static int __init amd_pstate_init(void) From patchwork Thu Jul 7 17:00:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 12909980 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 C9FF5C43334 for ; Thu, 7 Jul 2022 17:01:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236115AbiGGRBP (ORCPT ); Thu, 7 Jul 2022 13:01:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236272AbiGGRBN (ORCPT ); Thu, 7 Jul 2022 13:01:13 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2059.outbound.protection.outlook.com [40.107.94.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07CFB5A2CB; Thu, 7 Jul 2022 10:01:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bOd57qt7CvFAWZ91oMQUa22MPItpaGlBpYQqGOd14BVrphwX2kcIFVwN/zZRHqJt1klRGa07c1daYuT0LZienPqJy7+V3PVbGk40JCHy74ZjEHNJ0rXM7AOxxOCr8O0pQShAdGviagY+QVSIgh+Q/z/HFvlrZ03TzjfUDv1g90qj8w6wVu3ks3gLHrTjhSy3bjcX8nKwapsKGAEasF5/O/xk3SEoBPzaMgUZ8Cfm+hETO5MaktOlE0MJO1uDVJwhwheZG/FLaHeGxNirXPanbacEz8Ry/7VvnFwP+3KVcE78LFzAhqmlWPpOK4rXzJEsAk9bHitWmvYTWYgMXHP4jQ== 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=Fb8/Pi37J6YDGuT9JW3EZkxT3D+mGfgGyya5hpbNczU=; b=gTLwe3rjTqiJcIeJyag2D5igMiV9kFuNcJthqxK+xm4IeZA+4L5UfFaqZqfEXxh2d7dAWfRjChMCUbAkWlyIyBO49aBAbnOOVIz2/U+e/iQug75nhINRCI5DScW7dTgDkIo7UfBZbDYxXHCATOxaAJhnoSOKXIxOj5+V5BkLE4lvpLMH189pkmwVunTsfev74gXKFxa2FphDarDmtrrlQy27dCNZaZESHE9H87TXk7P9gbM2jtIz5CYQCp20AwVkw+2wYNjjmWTgrpKvJd/cucFjTUjpopOzLes/l2+bXIqa89u295Shh6zj/RD7btbTP2brY7hnXlcd9ex2Vxb0Qg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=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=Fb8/Pi37J6YDGuT9JW3EZkxT3D+mGfgGyya5hpbNczU=; b=ea+KhUBql6J05fChRVDTd//h//QHcbZNL5OiiOa+PAfraMCqfIwcY1at5y7bOcniJBqRbkGg1GvqnxTq9U0TD7+PniWFyJNQ3ZmpITceh2/iSVlhX3J02gE91qgZhgDFSDOARA8zx4MmaUeo/GhPLMfRVrbsqiwQX/VTOEG3kuQ= Received: from BN9PR03CA0689.namprd03.prod.outlook.com (2603:10b6:408:10e::34) by MWHPR1201MB0174.namprd12.prod.outlook.com (2603:10b6:301:55::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.17; Thu, 7 Jul 2022 17:01:08 +0000 Received: from BN8NAM11FT031.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10e:cafe::6c) by BN9PR03CA0689.outlook.office365.com (2603:10b6:408:10e::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.19 via Frontend Transport; Thu, 7 Jul 2022 17:01:08 +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 BN8NAM11FT031.mail.protection.outlook.com (10.13.177.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Thu, 7 Jul 2022 17:01:07 +0000 Received: from pyuan-desktop.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.28; Thu, 7 Jul 2022 12:00:59 -0500 From: Perry Yuan To: , , , Huang Rui , "Rafael J. Wysocki" , , CC: , , , , , , , , Perry Yuan Subject: [PATCH 09/12] cpufreq: amd-pstate: update pstate frequency transition delay time Date: Thu, 7 Jul 2022 13:00:49 -0400 Message-ID: <20220707170049.216556-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 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-Office365-Filtering-Correlation-Id: cd5829de-4770-4ce5-15d6-08da603a490b X-MS-TrafficTypeDiagnostic: MWHPR1201MB0174:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F5HrufuhswvHM0sDMzPZwvG4sTrjta7Dneg17hhVUNDSQ3u6opmsSv48n0P2nUaahsrI9oNZkwQ7anamP+D7HFC5/A6+hrTyGbauFCE979TYM6TTTSt080vVbrJlTbeOucELFLJYdrdzUBXAzcuF1eF4MEgravKZy5P4j94qSOSq+prC8MiZ8UzBOClW1I8DvuIydB+k+M10cg1h1eBo/XugMMXZvkvCT2TzsLuXZG+X11B1jS7wjbPwDgMlXCqOGM+/OSkuExgRxzgapN+usMRooPFrfthBKwuxd4RK799/BCkP0mS8TseT5wic6Ackc48PYuDp/vMAYoZJgZ/nhQdS93ToJOXa5KjC4vF665fVFYppC5oxBEEjCz221Q5nMKxLYte55zZdE5vSRbgy59lBzJl7xdzx7WH5xZ0a/M1t6EGphc6XCf+4iFPKAqLATBHptTdvX3RLHanj3ma7u86CgFcdYd/Zl/pcHGKhA3tjOTG0TLrKlLEJMFDL4mpSitOswuxq0qefAY/Lz3M0C+gEIx3n1dGkvVTXNVOnwPFqqiPtodSTloErVBMqptX0VNTjECXGltVG8FJ81SXCImpRwUMGu+6GBunFjU9tvCRnPFXADYR7DeA+/fCWzL33yVGp2IffDX2mMQh9aB19jVjPo9fFefv75GMPldkxVe5P/KMD7vAssJsXTBKTbj1na2/idlVzonxy8jGUJja9K8E2OzuaKCw1uPBDF9DxjiHJJ5UFKKYBrzCYbkKKWAF0DanRjaqRitQtk6RPB5DMJ6dEwW28rTjDBInWStTZTQUbvniiAlvEqGboG7fPe6L71NPoPGfR63ZG+RrWUlMUvx91HItHevpTkQHCbzmsQlV9KHadomtChR/tneBAVVOi 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:(13230016)(4636009)(376002)(136003)(396003)(39860400002)(346002)(46966006)(36840700001)(40470700004)(6666004)(2906002)(41300700001)(86362001)(8676002)(4326008)(7696005)(5660300002)(4744005)(478600001)(70206006)(40460700003)(70586007)(316002)(8936002)(82310400005)(186003)(16526019)(36860700001)(34020700004)(36756003)(2616005)(40480700001)(54906003)(1076003)(110136005)(336012)(83380400001)(426003)(356005)(47076005)(81166007)(26005)(82740400003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2022 17:01:07.5554 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cd5829de-4770-4ce5-15d6-08da603a490b 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: BN8NAM11FT031.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0174 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org change the default transition latency to be 20ms that is more reasonable transition delay for AMD processors. Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 173a45cf292a..b54b3b559993 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -41,7 +41,7 @@ #include #include "amd-pstate-trace.h" -#define AMD_PSTATE_TRANSITION_LATENCY 0x20000 +#define AMD_PSTATE_TRANSITION_LATENCY 20000 #define AMD_PSTATE_TRANSITION_DELAY 500 /* From patchwork Thu Jul 7 17:01:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 12909981 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 F4094C433EF for ; Thu, 7 Jul 2022 17:01:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235908AbiGGRBT (ORCPT ); Thu, 7 Jul 2022 13:01:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235918AbiGGRBT (ORCPT ); Thu, 7 Jul 2022 13:01:19 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2047.outbound.protection.outlook.com [40.107.244.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 179352D1FD; Thu, 7 Jul 2022 10:01:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f/Oe8WS+N2/4CL0KhYcdp8qICwj//lol/GNi/iOcfD0Pf54U6zDMcPm5qDpC0ugXChjvRj8IFLDKfLcg9x3nmGHsLWMzE53vHBZUEHfQljlGY3wJcKN5MYRqhV1oFnLz/09gIuhmJLOAh7FvTX597T0aP5FpPokNRskRF/zNr6ph59Hj8Msz02YkykxlBGT9F9MGRd8yi/zI7aVU9GNsuFtyo97z5sqp93I9Org7HTyCuYXVweLQya4ihB9WGm7vJcwO16Nobij+OuALyJgS6BQH6lwkhsq7R41GWv3htEYdA/6FM79ulc1wEKyt/U/0bu7QKtFkrFvU89gY1+5vNw== 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=hOGwb6iQgiXC8uiymK3fzM35IAUzd3gvT64eOJo+5AM=; b=h/FXyjSkVYXfCgu//C2iWeNNp4/X5us32Ko5RfZLoExR0/vK5MtmJJGTo6aro7z2UeNlUX3ZDEjtpyZ4zJ9KDbfl5xF4PlzO65jtEtpKyCzI8rBGiWbUmz39LunBTW0gMd9mZdM2N5vUtJqxRfIJ2xWtBPru48uZsxqrd29eyDyQp7hBcNgn+05fVqcNdwNmPKfzSETCSU7wxprITyIbkTHK+cPQ0YT0tn49Krg6GcFrCOh5Y3X5qiGnsQ0l00h9WlOGludaoqe5y60DIAg10vNV3gXXeu+CNPIOE2awXLc74XIGCNt5H6GlwtfshZdsdXs01fSN/swb+jHqzr9lSg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=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=hOGwb6iQgiXC8uiymK3fzM35IAUzd3gvT64eOJo+5AM=; b=VGn+uNYMYG+3SPFgvGhqx05aIhyCYIfYflkH4puXggY/0mY62j9nPXQXHLEmXxNyhINR0MiGGERZ8XGJAi3od9krMDY/g11CLvF1etLAY1vmfSxIDyFLAdazIghI5Pf+kwfVxsxm0ShqdRWlfaZOlfuTrt+0QQ+gGmA8SzXS9Pk= Received: from BN9PR03CA0672.namprd03.prod.outlook.com (2603:10b6:408:10e::17) by MN2PR12MB4342.namprd12.prod.outlook.com (2603:10b6:208:264::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Thu, 7 Jul 2022 17:01:16 +0000 Received: from BN8NAM11FT031.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10e:cafe::8f) by BN9PR03CA0672.outlook.office365.com (2603:10b6:408:10e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Thu, 7 Jul 2022 17:01:16 +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 BN8NAM11FT031.mail.protection.outlook.com (10.13.177.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Thu, 7 Jul 2022 17:01:16 +0000 Received: from pyuan-desktop.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.28; Thu, 7 Jul 2022 12:01:12 -0500 From: Perry Yuan To: , , , "Rafael J. Wysocki" , , CC: , , , , , , , , Perry Yuan Subject: [PATCH 10/12] cpufreq: cpufreq: export cpufreq cpu release and acquire Date: Thu, 7 Jul 2022 13:01:03 -0400 Message-ID: <20220707170103.216736-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 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-Office365-Filtering-Correlation-Id: 894ef29c-ca37-4a39-ad7b-08da603a4e2c X-MS-TrafficTypeDiagnostic: MN2PR12MB4342:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5spTVkHjyYN4ZU9Y2nAQwlAKLYCtDQVR6dHCtZQFOJSiuEBoFesWbdfEROt13T+lYfFjnZrFnKjbKQyMhf+AZpZvvwE4bOE8OOMzkm1gXNaHPa+hyexBfsOZCmrIggcp+xE3NzetwcaawPYyFDfb1GBGl4DtawY3JOrCh+WaoYmZfpAblK1I15vpZPFPabbzQv8n3gMV0yfuyLjR3P6tUbCPJUC3qo9sHUutY6lUXY/xg7l/jIwX8qFeAFTp+KwZvs9MKlTXwbXAUor3AepVMxhLSBLtnwLOi9XK5N6szNA/cgLYxXUreN8uB2Z0gcmbij08e2HKINlIplIJXjRzmQ0uh+ao3AwyH5LdoFqHh07tYCWUVvngSQUM5O90bWgCJRAhbQ4VFzEY5KVsTOqNp+ZzPqP7PTTbbz2ov+5/YBigmFWIDQBwB09ef7ZF3IJpOfnvu4ss+poo9QQ9HF1nwNzjYKpddXyh738CA8u054SpL37Io6c+GNTNw+SMAgsK3ouzkeId9wv65eDusqje4BK77d7up/vq5Qjl2zmjEJB0zOtzo3fC5i/r2ZkWOt37r2Lzm6MNxSgmcifq+4YiovbDv7b2b7tirY/KSXYcePj8ddZ/DhCK1qk4SINUs9ZRs5Pg9oPLRw3HArCPL4vdrVJwH2FOV8dv8cw7c3a4cJK6f2G0gJciOwXvuB06x4l9p8o5xZk1C+zD2x0Z4OkfdFJT8BW2CBMrUS5D56oWI9JFimt0MIOxM0MZAjbLgaJidAjXL5Q4ADlgE25bjz/DyCJpobGwFtiR9blQlnnAbgyDcDbuAKc+Xq9GuU238K+TnEZxXSwLSqDWeDFoOpbZKmjPzY88Locdgx1+367dmYIoNMrRvichp+DPP7lgqOpu 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:(13230016)(4636009)(396003)(346002)(376002)(39860400002)(136003)(36840700001)(40470700004)(46966006)(41300700001)(1076003)(40480700001)(54906003)(36860700001)(6666004)(34020700004)(2616005)(82310400005)(36756003)(316002)(2906002)(7696005)(4326008)(70206006)(110136005)(478600001)(86362001)(82740400003)(5660300002)(83380400001)(426003)(186003)(8676002)(70586007)(336012)(47076005)(16526019)(26005)(356005)(8936002)(4744005)(81166007)(40460700003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2022 17:01:16.1485 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 894ef29c-ca37-4a39-ad7b-08da603a4e2c 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: BN8NAM11FT031.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4342 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org cpufreq_cpu_release" and "cpufreq_cpu_acquire" are only used internally by drivers/cpufreq/cpufreq.c currently. Export them so that other drivers such as the AMD P-state driver can use them as well. Signed-off-by: Perry Yuan --- drivers/cpufreq/cpufreq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 73432360e6e9..4d3c83da29b7 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -262,6 +262,7 @@ void cpufreq_cpu_release(struct cpufreq_policy *policy) cpufreq_cpu_put(policy); } +EXPORT_SYMBOL_GPL(cpufreq_cpu_release); /** * cpufreq_cpu_acquire - Find policy for a CPU, mark it as busy and lock it. @@ -291,6 +292,7 @@ struct cpufreq_policy *cpufreq_cpu_acquire(unsigned int cpu) return policy; } +EXPORT_SYMBOL_GPL(cpufreq_cpu_acquire); /********************************************************************* * EXTERNALLY AFFECTING FREQUENCY CHANGES * From patchwork Thu Jul 7 17:01:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 12909982 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 E51BBC43334 for ; Thu, 7 Jul 2022 17:01:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236253AbiGGRBe (ORCPT ); Thu, 7 Jul 2022 13:01:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236272AbiGGRBc (ORCPT ); Thu, 7 Jul 2022 13:01:32 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2078.outbound.protection.outlook.com [40.107.244.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBE0E2D1FD; Thu, 7 Jul 2022 10:01:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gL5UG8RpLDRFXwIyn7RzyDpk/Rrz9X3XgLveEq8awmcFPq43yiMtxdYfgrUMbT8ROXNg0SQ/VAn44lvwa1F/tEDEHOyC41MOEz27KTR38aqVuNyxGf2TSCxQpyXnAqxqUl1aDkG5CCSoBAepZ3+xlomxt7hKG/GtejsNH9uaF64/ZMlho/mjwIp9RbseuabZujlzT2o0/zCdBkMzgLyfv4Mga4IL7szB98vQJYpYJD4TwhmVTLyH/u8K3C9C5H/K/B9WQ65qxO+rRiz1WnVrQss7yb9ycttQbNCSJwSgHNkiuqm+VkvM2XSZ7f531YfPcZ5IkJZPEjebVzdzSGooUg== 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=76W9lTSjv7/o2nz175WwEVMNGMz09Jm35bBwjGY82Fk=; b=VlmMYDETFec2WqJQKa07dj/eHthkQm90vqWUL5zkqg26Rz1msHpYIRB9i8rHo8noBK83g+xCywm+CQzop30VKnnRR70BsMROFpXbX79aB8JonqxuP06OlHOKlrkstUrGj3LM7Fspvfiw+wpGZoIxWLh0NP/yi8x/QrTDRSQVl41g+HSSu60l29irTPAHt8TYstpTat26VRkSgF8wrgmrDFO0TLFxsvxyWnTX+zxKB0mDZGBN9UWwALs6ZW3418Kd27BNHs7+XUN5+YazUi3jYzhrX9Z7EX+Pt3wUENXTviO49zaN8CS0/vNaKI4kfxpgeACb6kZ3rQufXmQ206fIWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=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=76W9lTSjv7/o2nz175WwEVMNGMz09Jm35bBwjGY82Fk=; b=usrrGrwo55H+n6BGNCOZ6W+SO8/VfoF3VVhFOictIjTx69y57S5VftAfmGOgqa8m1d+QdrhwRIk/jegNtmG1nV42J7zEKamEa5sELrAl0dUndHDzY8mXhZUTpmE3zYMny/e5qUde3m7STWl4Lu4gqM8uVleevz1bCNUoFX1/N4k= Received: from MWHPR07CA0008.namprd07.prod.outlook.com (2603:10b6:300:116::18) by DS7PR12MB6045.namprd12.prod.outlook.com (2603:10b6:8:86::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.21; Thu, 7 Jul 2022 17:01:29 +0000 Received: from CO1NAM11FT033.eop-nam11.prod.protection.outlook.com (2603:10b6:300:116:cafe::9d) by MWHPR07CA0008.outlook.office365.com (2603:10b6:300:116::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Thu, 7 Jul 2022 17:01:29 +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 CO1NAM11FT033.mail.protection.outlook.com (10.13.174.247) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Thu, 7 Jul 2022 17:01:29 +0000 Received: from pyuan-desktop.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.28; Thu, 7 Jul 2022 12:01:25 -0500 From: Perry Yuan To: , , , "Rafael J. Wysocki" , Len Brown , Huang Rui , , , CC: , , , , , , , , Perry Yuan Subject: [PATCH 11/12] cpufreq: amd-pstate: add ACPI disabled check Date: Thu, 7 Jul 2022 13:01:16 -0400 Message-ID: <20220707170116.216912-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 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-Office365-Filtering-Correlation-Id: f2048675-e557-4a4d-9a8a-08da603a5644 X-MS-TrafficTypeDiagnostic: DS7PR12MB6045:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Wy0uK61ddqlEnm8B0RHTPCRQ5CrtM4jVqlowdAxVeipc6v/xmPz1Fnw/d9kb4pTN3T60ks2ujLCtDiQAq3vmTP38bQ2C1XDaqpsSKVwu7ZJkuWwrmIwEnQHddkz8xBTBO6iRqN14B8KsuL948MKYvKvEKyKkBkom77f+cFb1WL9zZcvlrveyPJUmQb+S1E6DGWXTk9XrAj+ZFnz9KVIyD9+ffsXfurm1s4yEoHRFNAa6UuhrRE5pws5VYVSBbtuXNOlZGk8JOUDLqhsUsUcyn5VemLY+VodUYpE2/W33Ltc1Myq81dbO2ysTPlDn1STW8hvu08I941o0pToijbdVc3dIKZhsyoFEHQ0veRD93ZG3T4/RPdd69onNPMLU27tEqbLtPncyTBBhLZupfe1Q0/mdRHfGMAw+Id5niIHapEQCzqUAm82sgPJ4YtNsdufy73IfQyhiSXi/tMMLA9lgaUvp8/bAqnKuZEaqg/G1Cxd+9NxBNPzXI/r+X0Ml1kB3ug3Pr261UO+npKJu41rITuBcaF1086AiIe7WnXgaIN0Q0sOCsmuTgvVBbc7+jP10Mp/l5OYiIDVQGKTBEkS6bK0axsFcE9YVagWeWlV2uOdD2RIfbJrhlo/qkkeA7PLL0hfvsit8A5kWu3QfOvH5cqymHq1c/GRnzD/uGl6ebSRVdx4027F03pdI5yk7MpUMQlFh35d+szI/qIDRG0p0eK7819YYceTUtlHZdwAcMj3wmqI2/OrZ//OhCggOy0rxy979D2bBarezGvnODWXZi4gphI9RmvHFzXvFRoNV/SK1TB6BLPSGl2uwCj55foSax9CNfDh1shAR6OlPqhAeEyQPglan+EdvrVK5J49GkTfJh8Tm8Hjb9aYgcQev7dFw 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:(13230016)(4636009)(39860400002)(136003)(376002)(396003)(346002)(40470700004)(36840700001)(46966006)(2616005)(186003)(83380400001)(110136005)(40480700001)(16526019)(426003)(54906003)(1076003)(47076005)(316002)(8676002)(82310400005)(336012)(70206006)(36756003)(70586007)(4326008)(478600001)(7696005)(86362001)(40460700003)(81166007)(82740400003)(8936002)(5660300002)(34020700004)(26005)(356005)(36860700001)(2906002)(41300700001)(6666004)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2022 17:01:29.6334 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f2048675-e557-4a4d-9a8a-08da603a5644 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: CO1NAM11FT033.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6045 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Add acpi function check in case ACPI is not enabled, that will cause pstate driver failed to call cppc acpi to change perf or update epp value for shared memory solution processors. When CPPC is invalid, warning log will be needed to be printed to tell user what is wrong. Signed-off-by: Perry Yuan --- drivers/acpi/cppc_acpi.c | 3 +++ drivers/cpufreq/amd-pstate.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 6ff1901d7d43..17d67e3ededf 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -424,6 +424,9 @@ bool acpi_cpc_valid(void) struct cpc_desc *cpc_ptr; int cpu; + if (acpi_disabled) + return false; + for_each_present_cpu(cpu) { cpc_ptr = per_cpu(cpc_desc_ptr, cpu); if (!cpc_ptr) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index b54b3b559993..6d81a9a94dde 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -684,7 +684,7 @@ static int __init amd_pstate_init(void) return -ENODEV; if (!acpi_cpc_valid()) { - pr_debug("the _CPC object is not present in SBIOS\n"); + pr_warn_once("the _CPC object is not present in SBIOS or ACPI disabled\n"); return -ENODEV; } From patchwork Thu Jul 7 17:01:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 12909983 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 A6AA1C43334 for ; Thu, 7 Jul 2022 17:01:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236302AbiGGRBy (ORCPT ); Thu, 7 Jul 2022 13:01:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236477AbiGGRBw (ORCPT ); Thu, 7 Jul 2022 13:01:52 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2080.outbound.protection.outlook.com [40.107.244.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C7BB5A2DD; Thu, 7 Jul 2022 10:01:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d+b3DGIkTEEY8zk6FHWqO+MXbgE/VD/P1Se7ZMaCD2g1IdWh6mhn8+CRG+2C/cKzDbuTwC007geNSuHG0Jfj8tYewihzJoe1UJpwm0XHmKWl3SwLBhir5ldMsrf33A5gwv/SGF/ZPQRsHEEyxepl4YlEHgPNaWz96d0idb8BQ20J5tAbnersOW4/WudHrntajjHzaASBTcqmZ2jjDzDotgc+ac29Wq6a2il8qemZgFSnst8BPXeCRP2ONy8nGp5AZrEMYpiH3VM8Oz411VP07nZxZpXZbNShmjOvmfvdHx3RKHUFhfrDKVxzroYmJ+b1/lguZKItbd5wCx9UWee16A== 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=h37fqiQU02ngbcc8LOrE1usF6rNCcg/OMszPMryKmkA=; b=UmtLEW0yNb1kSD9k/oBReRvkGh660/rtZWE5B+IdhfsC2KvQzBu6jhlcHOm8otmXcI+k1u7t0tWRfeuutCIrTvrPb17kgvLauhwqU57mG/YuaAS+1u9hzSjCpwmRNItZthPGhH3d5XLZWi0HkCmBO+eo+suy56f1lMD2wp18UGkAFL2Kk0Jk100VwaGjhDT5LavWO3R1m3SVjUwAgBmydxUv7nTcZKTEkWY4808fHqKIEEW8P+ZXvU0JderFY/oitoxRv3x/A5g90UZXjJ9uR0Rt+rX/S7fmZ8e+GlWLn1fpWPjR+pDn418z85dFw2nX6CBYXkMBeojKdGq4hupJpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=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=h37fqiQU02ngbcc8LOrE1usF6rNCcg/OMszPMryKmkA=; b=1GgJK3/p73rf/qp7VHUAHpgFNAmZ2M/8sbaiKM42+cZzAQe4QOCkcCR7KVE6o4mqTu7CJwDJGvy2PwfBryQcu5XRh+MGtHKuuZhcUDi8Vrp2eyzf/+OJD9VQjT+MWChCaYgpPRcVh6r3TOh/5nUF0NsLXEE1xqqFNcqkTSmus+U= Received: from MW4P223CA0021.NAMP223.PROD.OUTLOOK.COM (2603:10b6:303:80::26) by MN0PR12MB5788.namprd12.prod.outlook.com (2603:10b6:208:377::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.21; Thu, 7 Jul 2022 17:01:46 +0000 Received: from CO1NAM11FT029.eop-nam11.prod.protection.outlook.com (2603:10b6:303:80:cafe::84) by MW4P223CA0021.outlook.office365.com (2603:10b6:303:80::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15 via Frontend Transport; Thu, 7 Jul 2022 17:01:45 +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 CO1NAM11FT029.mail.protection.outlook.com (10.13.174.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Thu, 7 Jul 2022 17:01:45 +0000 Received: from pyuan-desktop.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.28; Thu, 7 Jul 2022 12:01:41 -0500 From: Perry Yuan To: , , , Huang Rui , "Rafael J. Wysocki" , , CC: , , , , , , , , Perry Yuan Subject: [PATCH 12/12] cpufreq: amd_pstate: update transition delay time to 1ms Date: Thu, 7 Jul 2022 13:01:29 -0400 Message-ID: <20220707170129.217086-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 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-Office365-Filtering-Correlation-Id: 9aff593b-f47a-44bf-5da9-08da603a5fdf X-MS-TrafficTypeDiagnostic: MN0PR12MB5788:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SlukKozwZIAP9npgxyO+542O+LFGOIglgdXoR5VLADi8XlCb+rd0xZaDITJHskm1isEq1BMTBzkp6JYJzqRkos+0fYexkNQeJHJ2kHKE8pETFXMlkeCjlu4rkh8LY170HLTpOXG1nFLyrdi++tqIjqdAaAZyineOMGqjWjeFXRilFJ+D4cn9aoWdpkk60V0eMGDCe76K6afoDi6UwXyT77utaBN5C+VC2crxE+CLMp1ExAr/O5EScbXDmhpZWvmifMl3UiArm3X8yq+i3OBUE+Lpxn7GzZUV9kpZ9nI7cfsZqANFFQVl0EPVYQstEFwltk6kOWp/qzPAOhHCwhRvQ1fANfKa7Srx13s/oFkNiKO8nEjYGKu6x1sanoYoP2tZHIVy+4nFnZAm44eBygpBWVYN2l+bini6EPXTeYnyZqD3Z6xepzKVXYLntMKinRCuBr7Nbxvg2qRpX6DpoQ57cRxP1hdYg7Qwy5nW21irDLmp3zXTCAvAu06R4XnMnhzfxuewSC5dBKsCqfy8qS0CdNSPbAMCK/m4xmjedtwTMcRUyKkj/2Py31yBMGSFZqnT/AifFrJQPqzqi5Wz2YsOW3kgPzekReGGuhCVp+Jlw2LlVys4eMZdfsWWSt/bFc4iznOJHZnIZX/OsDQBl6yK6r9reGc57bC28dxOWWOyimWoUBRaEAmd0R2QgzlsMGUwOvEbiYOfysqAXhCl3Ed9D3rPKg5MdqgcxE0dOpXr2Kw6/BGr82BmcOl8XY9PZTWRDG2b0Q08hw1H7Zo0Lagqy6aiJisB8YzfxcjozbYHXGe9k/cB87kZVwR648CMzInAba+DnS0+fReIhMtGHjC4E5lCQbID/N9VIGVlUG3O0s55GMIC4TbcpuZ0nxXBLMFU 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:(13230016)(4636009)(376002)(136003)(346002)(396003)(39860400002)(40470700004)(36840700001)(46966006)(82310400005)(316002)(36860700001)(54906003)(40460700003)(110136005)(426003)(186003)(47076005)(36756003)(26005)(83380400001)(16526019)(34020700004)(336012)(7696005)(70206006)(4744005)(5660300002)(15650500001)(2906002)(8676002)(86362001)(1076003)(478600001)(70586007)(81166007)(4326008)(6666004)(41300700001)(40480700001)(82740400003)(2616005)(356005)(8936002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2022 17:01:45.7471 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9aff593b-f47a-44bf-5da9-08da603a5fdf 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: CO1NAM11FT029.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5788 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Update transition delay time to 1ms, in the AMD CPU autonomous mode and non-autonomous mode, CPPC firmware will decide frequency at 1ms timescale based on the workload utilization. Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 6d81a9a94dde..f16ad0b108e4 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -42,7 +42,7 @@ #include "amd-pstate-trace.h" #define AMD_PSTATE_TRANSITION_LATENCY 20000 -#define AMD_PSTATE_TRANSITION_DELAY 500 +#define AMD_PSTATE_TRANSITION_DELAY 1000 /* * TODO: We need more time to fine tune processors with shared memory solution