From patchwork Tue Jul 12 15:35: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: 589980 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 6AFADC43334 for ; Tue, 12 Jul 2022 15:36:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232841AbiGLPgE (ORCPT ); Tue, 12 Jul 2022 11:36:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232795AbiGLPgD (ORCPT ); Tue, 12 Jul 2022 11:36:03 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2040.outbound.protection.outlook.com [40.107.93.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF5B22B1B0; Tue, 12 Jul 2022 08:36:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RqaT3VsTkQJC58PvM5f97JqhUxnnzlx2Pr/1q+/uJHv0KM69DbFCBl1RlNdJB4g8yTOhg6k/Xnihh5Rc0Dd2T4B4m9ncQs4E9PXBZDERyFtQQwGbvfTksJlQaCb970UxPlaAhAWLnlf61cE+P3QzKssXn7Jh4O2+X6K0o1MKQPfI8smbBvbrF+UkeHN3U9fOB3EV6rJyBtBwp/bPjsLioELlvqPEZ6nmA2q618LUPMUKBgqSJ8hEtw4SeeXthb+KBEGedKH+oTCnZrv8LhObdTMAaV0JYNtiQNizVnFcvl2nxz/oZZDWm+b4k8Q0ZRSsGFsuwXvyOUL5eTTvxDnZtg== 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=ZV0s9LmNtlAvEPGensRcgw2gaHncskjnoomOwU6j37l6AvqWuJphQk3K9EIA1J+Mnj6RePda1fXB2DP0TX7xHsLlYAJzMcuMsT62SCpW1lRMtGwYWCYHkQMn3tMIYht9DKukcp11d1f0a4Z/7AviRY1kiOmh6e37MawogXVKbx3ItMuAmbFoKCmo3bpfUT4SHCed5W2IMDeTVuEbUVo951Xjj1c45lFvqISlIfTfydJxj7Tut7sRliDtnAnw5OJzKsG7chcScXo8NxncE9AI1Kip52RIAhf2etXFkMM6VNz5GG/SQg00ttzMM5uyd2yOBvX3eMsGjtE8NN6nwEFSrg== 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=TTpFkWnm0sB218RgGLkywGOf901U568LXOvA1CItUzp9qjPZsb2QcoXngo0mvq7tAIgk8x7b8VAKE+iO/PE/7JB/HO7Zw0zFSDHDZ9z6pxzp28cclP/dW4Nw99HGLyELZjdGTnBTJt23QJKsxfBjs6cw39c3H3V4/mfv5BUiytk= Received: from DM5PR07CA0096.namprd07.prod.outlook.com (2603:10b6:4:ae::25) by DM6PR12MB4943.namprd12.prod.outlook.com (2603:10b6:5:1bc::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16; Tue, 12 Jul 2022 15:36:00 +0000 Received: from DM6NAM11FT061.eop-nam11.prod.protection.outlook.com (2603:10b6:4:ae:cafe::ef) by DM5PR07CA0096.outlook.office365.com (2603:10b6:4:ae::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.20 via Frontend Transport; Tue, 12 Jul 2022 15:36:00 +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 DM6NAM11FT061.mail.protection.outlook.com (10.13.173.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Tue, 12 Jul 2022 15:36:00 +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; Tue, 12 Jul 2022 10:35:53 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , , "H. Peter Anvin" , Peter Zijlstra , Adrian Hunter , Pawan Gupta , Alexander Shishkin , Sumeet Pawnikar , Huang Rui , Tony Luck , Ricardo Neri Subject: [PATCH v3 01/13] x86/msr: Add the MSR definition for AMD CPPC hardware control. Date: Tue, 12 Jul 2022 11:35:36 -0400 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: 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: 9c19a7a8-4ee3-4ea7-7100-08da641c393c X-MS-TrafficTypeDiagnostic: DM6PR12MB4943:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tJDfLZScNCP9PEsVD3pSS/QPqSGcNRcvtN8TkXpcPW+5xDAnEyEUrsO4Sf+J026Xvliy7JuDX02n5HHQkCTEnCLZXHQ/zcIbVzQnmwXp3LzWLkBw56/EZrU55n5ZpIT2Xh9AetcXYTH+Xee1funXN5cjbgQ+fm6HkqIwYWChXPt/JOkeD+2aAS7M1LyJXhtPclHuxXYZID3on1RU7JoMQJNdYldpjlHX2D77NmNQ/mM8bmGcaFXsckAKcdrDLbztCw+lCHhr66jyxy4OPsSxO/3fLWX9mvi07N+NjmPr8wOLlqafdFx3W8VQfN/3VAtS1xO1x1c7e7KKGqPYXKh1ULnZD6u6cdR1faG4yscnvhghH9Vz5JeRb36G4VXqQRPOKNmOyXnn218JkTfIxYcdDsAOdeApWyT+9So1dg7Lpx3pe1Y8UFsTwwfbsaQ+2heXLrQ95SZWdB2KTtNuIM2oRI1niq3/KIdmCFATVtPKpgLMDDtTN9vinrQU/NvGEIv8MV08EM2kmCote2OsSnLGaZ3ykYhcu0U+D7J7z25dsnpNJSJRNOT/jbs5eG9y7gpp5IljRk3NogIlut1sqwxNz/34leZLlodH7+9G9c+hAyeH2KLzrXe8dfUpYTTg6GBJhbEC3d2UjrKD+yGSytIc53XeiPyO5gIWFkIYNSnIr2JRr9+imk/MOkwHblUyrc5AKFzDll8IUE+j6qEONiY/tUPhAwFMU/jvxzncCT1ZzivZIBe2GRi/H9I1UH+GTvkmybkUSn3pXwn9F0zpKYszQrwdyBfUoXrFbqp3iZLu32cMLfGvasZjKxuh7em+QjTI8Am3Bj452HktKd/UrBgtrx004uG34preEYRWw2/t6D2Kh3E6wwclTLXGbCoqyJw7b8QYLEXqAhVSdN826/aUQwsHYoHZ+BqzDXT3b+8jZ6M= 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)(46966006)(36840700001)(356005)(81166007)(40460700003)(40480700001)(6636002)(2616005)(186003)(47076005)(316002)(54906003)(336012)(82310400005)(2906002)(36756003)(110136005)(82740400003)(5660300002)(426003)(4744005)(4326008)(41300700001)(6666004)(26005)(16526019)(8936002)(86362001)(966005)(8676002)(478600001)(70586007)(70206006)(7696005)(36860700001)(7416002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2022 15:36:00.6908 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c19a7a8-4ee3-4ea7-7100-08da641c393c 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: DM6NAM11FT061.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4943 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 Tue Jul 12 15:39: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: 590227 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 7D086C43334 for ; Tue, 12 Jul 2022 15:40:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234185AbiGLPkI (ORCPT ); Tue, 12 Jul 2022 11:40:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234169AbiGLPkA (ORCPT ); Tue, 12 Jul 2022 11:40:00 -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 23DFDB96A2; Tue, 12 Jul 2022 08:39:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ejplbJfY0+t8ySaHn6vSj2LYBct6TPb7e3sD1Uze2+dNIjvskxAbPR9SpYR4wV52POh5o1r0jG6j84PDx2kKBHNBrWkemW9ARaVEvHBlz+pm9WS0n/rdFKL+Fl2VBnI3DhDSi6DqaW7RSouebqaMseuXttbL1qmiOqxt3ICyIbt3pQFLEUUbv90p8wOInADVH/SQrGPkS4+AKo0O3Shg9oZn+z3gGZIyf6Vtje/d9kxg3dx9d9/A3lvGcHUvZipRuj24IhOe0Ooep1qGSs9puMAFX6kLYGLXHgk3fJzxlg821MlbBzxSCKpJT1VnEFa6p+tqdBxl1wdayMwWcg3qlg== 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=hQQLKh5Ap5pNQr1vaMKza0o7ePaUSl2Mg51mfr3EIk71kg0VyxHey/meYCm/+KLYvGANlrviB7i6AEtp+RS6goYcAhkgVBy+/wctGxOa8J3uW0T5Ksndigg4sQLxLNH26USVYsVrrNRDWRXK4iTJNk9SISL9yAuCFW+BJBHN9O5VBytDwJGAoNnDKitvMlglFfTnaX+j0MhjtCqSD1XSIE64XhCK2MO0hNqamx7an6RiLwRv6hsFG8Kl95ip0FuR3SGb7XXeMhotTJ7XCAzIDA0XJVcKKvjLlIc9qn5QUPvde4Y/aVhNUdmncubs2thwLsamE1Y+YqkhBW4QuuhUQQ== 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=EZJ2Nex0huUtTw1UgKK/QoM0uRLrkJBAVkjLI3Ya53kDzKhNEGHFQIUHC8Nb3vqsQEUis722CY0OdHMqeFZvxCdYI83bDc/4rB2V+qc65IhfgAW2ceznqc0P5zg5wffujlQF5tgwjcxrd4ZvXOK+DFfBqV9JEK0dKa+I/ztp0LA= Received: from BN9PR03CA0805.namprd03.prod.outlook.com (2603:10b6:408:13f::30) by IA1PR12MB6091.namprd12.prod.outlook.com (2603:10b6:208:3ed::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.26; Tue, 12 Jul 2022 15:39:55 +0000 Received: from BN8NAM11FT019.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13f:cafe::89) by BN9PR03CA0805.outlook.office365.com (2603:10b6:408:13f::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Tue, 12 Jul 2022 15:39:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT019.mail.protection.outlook.com (10.13.176.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Tue, 12 Jul 2022 15:39:55 +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; Tue, 12 Jul 2022 10:39:47 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , , "H. Peter Anvin" , Huang Rui , "Rafael J. Wysocki" , Peter Zijlstra , Adrian Hunter , Pawan Gupta , "Chang S. Bae" , Alexander Shishkin , Sumeet Pawnikar , Stephane Eranian , "Tony Luck" , Ricardo Neri Subject: [PATCH v3 02/13] cpufreq: amd-pstate: enable AMD Precision Boost mode switch Date: Tue, 12 Jul 2022 11:39:36 -0400 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: 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: 8628ba67-8f39-4134-e038-08da641cc4f0 X-MS-TrafficTypeDiagnostic: IA1PR12MB6091:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QmdInD08Nw4BCoHORIscfJVnXbE2l7QE57iWQ98kVO7slYlYgXxRWgfeFSbK/tcsAqzmyzAp+IYYecmV64+GvVBFI3j2WEQymJGnihlvyLydWKAavLhXdloevYiSur0hORgALD+I1hedH6wJv91TM7hrv1kAaX72cNo4MOM5hqFMDdWuGrIHu5Fav8r4KeHnNcgIaYRj0Fe2j62uJMoepexyLAlFkypHSNWEJwGtjap+Aq46hPphdMoaPEU4OgntbUZZ25W7bQrBQK+k8GlzoUNAHsPJvBvw6Oe0hKqMTvEVmLxw/uEP0Gud4PQaOcsP0GUTjg8fX3Z9D2EwNW9sM3I9c6TJKZ9ewz0gbgDAsQthHzbu/KEZQA4nZ//GA1GftJ9sSYdVL1twxTmuFDVjC0XhkkyJOVZ/JTWOSlzFYy1EEW0u+N0OGGIOEAssm4PLzEij4zj9C1IvpILLAwCHJAgTdeXUo6JGwuOFImjfUHc0rqhNuLwvR6AUAAejPIJcOuGFm7+wATMABh7cNxaXedLWW/Xrwybm/Qs3u8Pwsqe7aQuM+K09aRE0YDRN66dpjreK+tNEOd8J6Zb/6FKXVp2J9P9i24hVB6L0S52JZFEGButOHuBFL2AG3MYyM7StmgLAiauJVVtmLoXILkebVCKWP3FRyfSTRp3V/O+fKt1zyLbmw9QYJj7UfqZ880i1AI3AZYICh8Odv3dIVEvO06ecAKMJOKoAyQobTGk9W+mZnP44nMromORUOQq5y171XvVG4cVzlS4Px8HJ9c4Ce0JDCef+w69x+PHsfvYmB8kT3JBlw4pIGD+AI16b5Hlx6xsiJ1Ygf9XbSxXXZB7MeLzeuTnyQh64AmeURFnq8m8= 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)(346002)(39860400002)(136003)(396003)(36840700001)(40470700004)(46966006)(7416002)(83380400001)(356005)(8936002)(5660300002)(2906002)(40480700001)(82740400003)(36860700001)(40460700003)(82310400005)(6636002)(426003)(47076005)(81166007)(86362001)(8676002)(478600001)(110136005)(70206006)(54906003)(186003)(316002)(41300700001)(6666004)(4326008)(26005)(2616005)(336012)(36756003)(7696005)(16526019)(70586007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2022 15:39:55.1547 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8628ba67-8f39-4134-e038-08da641cc4f0 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: BN8NAM11FT019.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6091 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 Tue Jul 12 15:40:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 589979 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 513F1C43334 for ; Tue, 12 Jul 2022 15:40:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234179AbiGLPkV (ORCPT ); Tue, 12 Jul 2022 11:40:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233932AbiGLPkT (ORCPT ); Tue, 12 Jul 2022 11:40:19 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2050.outbound.protection.outlook.com [40.107.243.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9025EB9686; Tue, 12 Jul 2022 08:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q4ayTy5lXIHmhbzVrEcQ+/LVGkVz1H7G735y1B+gfUl6dtnIQ3pP2P5Oz/wZEFnyojfpiORADtar8FKopzQ4fbNRV9hMKqxKuIFgQJDlnCnlf6PdCY8uqtufJK8ozWf5zkoBU1IiALJatNajwy9keRL+aOb9kIFZeLDNA42fyOQ6hvpBYLT9NI2cPJDDiifWgDlD+qjMh+Ulznkj62/nV8zRKihQ40xE9ywCxmLbPqeDO9Wvz/kkMpjzqUKzRb9Dy2nGolWA8GvrKmNKLBq8q5uLnnqXl6veyDRtsEHizAUtCLin5i7mz5LJ0WfBn8cJXuWLUr1huVM4YzwMFOjOJw== 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=gPzcJROc2SSbTgFa4xWh9p2FBc9GJGwwpvfdHcLThGFk1aUlxkCQA4KlY+SkA/Aayi4s5Q8nCb5eRKHMdQopvIIhG+3Cw8L5JRCywBzik7/73JzfZtamHgTPibhyI4SWv5cbzF1JGJEzUlrPrynkmZHpsCguBXN5Wsci50HeE2SxFdKEhn7/SOWDLUO1s4dADOf0xAdsHMvC5eVgbEEDHv5pWFEebhO7/W/bA5BdWsnotk5qSchXmtnhjuZkI364BFn2QVME+o3NKQPvMnQbnmL8lmcd3VCyITZhZDJ/Iifi6rXkt7bm6Kv4TEQ86Y7Pcu4+3XSWgwMyAzaoVJpqUw== 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=YKV4lyfTFrL2CIeauUCxfj/KNUf7+ikRhn9ywsxDLP3YkTKxGYPZikj7jj+XGvRnMfuwfIGtsAxRSk/hftLNXL26AhdANQRHYwzUjzALCsdx9HkMxEQJ/yXPNcB+CDcShqtdcxq0UdKO55v+Na1SHpNDdNvm0z+gxyY1ViHhIX4= Received: from BN8PR07CA0026.namprd07.prod.outlook.com (2603:10b6:408:ac::39) by MWHPR1201MB0191.namprd12.prod.outlook.com (2603:10b6:301:56::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.25; Tue, 12 Jul 2022 15:40:16 +0000 Received: from BN8NAM11FT009.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ac:cafe::8d) by BN8PR07CA0026.outlook.office365.com (2603:10b6:408:ac::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.25 via Frontend Transport; Tue, 12 Jul 2022 15:40:15 +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; Tue, 12 Jul 2022 15:40:15 +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; Tue, 12 Jul 2022 10:40:10 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan , Huang Rui , "Rafael J. Wysocki" Subject: [PATCH v3 03/13] cpufreq: amd-pstate: cleanup the unused and duplicated headers declaration Date: Tue, 12 Jul 2022 11:40:00 -0400 Message-ID: <064c323b016dd0cb369d3f2d1301b218abb2b6e7.1657638462.git.Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: 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: 13de8244-9d9c-4f09-ea58-08da641cd0dd X-MS-TrafficTypeDiagnostic: MWHPR1201MB0191:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: omrWxJhVOdwdVGpoRUcCOX3XXqt0YOtAMg5ZZ0/j5kX5hpj3D2hzn5cWi3DgXWfMklUrv1TEY9nPkJZnLAAnua9eiLttjY3jeoZjgA5S0KtAP4pO/EiRfOuLpnbJEPRfOcRJj4kIdALnsK07NS2db7oqorz+PVwNYs+Pt+2V/qRmTyFxQ9ZJw9hib7sgavE4LzNlg/DayDmwvYBTP4WWMjUEvO/qzrviGnSKafvP/bRuyX242SNeXFfU03dxTJHhX3M40/oVo2/Y08oCejr5/kETK7/U4bJEBLl71BxhQXUgiv53hdFib+GFHiOFNVthKgQtTDJ52TvVFO+spuOXbKrwA5ZGjdMbbQ/ycntokdYkE4DlWv6m67JUm+GsZv4V9yZKgHGQlHnNmcVnXoDcal1AJm/bVXvUtuPjsrO4YVptrIFQ1aaiAEPu+NS+WoPmT0gSzjLh6MbKh6TH3XHspcVQCaifLk+exdlgpvw3+gKod/uKl5UTZJbC7VfTkp3Y8AM8fvlDKz0PRTLIEJ9obMcCQt8pWVL/KsbxiXzFH6Hjelluf7lzq1YE6BdV31wYNyGjgpdpuNqwPurzTxK0ewG663qj3M7IW//MKXRZSgeVohqPNcJcsQL0Jjcihl+tkdX/thNWGj1mANlusEiwvoKhnAfKqkZ7B71EArg6Ph4U9xhRzXM9Qq/fsfFOPDZ3aXFulRjGWMJiTeTHsGZsi8DvccLmaoTP2dPs9Znh16wdKNQuIQk6wGvwaoIGVLYXscj8BIKdwnVZzKOuvFqgQe9CyBRa2Vinv+lK7FaJEl0B6hSBAGAhEt1sPBQ+QH3BQ3IEc2ZeBttXdpb73vMRu4t9ZuayH/TNC5lvDuY+tlc= 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)(136003)(376002)(39860400002)(40470700004)(36840700001)(46966006)(316002)(8936002)(36860700001)(8676002)(4744005)(54906003)(40480700001)(83380400001)(5660300002)(36756003)(478600001)(110136005)(2906002)(6666004)(356005)(336012)(82740400003)(41300700001)(426003)(81166007)(47076005)(70586007)(70206006)(86362001)(2616005)(16526019)(6636002)(4326008)(186003)(40460700003)(26005)(7696005)(82310400005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2022 15:40:15.1787 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 13de8244-9d9c-4f09-ea58-08da641cd0dd 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: MWHPR1201MB0191 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 Acked-by: Viresh Kumar --- 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 Tue Jul 12 15:40:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 590226 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 B38C7C433EF for ; Tue, 12 Jul 2022 15:40:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233872AbiGLPkr (ORCPT ); Tue, 12 Jul 2022 11:40:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234202AbiGLPkm (ORCPT ); Tue, 12 Jul 2022 11:40:42 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2089.outbound.protection.outlook.com [40.107.243.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44730C2598; Tue, 12 Jul 2022 08:40:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YwuDVvGbUs4PTTUHOADy+KvAvkkGuShSob/7KReIC/gPkrJhZ0zUzWftkk7zbu/K1SuI2g2IJkSyK1J8FzTLjkTEJPd4l3UaJvaGdA/hnryKAD/UbaHrTE/BQhCLQ2BlV1emPTKZu7nmwlped9JSDJ229oIsn0HvdtDQLlacez9HnITj62L1RZ6+p0u4x8kr/DuLFEJPeF9AaWu4IodS5n7NtXuEkkX1BP7QaYAj2ywi+W60E44E42n2aA9h97V15XjYRsRmyjG0OiGQ7oFs9j6GrvNZeTkVSypc4KBJGuB8AdDgRwjlNTTC4ChXrWqAmojkBRvAP+pGk3YJi795Nw== 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=WQt/QJBKgP3U557qGxEvWCKlEeGDSPYdotrJNmPJDmXf6PYRgPOVpDHYclwxQuyoa9MJYPxTQxB1egEm4rZYDzxj3n3ZIbNDfpDCBu8KtklYst+xkYvfdq+rEBrPs7SyuS6WEhPMX6yfut4csubT4hBgyLIazeipiVzriI+iMwlnu/bSlG5D6e1LJsijmg0itBRnAna2aMtVdSQBvCTG+Ipb1aKpUA2PQAbp8Mi7AHwYGi1mR3s/1UHvdVgjrkdyvTAw2lvCCgffN10Mjvql071O2S1cJjMAmow0ws+b/++meJfwM0C0XsVXBi6TumoNLeywVv6BD8+4NfQ6oFo1mg== 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=i15/wOm6pDFopIXTxmQjNdODrXQMUvARi9EWzBgj7b/eoxyh43YXEnxGbM6iMxTDPKq5mGZakkNfoVhWvFVCSd1Um57gIHrmewsJd9CV04PGNRUfxUxOOy2t1w8niQ3geGqdFS7pp2JNeK/+ISsck5m8dhd9R47m95ENHn2gQgk= Received: from BN0PR04CA0139.namprd04.prod.outlook.com (2603:10b6:408:ed::24) by DM4PR12MB5311.namprd12.prod.outlook.com (2603:10b6:5:39f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15; Tue, 12 Jul 2022 15:40:35 +0000 Received: from BN8NAM11FT032.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ed:cafe::ed) by BN0PR04CA0139.outlook.office365.com (2603:10b6:408:ed::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.17 via Frontend Transport; Tue, 12 Jul 2022 15:40:35 +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 BN8NAM11FT032.mail.protection.outlook.com (10.13.177.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Tue, 12 Jul 2022 15:40:35 +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; Tue, 12 Jul 2022 10:40:31 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan , Huang Rui , "Rafael J. Wysocki" Subject: [PATCH v3 04/13] cpufreq: amd-pstate: prefetch cppc_req_cached value in amd_pstate_cpu_init() Date: Tue, 12 Jul 2022 11:40:20 -0400 Message-ID: <001d002ba93580763421c712247bf8d9faa67756.1657638462.git.Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: 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: 50420444-b693-46b8-d4e6-08da641cdce5 X-MS-TrafficTypeDiagnostic: DM4PR12MB5311:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GurQ8JENrrPHwlVqf6+2P0ibc4sUFeiIgrhSaw64SRLRrChmqRqm1b47KF7tgBUR9Ts9oJO8dTzvmICN2SkqLBc/XAYBvE69L7t/1WOsHuD9dXmlAvXV3e3ModkhirPdwQv7aE4zezPWJ6dyc8VIsHjrpGbtfxIIuhO/RJPCtjhMaorx4bNTCyVvKjU2rebG21zm+ysOg+jKV99gzh0gJJ6EloksYqxPJK3iHq892t10toyNt5Gy2sZd0jyPjf/qrL9pFrsOYS2l1XaubzTyRtINWA0+kMykTI0CMnq4lB5NeCJWEe2NIozezmifqmhqep7kyIYwXq2a4K8FyvTBCDecz+50NF8FAJRCh0WKFnx4QuQMCYnV2ud2aDpX5rNDrtwUj7NG7jZdF1FbohgsegqgTgOr+iOb1AiwxeAt4iG9jhnnUJY1m80HR6T3p1oWfk/Ob0uKHDc9oWolWgCFqHwxZnWNq0K6TISuQHz+tlu/Au9Dmpoo+Lv+6gY5ccbsVj6w5y+7rLcpbAg3YiA81IqxPWtWVYf18he/jHZWE+C7z5pkJrrMv6EAXXzBL2mJirlDXSivfNfDqwUBbvlUlVzdUhbhQl4PZitVTYT4AA5Nx92LousfLy8JaMiVF+IAUcrYYX2MELIcDY945lscCn+G7KWZb1BlQrC8Dl6bSN5iczGk+kzQYAbEIdeWsU50r2N0rOK6uwrNYVsulpURlKBixXI4zCjC/y0okWXvK7/MjX9RVq5JqsPc42huhhehOw7KQOWPjm6h0VdkDihRJHk7U/X6ABAZZn1/AvxpybuajGgcE7W8qD/xK7I1fSdniABm7qJXAk/e0baDJ9pTJHcbZ54nRrg7ozHhZvGEafo= 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)(376002)(39860400002)(396003)(136003)(46966006)(36840700001)(40470700004)(478600001)(36860700001)(40460700003)(6666004)(2906002)(70206006)(83380400001)(4326008)(316002)(36756003)(5660300002)(54906003)(82310400005)(6636002)(110136005)(8676002)(8936002)(41300700001)(7696005)(70586007)(2616005)(47076005)(336012)(186003)(26005)(426003)(16526019)(356005)(40480700001)(82740400003)(81166007)(86362001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2022 15:40:35.3476 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 50420444-b693-46b8-d4e6-08da641cdce5 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: BN8NAM11FT032.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5311 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 Tue Jul 12 15:40:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 589978 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 727A8C43334 for ; Tue, 12 Jul 2022 15:41:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233150AbiGLPlB (ORCPT ); Tue, 12 Jul 2022 11:41:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233100AbiGLPlA (ORCPT ); Tue, 12 Jul 2022 11:41:00 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2063.outbound.protection.outlook.com [40.107.102.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C05C5C1FFE; Tue, 12 Jul 2022 08:40:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=StsOpU4VV7EoSFREp2yl98WKgwY3KUuncQWh+ce5vdesZDvYnONz2kaeaeMWoUSbXz9exL4FwluJfB6qcjw2Qa5FLEzPAuBNE/8K5elzUPaWAj7+5WopoXjN2iu9fWFq1+tb/s899/p2l0I1uR9qrUUrMXtHPWgPNtlXlBcdtLF7TSANTjC1znlCxoxjqJmtUa3jHXLzPW+scsWr7I777tBGQtpkoLDpKkjbjtwqwPqA5j9+Q0k601TBIcOqkDpj7eDLst3RMjJgjVleLzSnfV1OMbnNY5wmyf60LNRPJCScsq9qpVzDBsrv+B4ZhweJdNZ5Dclu3bOCc/a/Pp6YtA== 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=cA3XpaLowLNCZtn8sxMcz59E92K1Xfolw2upG7vKVhgVnmwvfoPHDTxXottI2NCRDpknbNFaP53/sJy3JuZrobOsCZ+oxnt9CV+/tWeWvJ1ystKN/dKMIWLwoHpYZP8E4jtiamXFqvt61y3aGGB/yHhZr1SZNoFFYWynRuGoUDiRPYUMZSu50MT5wbB3oXqJvMKMLHurXBRDAhmixD+Cw0Clh9UvoN0DWJApcsjktdRlREPX2teHjkTTdRm1AvWdl4u12Rva4byMIu3dLgjC6zqrxfwSKgSGYDX6jhqrAEMUNU7P1zZ2/u3CZbe6tDTYyLV6CFksPOsnfstYqExNWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=temperror 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=FDuodwrM9qgt+QSWAHs6bAoUl3xIJtEY51uQY/Ru0qDBXRMJkQ6B9I4PgRMUeg6sZ7PxLR9vWks4CRfWfWOD9QaNLW6266vqs+pjlBxDAVCDkTY84UZf/Qh4EIBZQST4OFHvJ4+83UfxZGWj61SPsHfy/b3FR8JsW3vqwfTxdt4= Received: from BN9PR03CA0373.namprd03.prod.outlook.com (2603:10b6:408:f7::18) by DM6PR12MB4941.namprd12.prod.outlook.com (2603:10b6:5:1b8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15; Tue, 12 Jul 2022 15:40:58 +0000 Received: from BN8NAM11FT012.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f7:cafe::67) by BN9PR03CA0373.outlook.office365.com (2603:10b6:408:f7::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.20 via Frontend Transport; Tue, 12 Jul 2022 15:40:57 +0000 X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=temperror action=none header.from=amd.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of amd.com: DNS Timeout) Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT012.mail.protection.outlook.com (10.13.177.55) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Tue, 12 Jul 2022 15:40:55 +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; Tue, 12 Jul 2022 10:40:51 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan , Huang Rui , "Rafael J. Wysocki" Subject: [PATCH v3 05/13] cpufreq: amd-pstate: simplify cpudata pointer assignment Date: Tue, 12 Jul 2022 11:40:42 -0400 Message-ID: <34465aace57a9ace28f9fb2c4599bcc8cdae8286.1657638462.git.Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: 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: 27114530-e500-492c-9a9c-08da641ce931 X-MS-TrafficTypeDiagnostic: DM6PR12MB4941:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aUfr4o6ycfmu3mpO0VnUSXi/lAo45aPB1pS5cFqigAQsElYOsaAiwVL/jTZ2MxekGK/BtKUwC2XcugzM4sLtFgpxEpThpkMAVEch3Wqr8hN42yK/o+l7DzoDibim5MntefjDztuf4B3wvhbrd2Bd/exQN+APyU7s5H/hGTGIKeZ5SIfIPzwFXfawMPzC0+FODt/VMEtyqbi30bJPFUj+vcGwTw04yL40k9kepTC9Bz8xKmd5En2K2Is0EeDbGmUNRkLLVPeK4f2vAtjJ1vPlY+U+qi9Xe19bcHAS021tKROj6j92aIE5Xy5eLqFrBl7ZMBtyt87J5BxdW66eqkz9hn+eB205nuch8Sdr//U6ODEZQ79YpHWACTwzsg9EfVUt2VrY867IG6RGTcKBhz17ZTNvnIgRpEl9vVLVq4Qq+JEvhOMlqvcYN3iNTQgL/uOZhdNVEmwdF+9hAli2B1Q5eb4JuKSkM2vwvkyAj8qP06QaTlYIGKyiguUyisDu4p/KiJEzWI3izBIq4TmQIR3r6N9xE2PO1AFnnYZpwdK26bryWmREAZt5/lryDcDf4BWtG7GzR4Zw+oJBozo3HNB/UPQntMUJdxto1mFcPfQR+JijXDgx0+c5znrF4d3ZUTCDKKdZ16Ui0PqH00UngNYNayxkIKyoAfeQFAOYIUNuB8By3HJYR/sr0+zaIgOQ+tVQOh+jjPVLRJfGn/ysW5q+W2WwC0D6rk8XMy5bTSh4468A6/ypkYPlpef+VjuYF78w9gkkQyFcwZZlpo5vE3UblONMz+1h60FMGYKprO/hWcCQmRiaUwai9MfcEsELtJ522iDQaH+r7d//nT/szl2ir835u9UZC03PFw2GVcz9t6s= 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)(396003)(136003)(376002)(346002)(40470700004)(46966006)(36840700001)(70586007)(4326008)(8676002)(26005)(478600001)(70206006)(5660300002)(16526019)(41300700001)(2616005)(6666004)(7696005)(110136005)(316002)(81166007)(8936002)(6636002)(54906003)(86362001)(82740400003)(336012)(356005)(426003)(40460700003)(83380400001)(2906002)(40480700001)(186003)(36860700001)(47076005)(63370400001)(63350400001)(82310400005)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2022 15:40:55.9925 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 27114530-e500-492c-9a9c-08da641ce931 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: BN8NAM11FT012.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4941 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 Acked-by: Viresh Kumar --- 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 Tue Jul 12 15:41:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 590225 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 5CB5CC43334 for ; Tue, 12 Jul 2022 15:41:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233100AbiGLPlV (ORCPT ); Tue, 12 Jul 2022 11:41:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232585AbiGLPlS (ORCPT ); Tue, 12 Jul 2022 11:41:18 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2073.outbound.protection.outlook.com [40.107.223.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 739B7B96B6; Tue, 12 Jul 2022 08:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RDqctxKS1ST7vDKw5SR9nazLzv1+fsx2Tn4ViaVhf15KZMi4mlRNsheUsalWT5PbUGyzF7XoSVcmHF9muBMjlChzR5/zVFN2qMSQF2/zHvEiwIFaGj2p14wS95iWi3vP6pRgBuzim3hAKmnTeEBQ92UdYAV7J9qJ1ApIDBoc/69HISz3DSFqjw3Z25yMF06WO5DZpiamcOGlA2iwacwlOWObbGYk8KlMijlHZ+ywuxigxaKTBY/MGbniNlfQHp8AkWpG10kSrkDw3L0y6CgEopkED72l/a5bX3nJVrZTINUw626s3cIBwk5ptxMhdw1nfgw8lAK4Cx2KeCoHn79A7Q== 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=eGuYnYWvmQQqCRhbzjmu89RoP65nO9qnSl/eHY7VoEYROrTJblB7Koj/38EE8SveNQA255SmfXDiUV8Y8IT2Jzng2vFHSPE5nqoflXiL7ArKIUp8H3p5yb6kZiohPfrgAMTxVOIc0r03Rk6Kr8i4Cok8wjfwJWsnKn49bCdbxQGughzgpY+PAjDJgDBVO/tmJW4gwFJGWAHr881Y5HRsYe900gkzc6Wuc7ygPWEJlXTcCCgm++ZZl+GqTP6hsg3o4s7qz4lwlIgxWQ3SI1Xzcu6Q5XY1qNqFjzzdgwisE7m2PSQSudgldtmxk8KOnvs02FbbsEm6pZTVlaMNHb/vdQ== 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=N+hlchB6Y1hN3m8p/ZMbokirxyIIj+JGSyadgLLTAajzP70LJweYxWThwjGy2i4oZs+5zwd7IvyCwRTV4bpR2D2yBJ8baOn2NObEUympFQTMsSYRN+hr8yffuq7ovrhduqWp0cegHmL0T2MX4Krhqj0q//ogEkzPdAd4kNA2XS8= Received: from BN9PR03CA0419.namprd03.prod.outlook.com (2603:10b6:408:111::34) by DM6PR12MB4171.namprd12.prod.outlook.com (2603:10b6:5:21f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.20; Tue, 12 Jul 2022 15:41:15 +0000 Received: from BN8NAM11FT041.eop-nam11.prod.protection.outlook.com (2603:10b6:408:111:cafe::2) by BN9PR03CA0419.outlook.office365.com (2603:10b6:408:111::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.19 via Frontend Transport; Tue, 12 Jul 2022 15:41:15 +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 BN8NAM11FT041.mail.protection.outlook.com (10.13.177.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Tue, 12 Jul 2022 15:41:15 +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; Tue, 12 Jul 2022 10:41:11 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan , Su Jinzhou , Huang Rui , "Rafael J. Wysocki" Subject: [PATCH v3 06/13] cpufreq: amd_pstate: fix wrong lowest perf fetch Date: Tue, 12 Jul 2022 11:41:02 -0400 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: 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: 3fd15309-1d75-45f9-fba3-08da641cf4f7 X-MS-TrafficTypeDiagnostic: DM6PR12MB4171:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Tceb0aFMrx2ii47jsu1Zkj++PUCWXZ8IcVoYuEWMr6nIK5ktRrWsygIsedMR31npUXGBtVGgW6z5fjyFeV1W7fuFyiHRsobHkaFH/9JFjWXbUv4ZcLrU/zebiWEDLWYCrEWxyaIXwqtBaJslwVB2JqPJ6keVgdr/PXqEEAnyzOmmmjTq9+jQwml4RqrC4WXSr4JQb8tBdNvx+HaPtZzAJng2oMU+HF3hESIa3uqMaOIDz7Dyw0K2SQi+KvUIz5s7H70Ya5G0R5nJGGbuRQn9AVoBIvqzmJiXHiShzvGE8ZZ9+wLD0FYsx6tRcJBs4TjOHZMeogth1qEgEayojrpxCI7MoY+6vpNjJx82ypW16mzZHCqKM/e2v0sQbasy3vZ5YNW/WDEmvbKx8mXf5hnQ6gUh5xgCe7hbT4tg0dEGIUt6iFZtDM0yCLYsG+HsD2CDVX6sixHg8nxcO2hKHphOU4m55Y3f8aMYJVGMlwE4Xe42C4az1w6eS8MOeLNtnz1kdoTufjU+f3qsbZ7p10FVFR1v+0BM+z8CvBSUqTOrm5B6qG7XFZ/rJUh6rVLQWyPVisMYGXD8FzkbxvLTGTG4R9D6fITGWy4t9h+wTDDRsTLdHw1/QvUcYIU4ox8fQKVu+XKSxt7qLtKB/nC7TF9s1zCDe2auZ4GPQv4BNGJmj257u2z48VbuuWMtbQxVDAG4g5Ec1LlPyBqXL+iN25OcMaJzGGctNOJmAK+a/BVKBtHCtZ5KqDKGSKBRUIYN+3ulrWeP8ILym8ld3F1/6Hh4gxRP6bn6JMT1/Cro6AV1IMYbKfiv3WW8+I4jauSEVU9m1wO6VnUicTB+N1o4UoraDbCIGngF6U8xEa4pf9Rm5Bo= 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)(376002)(39860400002)(346002)(136003)(40470700004)(36840700001)(46966006)(6666004)(16526019)(36860700001)(4744005)(186003)(54906003)(2906002)(8936002)(86362001)(36756003)(5660300002)(82310400005)(2616005)(81166007)(110136005)(40460700003)(478600001)(41300700001)(6636002)(336012)(316002)(7696005)(356005)(426003)(47076005)(70206006)(82740400003)(70586007)(83380400001)(26005)(40480700001)(8676002)(4326008)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2022 15:41:15.7475 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3fd15309-1d75-45f9-fba3-08da641cf4f7 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: BN8NAM11FT041.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4171 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 Acked-by: Viresh Kumar --- 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 Tue Jul 12 15:41: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: 589977 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 A9D71C43334 for ; Tue, 12 Jul 2022 15:41:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232585AbiGLPlj (ORCPT ); Tue, 12 Jul 2022 11:41:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233276AbiGLPlj (ORCPT ); Tue, 12 Jul 2022 11:41:39 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2069.outbound.protection.outlook.com [40.107.212.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64AC7C259D; Tue, 12 Jul 2022 08:41:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YzrTWnqwmzK3uoQrQlyu+1EfkQrnw0ANR12zU4nvH73uAB56lbLXpjpeSJpTrVdXEU1HGnddRVBe/d5RZruSJ/km7Io/1nDHhujOskkXLJ3cyynZhHU773OvAznTmjpMrzXcDQRktGgygDjsJkZmSVMcIuE/PTft1Z0iW/1GJZEb+nlxJCub/Q1XgjQ9gqQ3pXoBbDWxySNh6+TgszS3GQeo4Jbbh9gep8tbvHmOzFRnGQPkl4aRaxNVa39Zfi1ZHE5AyS6A5AvUSEi7ANIvEKooKmMVlP2sQN4btxA3aoZpIGa2fK8pJXQNM7BiNMbOppI8mo9rXg5d4nLrflO78g== 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=oqCRvjFLGerQx+cpbnO15BmME5AkfQxPNzHEeLlXMro=; b=DUxgxRypinOrnSuREqZZCstDHihzkkdFiw5VUi9H5k2LQI9mFeIqTmZ0ZzpC/hW6aeVRVT+647cZrKnT4jG8t4iGdFFoPcQAxViBo9QQr/EVpPWE9Kwz9snlIS5JTu4PANpWjAAehIIFfK/Mxs1JV7IeD3+r4F2A3rOGqgktfnSpzd5PEEgxBmSltdHEPX+HW6Wkr61cBN3EJtGF/ibS6S9Ph91QB3gakf/YXM+eJLNoFUyWFEPzslB3yiKz+jfksuTpBwGTbcXDnoyC3KQ3FHUVBW9SfSaxsxSdZPz52Vnjqm1ETzOoGTSTanIFQB8l6xjmNmD8+tGR+07/okxE0g== 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=oqCRvjFLGerQx+cpbnO15BmME5AkfQxPNzHEeLlXMro=; b=VsvVCPj1sH6HEJSfOUVdJbpD4AHw0mBvJd+GIsAki+9bDLBEwFYD1PxCy9sn1bSNggaxHdQop+dIhJ2cUN5eHDuIt8AqlS9KMCwwD/fvF2q2Fce2CwQXOmA/TfBot5g+Zp9ok4dMylbs8m5+qG3bnnTgpV+c7EcvtFjxBk9Me2U= Received: from BN7PR06CA0051.namprd06.prod.outlook.com (2603:10b6:408:34::28) by DM5PR12MB4662.namprd12.prod.outlook.com (2603:10b6:4:a6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.23; Tue, 12 Jul 2022 15:41:35 +0000 Received: from BN8NAM11FT068.eop-nam11.prod.protection.outlook.com (2603:10b6:408:34:cafe::88) by BN7PR06CA0051.outlook.office365.com (2603:10b6:408:34::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.21 via Frontend Transport; Tue, 12 Jul 2022 15:41:35 +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 BN8NAM11FT068.mail.protection.outlook.com (10.13.177.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Tue, 12 Jul 2022 15:41:35 +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; Tue, 12 Jul 2022 10:41:31 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan , Huang Rui , "Rafael J. Wysocki" Subject: [PATCH v3 07/13] cpufreq: amd_pstate: map desired perf into pstate scope for powersave governor Date: Tue, 12 Jul 2022 11:41:22 -0400 Message-ID: <1c7d09c93e1e1a3eb1282082c0ac7b3c54877777.1657638462.git.Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: 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: a9722edc-61ad-4b5e-e13a-08da641d00b5 X-MS-TrafficTypeDiagnostic: DM5PR12MB4662:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WJC1qitCUmzptrDH1cAkmr/DBs1CPXeeUrnRP0Dh6sSWMYbNYGTlszOTpRY8e/zJKK+ZaR61WMB7wYTXO0U43Sl/RpvfMsUQrQcBsp6MHVkAkFHZ/NaH9PhLPtoNh659gJ1bQcMVLEFwm5Vy6wmyqHKV0eT/C2OIir55GeVSvaG3vXMNnamIRdJX8DdxwUxXhOhyc6N21wyIy0sgLQ9vynrOwl5fKdhYJZjmD4lq1kgWNHsqYU9fcZQTkLvGSnVpjqwJegqLArvM2X3BD64U/QUToBTbJRlFX4PfENEfL6sgzeG2dvHq3T8tqahd8hpRyumqCmbqe48ph2iD+ao7iYFvNj0X1tR4tOS3GKkBV0Z3TTmupGSZ8kjJHPsepmSvUtfxtzR4CVrHx/ITT/abI7hZwbMXtle26ho5ZkkQGYuZrlX0Hjvry645JiJGqOjgxTw7jdx8IOKDK+JHoec2KGUaZ4BxTSZCFmfr/TywKmVBPCjJmiD1RWijzpvvGABKjtI26E/rN+qcfm95SRQEEpjr8+DBUJUEs4tJLqvU3KXiFcgwKmSI49zqFG8xYK0b+3r9RYBKDQSnPMCTHHPIOugijGzBdFEh2IDo2HGbpYd4dYpi2h4wy1mH1iG/DhiLj3S4u3n6JVQhUsI8hvNm1wEueDddQao6AffMb0UrRUuI97Nuk8Ej3rVPMWNA9B5y0qlDb+0EYrsqHvZEz3VBoVIi03bKJzIT9TGo/lpztZ4Z6WOrLE8NlfDSJX46TQZ5IDzgJqDL3hQNy8Fd7vRt0IqQJ/m9JcrZY8O9afA4Gep4bBW/L/Tp2MS2TpzUujBFMYLcyTKcbK/eujlM2/H4CuDT+0RYNh8aKW37AHUy05I= 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)(376002)(136003)(39860400002)(396003)(40470700004)(46966006)(36840700001)(36756003)(426003)(26005)(336012)(4326008)(47076005)(7696005)(82310400005)(70586007)(36860700001)(70206006)(41300700001)(16526019)(8676002)(186003)(6666004)(40460700003)(86362001)(40480700001)(81166007)(316002)(2616005)(356005)(83380400001)(82740400003)(6636002)(8936002)(54906003)(5660300002)(110136005)(2906002)(478600001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2022 15:41:35.4470 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a9722edc-61ad-4b5e-e13a-08da641d00b5 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: BN8NAM11FT068.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB4662 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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 7c51f4125263..f359b1b20140 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -265,6 +265,7 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf, u64 prev = READ_ONCE(cpudata->cppc_req_cached); u64 value = prev; + des_perf = clamp_t(unsigned long, des_perf, min_perf, max_perf); value &= ~AMD_CPPC_MIN_PERF(~0L); value |= AMD_CPPC_MIN_PERF(min_perf); @@ -353,8 +354,6 @@ static void amd_pstate_adjust_perf(unsigned int cpu, if (max_perf < min_perf) max_perf = min_perf; - des_perf = clamp_t(unsigned long, des_perf, min_perf, max_perf); - amd_pstate_update(cpudata, min_perf, des_perf, max_perf, true); } From patchwork Tue Jul 12 15:41:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 590224 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 98A1FC433EF for ; Tue, 12 Jul 2022 15:42:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233171AbiGLPl7 (ORCPT ); Tue, 12 Jul 2022 11:41:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbiGLPl6 (ORCPT ); Tue, 12 Jul 2022 11:41:58 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2059.outbound.protection.outlook.com [40.107.92.59]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8843EC3ADD; Tue, 12 Jul 2022 08:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nbnKmBNHxeoCg5kYijrPnugHlaJ0jbfC+eMXMem4RCFNKSUIYE2EK1bdoozkRMQ5iLt83dsW7n0y+Vk/kgkD+uQJVVIEyqbftP5AsmEviRViKyDTA8hsZrwb+ekD8abtWxq+IfDeaxWUmoT+QlpA9zSmC4iwmS21UZcbvWduPYGQ5US+CLkMOSVETjxq87R7qgfnES8k8ZTAdXGI9F48kP8XBfFrnRuKCxBpA45i5vVUfpI/4fHiE0fDLhPkDGh/2NWbyeFDcFhZV0Hb2CcTgcOdKuvuNWL3hp6UoAuZbVMryZWK09jvHIfhx1YF2Y1PpCPbdCXNVLrNsgkVsfm9RQ== 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=1uC7epzQxMMNQDjREPI+QOqlajXUTKgUxuqMAWVUNs4=; b=J9/asTxErkT6S5B2p9bAF8z/M00di0UXiWyfNXHo9xiQgY/sco0svLfpup66ZgDr+Th7AYikUY+DVXs/SdryXBJTw190jwVPQjTA5Ptx4ECvrRk18A1Vz9gcKmfRbAzv9GBDOI/Va6xGRyZehr15OYyyxKrTYqQneB67oMGlUbCdzVgsyKHnZtq9WdGFYACjlMkYqEJADYCcc+zF07AH8qzGuHMJr8YvmV2aTmM8NCm+KLKVUej+xJS8BnQq5sZcYXzOwryUQKB75iBHjbhD1jXbp+/QQOuU1Mb/ZhcfFzFZV5G4aNRgRb2qL7mNkuKikH2NKUqDugbTdg2EONzDFA== 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=1uC7epzQxMMNQDjREPI+QOqlajXUTKgUxuqMAWVUNs4=; b=YjaeFj5jPTb3BL3s142sJb5tciScSfxzUpOfFGjnLkHXKtwzpJ28JsjXcwV9hGIWdJesVvzetKpcZMXrxwPl76d4Y/ctAQ6wCYWqBKZPF9BobYZBQuUdHcjsoFUFgFr7TzHIAwkJ5a3eVUKAt/+PG9qq0Kyjv2T6VCdHc3hP0hk= Received: from BN9PR03CA0398.namprd03.prod.outlook.com (2603:10b6:408:111::13) by BL3PR12MB6404.namprd12.prod.outlook.com (2603:10b6:208:3b4::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.26; Tue, 12 Jul 2022 15:41:55 +0000 Received: from BN8NAM11FT041.eop-nam11.prod.protection.outlook.com (2603:10b6:408:111:cafe::6f) by BN9PR03CA0398.outlook.office365.com (2603:10b6:408:111::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.17 via Frontend Transport; Tue, 12 Jul 2022 15:41:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT041.mail.protection.outlook.com (10.13.177.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Tue, 12 Jul 2022 15:41:55 +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; Tue, 12 Jul 2022 10:41:50 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan , Huang Rui , "Rafael J. Wysocki" Subject: [PATCH v3 08/13] cpufreq: amd-pstate: fix white-space Date: Tue, 12 Jul 2022 11:41:41 -0400 Message-ID: <79c21c72c13a25aea0fe9b6eb3d3072c757f1017.1657638462.git.Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: 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: e8128ec6-5526-402d-1a9a-08da641d0c91 X-MS-TrafficTypeDiagnostic: BL3PR12MB6404:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 89CaceooQ4BXoS2UDhkElWnVS3zI2AvQehmaw2iUpWVA4Ioj55paOCCxXVv41ehD3SxSsbFgJIwOGQtgrvbMPXZq5wi8ey75Why7PIhi5ntaM6vCG1sTELpEG7gLhqLWehsqFLlhy8DlFYpGVfTCS+hTFgARyRgm58RK9hOgJDcTTxOvAsV8M+HUdfZeJo52G9okSvJz81de2jFwAn32IOn/Vh9cNrltFOz7t1b81IrcTZmSRTE3hBfeLI2X5ZXZusIXjNSCPH7RfbvJ2OisDy/Jo22v3qmuyMxz79yURRC2XswXQgN9AGKKtC5S2tCjXMJv4QPFIIHNUeSt/kAX0qInq8CL2TBL0JkqcNyriAsc1ejv1wqGRTfz8+f1CR+BmeofUJRFGuWn3A9ypv+CFf8/Tol4cl7ZNZNOIB1FWXBG4Rntz1iwUir73HGIYd+YUjrBfACIYgsX+0VDuqXmNxgS4tTirOVe6bTl0dGNCr76Kvd6LgLbodE+SPSLOIhBZFoBU4Gchijuj7TYE8XTb6htIvNEUT+nYvPoL4n9IGEic4oE5iUJiRiRPUPIXJE/qLgDFJiPmkw/OQnAo8LCP+NsdttceGmNZecXD5GeBc5VI/1DqyKNqubjpX5zTsT5uCPg853XeNoIHY4/7A+qHboB4fwf2DAXJ8gd0bUlVWVtnwH0SVeTWFIqa9/bCbKlLV8Tb3RTo0oA8N1Ig1EPWV6Q/nHpX0DDiibC60fEfDYZIihLhBf/KfY6KYPWzGMIvSw7xk/TNGyscb9bbNemZgD997cluHum4UxyN2q2i6q3Tq1r0cZ5yhJiYfnDVy+PfOvP418JKz7sz6EOlEBYc2X8NEBOSsBmW82x9Bocvug= 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)(136003)(376002)(39860400002)(396003)(40470700004)(46966006)(36840700001)(2906002)(5660300002)(36756003)(8936002)(86362001)(6636002)(70586007)(316002)(70206006)(4744005)(40460700003)(110136005)(40480700001)(54906003)(82310400005)(41300700001)(8676002)(2616005)(26005)(47076005)(336012)(7696005)(186003)(426003)(16526019)(6666004)(4326008)(356005)(82740400003)(36860700001)(81166007)(478600001)(83380400001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2022 15:41:55.2918 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e8128ec6-5526-402d-1a9a-08da641d0c91 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: BN8NAM11FT041.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6404 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 f359b1b20140..312ccef62f58 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; }; @@ -671,7 +671,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 Tue Jul 12 15:42:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 589976 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 847A9C43334 for ; Tue, 12 Jul 2022 15:42:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230159AbiGLPmX (ORCPT ); Tue, 12 Jul 2022 11:42:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234194AbiGLPmT (ORCPT ); Tue, 12 Jul 2022 11:42:19 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2065.outbound.protection.outlook.com [40.107.93.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6F11C445C; Tue, 12 Jul 2022 08:42:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k45ZkBwHqI0+4zA+iItgmcecYmcVVBv6hnzkpC78Jf8sJ3ULhjv7D3t3oiUvUk73cbMkKlRDXgPvGJiEuoRgGhpMdJwpgLGGSixI5qCNNyP62w8gscB3qaEL2sC7+u2RqknLUosQ74NnveZwEFwGOz+XVKyOw3u8x0bk0PuT2V6ZC3DrrlqDaks5ytQgmHArBkZCBQ2ldVvxhxKKzscODKOXJ/0n8ItLzZqIE7v9M80LQSckXo3PV9eIPuL/R0JWh0O5qJ1zNKvJO2lXmL9PsY29kPiHpCFiZIrBPjFqNojQ8YtM9ueO2heyapeFr8q1Y++MF4UagGdCt/rfUtx7hg== 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=F5yeDTWiBR+zs4cX2e30vumqoLvljIYYouopJxzrf0w=; b=XQhu+5JCa3lSc+/kD7xD02lV7rAxlH5VeNaFwDdxN+wFGbJXSYY1Z89cMV+HvZKA1vxnJ4Au4btMVfnD8QnjPggj21PfHRFkzNPgUqbJwgTOq9yzjHEsljmrRdedBW08efAkHEsSUPtcmk6USrFEdGYnk/jKG7Xmq6/KjDl0UW3e5XuudMjZcRhefgTa03IiqecV50Ozn+RmUy5glpgQZW+0ntpxAcUkPygZ3/XMyTPJMU/i/43gOaZH+oodSECz+AuPghCbzzWrPAMhxwbcV4LIX7osP2PL5jPRH7KkpFJzTv7/G97E8Lpp3pUcRQK4QE77MxttVA/YIsIi/hdxhg== 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=F5yeDTWiBR+zs4cX2e30vumqoLvljIYYouopJxzrf0w=; b=Ql7QjuPWaK3t2M6QWy4L4tinLUokNj7eYvoLeLQTuUCuW4vr33drrdeyXEsRUiToH1wOUITqyX/wXG93WnwzmNxOrtbZDg13LhEzll83u99sugcuRhkK4cJMoZSAFlUpOuPfAh2tfA+jDtVKqf0rMK322LBC19BckkX7Jl1eTEE= Received: from BN9PR03CA0705.namprd03.prod.outlook.com (2603:10b6:408:ef::20) by BY5PR12MB3828.namprd12.prod.outlook.com (2603:10b6:a03:1a4::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16; Tue, 12 Jul 2022 15:42:16 +0000 Received: from BN8NAM11FT048.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ef:cafe::aa) by BN9PR03CA0705.outlook.office365.com (2603:10b6:408:ef::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.22 via Frontend Transport; Tue, 12 Jul 2022 15:42: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 BN8NAM11FT048.mail.protection.outlook.com (10.13.177.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Tue, 12 Jul 2022 15:42:15 +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; Tue, 12 Jul 2022 10:42:11 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan , Huang Rui , "Rafael J. Wysocki" Subject: [PATCH v3 09/13] cpufreq: amd-pstate: update pstate frequency transition delay time Date: Tue, 12 Jul 2022 11:42:01 -0400 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: 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: a27175cf-fadc-4006-150d-08da641d18d6 X-MS-TrafficTypeDiagnostic: BY5PR12MB3828:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MixfPANqsn9m+uMzfyfg4L/qhbrmpnQz1ASKIOMBd735f1j3JjaJA3SeBFfGsnng+NsRMoUb1BryMo+FageCI/WGwEyGa6UBj6p06F6ZHr3LzBHYxZTBVpXrMoFPvUbF6+fexCWkx7Ety7Ik94K9/363r/N/ZNOX5FV7SoIACHFGokGypoK2ROVAAEy4F84p7NC51OCEzbyif1RaTx7IaLiBz1CTsyrp+0ik92hKjR4/N6q8Z0JZ0LP8BWdEEtaoep5OI9DEENniC/wtQsMLvXFmqo4Q23StvQ0cjPbgpBhwqctVKdlOPLZByODPAEUPI/I7NjaIT9urSOsWXNkC/yk3PeO80yRlUwt7MOzJCs7xgV04I76jOANRafJ4G1YTpCgxKkJOXWYQNZn+2SyjVlHyqDRnIIAqhe92zdJfIrxWoI29H5KgiZ3MRuzcFTO8MHdpBmjr/vqEANL5RqpAil3PuCVLnYwirIA9CTpv+eRRbm3G+GxllOR1LnIq/JuzMZk6mFXd12JW1/tI/axHqLFepEkoivZXyLVTiSzPPrFqm5lkef6ruB3QkVy7YTZtux5DOag0tg3SJmzMHdvPLMV8eOZWbY0VM/yZigC59wXzfUVQSlErI6DOLvXLHHxi2yWXarH6sdfdGW7jKIMa/n2wgTpJSAtc9JvRgAzMSkt7xQ1j/euvWXWSi73tp4wuqOtaphdu4HN8cnFCWRDWuF0wxxGeYNDFZKjrR/28NWK6jwcWXpJ/KbsEnuaMxV50MQbZwvbo6478u0sUcvYhzDcgmpzMNSNOpITNvZ8g50WbAtqR/tyCammABgB6X2Zq33TWVSTPQ99ZPRTLKn3pHO80h1bFAiFWGBIwQ7Cdwc8= 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)(136003)(39860400002)(40470700004)(46966006)(36840700001)(110136005)(54906003)(4326008)(86362001)(41300700001)(4744005)(6666004)(36756003)(8936002)(8676002)(5660300002)(7696005)(26005)(6636002)(316002)(2906002)(82310400005)(82740400003)(186003)(47076005)(426003)(336012)(16526019)(478600001)(40460700003)(81166007)(2616005)(70586007)(40480700001)(83380400001)(36860700001)(70206006)(356005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2022 15:42:15.8921 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a27175cf-fadc-4006-150d-08da641d18d6 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: BN8NAM11FT048.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB3828 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 in non-EPP driver mode. Signed-off-by: Perry Yuan Acked-by: Viresh Kumar --- 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 312ccef62f58..1e5ca4897b7e 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 Tue Jul 12 15:42:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 590223 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 F2DD9C43334 for ; Tue, 12 Jul 2022 15:42:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233824AbiGLPml (ORCPT ); Tue, 12 Jul 2022 11:42:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234145AbiGLPmk (ORCPT ); Tue, 12 Jul 2022 11:42:40 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2050.outbound.protection.outlook.com [40.107.93.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1007C3AD9; Tue, 12 Jul 2022 08:42:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F38lYpzKtCLCxaakyDrtIDP745WJ3zTNnVO2HipAwAQs8EOHAdGEheFgOxrJ40HZkt56Vw0Fox38rPBfuT+kjEmr0dMbNZcnlZ/EAho8+MDUR6h3j/uhZ460a0kPi+Km9wybDb+wvkhvVwlTaP7YjjNDIdTlOOzWzviOuFlizGDc4O3NkFp+ZrHfEVBvYhzMKwK5oy58LlfLNoFmiqzUz1gHbRixL0O05Fuv+bCDV2lF01rr3bpbEtOMw3rByxqKJVgPNOxjh/DiY7llSF/V0YUDn0rYPw0/u3l6TttGI/ffdd+JilNGehOhy6YkPo5ng7taDMSgakuRC9vJMLBxcg== 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=pQhmJVm7Yytkz/qiKiQkvmInwq2tsjDBkodmzR1O2qU=; b=Ta94yanpr11/l22DNZnBPWUFgwz/JAhlLC0tJbLbZfTGONIkU+n3BlwNUavvM/Bf0a51iNmWhgHPtFrwYvOHFuxlzr0EofVmfZHt77dUqpzPEZKzycQBTOU52AJ3fse5qxtHwKfSfw4AFdIZXvEK5UY0I1feZHId/FQA+FNWKEtngMgkZGpjCd3RJpoBrxIqV5Lip20hDHo6DOBwHV0SdvHEMudIr+spJJCcr4sMaAHJhuGCY2y+hrSbHVHUnOpoAOyHqEv+oW6JrHly5xTcq5QQpT0DJGr23ipQK7cZDCn23dVuIPYfFqzn5vUSOWgLXCJaWdLAug9Yfbxczrq8TA== 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=pQhmJVm7Yytkz/qiKiQkvmInwq2tsjDBkodmzR1O2qU=; b=B9E74WlEJ2qjLInCMeh/Krg3RhCOMvpQ+Y7QRNB7G16rlbuQnKIQ6WD1EKaHAVghvoEMYGp/7thLukOaUxRIPMpLc3yRG3qvMd8GD54zev5zufFR1KbgOorKh9LLyFleBFwgYshplsZdd4kyFyEJGFZZAuYO8gNGiObQrVWR0jM= Received: from BN0PR03CA0038.namprd03.prod.outlook.com (2603:10b6:408:e7::13) by SA1PR12MB5640.namprd12.prod.outlook.com (2603:10b6:806:238::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.21; Tue, 12 Jul 2022 15:42:37 +0000 Received: from BN8NAM11FT007.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e7:cafe::b7) by BN0PR03CA0038.outlook.office365.com (2603:10b6:408:e7::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Tue, 12 Jul 2022 15:42:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT007.mail.protection.outlook.com (10.13.177.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Tue, 12 Jul 2022 15:42:37 +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; Tue, 12 Jul 2022 10:42:32 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan , "Rafael J. Wysocki" , Len Brown , Huang Rui , Subject: [PATCH v3 10/13] cpufreq: amd-pstate: add ACPI disabled check in acpi_cpc_valid() Date: Tue, 12 Jul 2022 11:42:23 -0400 Message-ID: <42dc4270e8ad2f9a7ecfcda8ec42225182d9456b.1657638462.git.Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: 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: 8980f356-34c8-40ca-b1b8-08da641d25a9 X-MS-TrafficTypeDiagnostic: SA1PR12MB5640:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XVJc2/veOK6rm45WF2XmNZKxRXhzCzhWdG36u2J6fCy17Jhd+8xtiwNZAi2C/KCYa0FQKuztHXqHV2228Axa3I55SfpsIznzw8wom/Vy+2h3TtJ+9OZqQdUUEXlo+YdQwUDxUZrrVXiOc9uV6f6TUtf2/kvoOk77uVk9Gwv6hCOab6uX5/q0k+HqF9tl0yULXYQ5CbStTj13F6/A08cV4/2XCSgqEfWhsaj5k9KxaEh4JDjh8o3ZKfM4sZ3d1NqifTVWzZOviXDpm59UAyj2nOsCddh3CVcwv0NPTV+hcdGvg6bHTfuOktK1ee++LSjH3NIdYJ0bKAeLYlQX7rqlF7EpbYKvnrzoa6byy9blLHBbt8h4wbBu02lED0qE3nQI3RYDX7/ghShUtpQCc76WpkFndwndOsMhjogT2ohM8QV3+8YmRhzFjvIgnD937FJjnd4IXmH7vVKUEuigyIBkqXnXwBClBTFYn+5Uscp9g0BEt8wNsQZV1jrokt5vHxVkY3FmQh/CMRh8sWsIWchBX08u+3Z0f8jAn+A6Lrl8KxROhXsM2Jp82WzlQfeiHb7AeoHXXs4cC8YAuA9riwaZBv5axwTfFKBCxuP2axW8RIOIkjEZpAmW0hAjKWE5gnDrulGNxk4l5cQcw/YzcoWi67WtS3fQ7RB1kBlWEX7ArfK7Cc0rpxDiDGWYr15C5uRvCMfAI9kjvFvGFSRDHTkeKe4Jvmtw58l0Axe++bN+kO+otfilBHHFl1ZgGmTqoVuJCcW9s1mqH8CSXxp4T11nDQdU++9/oH2mkLuPMu9xrbkrLSeoPJL2kuXykno4HjSyrw4oMZMzI41CMCpAk1QS3VfuXstyuUqUuTdSoxvewE4= 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)(39860400002)(376002)(346002)(136003)(40470700004)(46966006)(36840700001)(36860700001)(2616005)(81166007)(86362001)(26005)(47076005)(5660300002)(83380400001)(82740400003)(36756003)(426003)(356005)(70206006)(40480700001)(6666004)(16526019)(316002)(7696005)(336012)(6636002)(2906002)(70586007)(8936002)(41300700001)(54906003)(8676002)(478600001)(82310400005)(110136005)(40460700003)(4326008)(186003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2022 15:42:37.4272 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8980f356-34c8-40ca-b1b8-08da641d25a9 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT007.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB5640 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 or ACPI is invalid, warning log will be needed to tell user that AMD pstate driver failed to load and 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 1e5ca4897b7e..a9918728948a 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -682,7 +682,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 Tue Jul 12 15:42:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 589975 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 20E91C433EF for ; Tue, 12 Jul 2022 15:43:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234145AbiGLPnA (ORCPT ); Tue, 12 Jul 2022 11:43:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233884AbiGLPm7 (ORCPT ); Tue, 12 Jul 2022 11:42:59 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2082.outbound.protection.outlook.com [40.107.212.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0491C3AD9; Tue, 12 Jul 2022 08:42:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LZOpFImKTGPMlftvYhGeouRbTfh7hjgrCO3wixDRL/RSqBmvQEFciv4xwEu2DaKqpLjcmOR+UkbozH1yKUwithmHYcRLp5ehI3mGsqvOxyQxWfJq15n35mdmPdAUcqShL3wQV0xoz32/Ri8GHcacyqUpip8RA0fdr+rwDhHEi0RofZ8o/jMqGsd4o3MLiSG9YX1a6kjBWdfyq4oUIKWdWTpEJxV0udYv6oN4iQJ2Wdo4Gr5B9KwgP6ziHreMiIW9rU1tt1rMH8RS9BVWb/uQxfpG7QbNZwd0+afHqvaSvKC6INpzNeA6LuX/WZ2l6GQrWjojcXQvkhaednuHrcubIg== 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=nQzY6ZjO4+NLotDe0Sqa2ADxdZIi5WF1I+zUsc2a/Bk=; b=LYoVhn8pA54RqjZZ8KJQSoloRO8wNaq6Zq6qPyx18VDkRxYWW9ykOUitJN9DqfABmZCf/PotrHefLRJ5cRsuudadIhfXa3Uyr+zHUdpsxC2DbFqHnIyXMxI95TlQT68ULaiFGhub2GScYfa507DEImsiZa+nHDOEx6V9sXbB+ziUFwsD9MLwmjWle/E7qJBw8vR2arVzrTe6y5SdNzslAQs1E0DxApJ4KZmuwWMoqPwlb+nYHFO621h9MAsBtw0KH3OuX30QtFKNf+t4PawOeAOG5TK6AQmy85hEuy70MiSSvP3E2CxJRfSnCY6bM0W4XjyBYxdwlYCH1TCyMWZHRA== 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=nQzY6ZjO4+NLotDe0Sqa2ADxdZIi5WF1I+zUsc2a/Bk=; b=Cb7/OvEnPiJixiFJQ5Z/Kf2FeShEtqrR4HS9EYpfhVQY0APShOv4fCJyqqzFsYFRoWS+enelCFbtYq4KHCjPuCcsVaV3yQ8gX7+N09X5YpauFrrbKa+5H3mdAEofxexZyrZg2LgBBDJED8aBCBUgU7/wI1mHuqzImlq1qV3GWB4= Received: from BN9PR03CA0690.namprd03.prod.outlook.com (2603:10b6:408:10e::35) by MW3PR12MB4409.namprd12.prod.outlook.com (2603:10b6:303:2d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.20; Tue, 12 Jul 2022 15:42:56 +0000 Received: from BN8NAM11FT065.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10e:cafe::c4) by BN9PR03CA0690.outlook.office365.com (2603:10b6:408:10e::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.17 via Frontend Transport; Tue, 12 Jul 2022 15:42:56 +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; Tue, 12 Jul 2022 15:42:55 +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; Tue, 12 Jul 2022 10:42:51 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan , Huang Rui , "Rafael J. Wysocki" Subject: [PATCH v3 11/13] cpufreq: amd_pstate: update transition delay time to 1ms Date: Tue, 12 Jul 2022 11:42:42 -0400 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: 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: 058b4a92-0143-4945-e773-08da641d3094 X-MS-TrafficTypeDiagnostic: MW3PR12MB4409:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UFjL2xzPP3piniY8C9B0fPuXKEQLjgDvISiacVzwAFcLivI3El9ptBFxAimF6Tqs3aTv2DtfgqMbCOJykj9YjfdN/LXczT5ItfOvciV7S063Zc0rVSxz5BMESq3xu0f3WzvJemCVa3aBQDRpVZpzsLBKDPHrd38a3jCTuHM7QE+iRNLZ4p7qjpWEHYxsQcQtvkGaZGtPb18gg9bkNB1rBFtB/W530itEwVfp9Kne2375aQoUFcGCbWNu1NwZay+Et1QahhZsBKf67CGoQ5tnyDeC3lqKQPfjC74PllNbOeiHmUCyDVJrgS3dd8M5ajFQe1lfYJAQYIJUrt9mf6igob+jNUylKL8BjjYB5NmQG62NYSr7aIwG/BRSWaCwfrrjePhXwLdVCL6YKomeoCOMXoIQZTSsk3sYWDv3Mt9dv9XmJZEUdw2vZDtNvcIXj5PU///UolVx1VqVf+6dPTA6sEsHzVFFRSkRloWcTFogqvfNGvccQq75cyyVUcH3VFnCM8XSg4mD2Rr3O4xmhH7mdj0nkGV8R1HDhZOs5KBTfj4VhgZqEA5PJmM5Rsx6bPybG3z6aWqe1hI4GLYLhlvFzRZuC8aExeNeWkX24ak0M28Ylp7Re0UXy6DFawUk0SrC7Q2HYt/9a8JLa/dB9oAgjrG209Vf3HRrQ/Odq3CJoJAgcmDLf5Uq4L3U2QDLnB1Yj8hd3roozIv8+jThy0e9NZG69TCTq+ya8IqFGhZdI2hQlnjzjz2c3bs8en2UF1YiCO9YKNiwnzwJBuJJqabHf+iHD2IhFG43yQ1xfYxPsG/3VfBlHxlRcJmFz1crcxRobxPfI0e0ljJA4vJOy3f5XxB9h58B7yb8fWf1bykY2lk= 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)(40470700004)(36840700001)(46966006)(82310400005)(36756003)(316002)(478600001)(2616005)(15650500001)(40460700003)(16526019)(26005)(186003)(6636002)(110136005)(54906003)(356005)(70586007)(4744005)(83380400001)(36860700001)(6666004)(47076005)(81166007)(4326008)(41300700001)(2906002)(426003)(8936002)(40480700001)(86362001)(5660300002)(7696005)(336012)(82740400003)(8676002)(70206006)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2022 15:42:55.7459 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 058b4a92-0143-4945-e773-08da641d3094 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: MW3PR12MB4409 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 Signed-off-by: Su Jinzhou Acked-by: Viresh Kumar --- 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 a9918728948a..83570acecc78 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 From patchwork Tue Jul 12 15:43:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 589974 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 B32FDC43334 for ; Tue, 12 Jul 2022 15:44:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233884AbiGLPoR (ORCPT ); Tue, 12 Jul 2022 11:44:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233220AbiGLPoE (ORCPT ); Tue, 12 Jul 2022 11:44:04 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2043.outbound.protection.outlook.com [40.107.94.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C009BE6BB; Tue, 12 Jul 2022 08:44:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y/6cr0k7K8gHoGMcR/z0OISqewEzUv7XpkhDXuTNoDkCxD1bLQTFOhDsOvRBCCGIrZggczGXIReMcwb/BSo8xZkoYi5o+wMzQqbxW2FPv0lW3j3wkhJm1FmtVBKKLkOZ4LhuHXkDJf6RWcv6JH2ArxgJ2PpxypoTUI49ZMIAlYbSwuCq3vPGUAvOyv2re+MYGt+fo1ZyP4le/4Bb1qH0ZtgASTRa1dW1z/lgAd496P8Kkqc39Za9SGPWilwSO6eS6vUa1Sw8pQ6EUpMgBUtULbFa0wA5O/YF1dnmem726tkOx++V22bGleAvmyKRMFXh3R3FTsldwZG27wu5no3ntw== 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=4GyzmVDCJcEPYjeURfC5aBvySzwWEqQNpnsQPQDsfQs=; b=V/X6naGc+j7oIrUShnQrufDDCZLzv//qjgHdZVSeej2asi8x360ui+PsvxUo1I296AnFx+LOeKjYv/Z9OB7N6B+Eq2KOvePkQ5XHaOpd/O9r9a3yFAlubv0yoFDBCT3eW0K35IaexU+xDHIXzOCzdoSKKh7oyDdpzs2/Xn/VmbF3ChZSnXaz276Mkh0vtYu/+r+A+887TXNJFMUerhM4Ns/hVcNiprX3id446aT7sSuRd/zHLJ1efJrysxHG4+L3xwsHg3t+lUK/3UnLOeH3VyCYPevjdoxIJ9NyEAzIwRI+cXGGfkCmU5Y7FtTK0+px1R9fd9+HAl/+vy/g2+PB9g== 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=4GyzmVDCJcEPYjeURfC5aBvySzwWEqQNpnsQPQDsfQs=; b=48tiMz5P5im2u2XK8wtTrg46nnyJEstaYm3NA+jYADhUOrM3o+kMg/EoIW38UXDoaWASuSCdnxmXbgnvbIx+/Q53foOZxv6q3TioEE/I5aXAT/sLYf10diGp8NcSke6dFvnQmzlVuPkku+221NdeU2OnyBPHSmyv3gAhea3y9I0= Received: from MW4PR04CA0300.namprd04.prod.outlook.com (2603:10b6:303:89::35) by CY4PR1201MB0103.namprd12.prod.outlook.com (2603:10b6:910:17::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.20; Tue, 12 Jul 2022 15:43:56 +0000 Received: from CO1NAM11FT045.eop-nam11.prod.protection.outlook.com (2603:10b6:303:89:cafe::e3) by MW4PR04CA0300.outlook.office365.com (2603:10b6:303:89::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16 via Frontend Transport; Tue, 12 Jul 2022 15:43:56 +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 CO1NAM11FT045.mail.protection.outlook.com (10.13.175.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Tue, 12 Jul 2022 15:43:54 +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; Tue, 12 Jul 2022 10:43:35 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan , Sudeep Holla , Greg Kroah-Hartman , "Rafael J. Wysocki" Subject: [PATCH v3 12/13] arch_topology: remove the acpi_disabled check Date: Tue, 12 Jul 2022 11:43:05 -0400 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: 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: 17254e93-853a-48da-87f8-08da641d538d X-MS-TrafficTypeDiagnostic: CY4PR1201MB0103:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vCZ9KbarCZk3T1qWbDgfhUtGS3oRb3eEjqKeGVkvSIOdvnvdZ1dNGVZmZldrD+lAKy0mMA39WkCClN5uu+R3OM/ppwcLdm26HwPMbyDEWlOjLy8byuu//crKhN3pLdJRsreNtd8BMvUkMmcL0TsNLYsy38Dr6vfvLUVdQWsnyMZmHqr8hRp/xS2bHoeUNCThqUOJ3Ep2xuU0EV7c/yYDEOR10MTR9Gu+8qwH5F5QJNm1Uq2wdTT94ncic0asxT/7C0ofzp1Id2XBq6lHB4WAKLdWmZDXN3fkbZArgDA2XekEbfnjR2E6wLOF69CZwpBTtnJPU/6h35BREFLLUGpriSuRfddAUd1v0YIFPo2Ut459zrrmwPeTc+FCGTD6IoUH81s7EZnfcfAZVuHI6S9ybzwmUUAUd7e7WVyUhcGp6amOdZ5hPfWcK1ry+6OlMeCADqiYKLHgA9HyTKl0cTo5nJ0f01VfPgXpiZLYeaXVrhnF13XEhVgT3Lvi/5OMKsw5DK7P5/1IRZwZvV6n3R+gq7CkCpO/762X3Z2Le897i8vKmZHtWP313smB+4FaZPARA1WQIMppQJoub7GgiyKhzoLw6OxmwZWHiu75g5eH1W8TlVPAtd8PNLfTwaXUVPqh0tQ281V2TOpp30F2nNQWx5u1CdyPiMhIaCn8MeFWiLwJH8x0+iQTsqOp6VIQLj5Ptljm9UmhG6aEx/H+Yzf477NacHFPILsl98HiAvlkvPaJHopyj+Z+yixVihgBwHQk8lO/I1yO6u4wuyzURrBSym9iqxOkWy8qfAoGrFxjqqXxIUofcxG0n+ypRqptFqXCNE0bF5xFG3VjotgHsAGdQR8NI5SEibptOpJZrYE5W6U= 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)(46966006)(40470700004)(36840700001)(36756003)(2906002)(83380400001)(478600001)(47076005)(336012)(40460700003)(426003)(86362001)(316002)(2616005)(356005)(82740400003)(41300700001)(7696005)(82310400005)(81166007)(6666004)(8676002)(8936002)(70206006)(36860700001)(26005)(70586007)(54906003)(40480700001)(4744005)(16526019)(6636002)(5660300002)(186003)(110136005)(4326008)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2022 15:43:54.1991 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 17254e93-853a-48da-87f8-08da641d538d 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: CO1NAM11FT045.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0103 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org "acpi_cpc_valid" function already includes the acpi_disabled check and we can remove the duplicated check here Signed-off-by: Perry Yuan Acked-by: Viresh Kumar Acked-by: Sudeep Holla --- drivers/base/arch_topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index 579c851a2bd7..73a8cb31529d 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -352,7 +352,7 @@ void topology_init_cpu_capacity_cppc(void) struct cppc_perf_caps perf_caps; int cpu; - if (likely(acpi_disabled || !acpi_cpc_valid())) + if (likely(!acpi_cpc_valid())) return; raw_capacity = kcalloc(num_possible_cpus(), sizeof(*raw_capacity), From patchwork Tue Jul 12 15:43:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 590222 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 D976AC433EF for ; Tue, 12 Jul 2022 15:44:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233510AbiGLPoQ (ORCPT ); Tue, 12 Jul 2022 11:44:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233607AbiGLPoG (ORCPT ); Tue, 12 Jul 2022 11:44:06 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2088.outbound.protection.outlook.com [40.107.94.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDA35BF561; Tue, 12 Jul 2022 08:44:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D2ejDy7FIo7gX6f3IRvPEL5NPz6gQUMYCA2rsxSnqLBE1JZwfpXc1OkQh/OE1yk1qA13n+0XZb4yqHBgf3DoMTyHoqG+9qy2++3DqDiXn/BSJf504NkGVKI5C5LQ8YJ5wRp0f25Kga9K64+bK6zzZAQj6QsoVFCc0X/UAA1dchXqusHFDCHVRmOh0rg8+nLa34JM1lwzcVk3GcunERiZu8eipGg6vhv4M+VQS1SgTnWgFy2nc6ndHVlbqWmwX7In72Ue6I1A6XHrZc/4WIrNfowl8/3+xX4/1dwE7xRRJgSCGSRYQ5jhzDpYKp5PcTZfBnI0OvW2cBeMHzN4607iFA== 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=Pg1W6FnKHehDtSxZjy9OOG/riwVCF9EOOqtUhcHbOHs=; b=YMI3W6iljJ+OQnwv1/26SJ4dFR3D2/O0TrvaKljNl1vjFgZ6ojEIwjJ+HIku1NnrQTVcF/SX31nP1E0kJ5twgtLY3VZVoVwEYmULEXJu4ro1SQIMxK4SJbidt9yUzPwRIn9yfYGrdexO6Tel/c6ARDDvmyVOIiBkXkNSEQjSRx+TFt7O9q47BiRr6RW6Ekim1noyatuH6gzmAUIyThN5PJu1sXvgmv7JGz6n6Vwc4/2o12ou4DkT+wWyRtU+QxYnam468oKzlvXgXbPlxt04DFMcJj6hF6heqgPXrRJYGoryKyBbRlnmBNa2RJHVuulxZv5KQskyAJdwUdior02VOg== 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=Pg1W6FnKHehDtSxZjy9OOG/riwVCF9EOOqtUhcHbOHs=; b=yvONRESraAs0cjhWhyZLRRjvPn6ohfYcAAajeRB03Xm+NNEm7+oY0VP84hvckhgAxoWtKTCBvrGhDnf6NDFpE2HdfMNPX3UJWlgOT/wZ8WSQexNNOJrd4MIjPME9xFzJ9gjv/LWZ2UOlTh1S+icVKzZQ7B9F9di7nIyMlrR2KWY= Received: from MW4PR04CA0102.namprd04.prod.outlook.com (2603:10b6:303:83::17) by MN2PR12MB2896.namprd12.prod.outlook.com (2603:10b6:208:ab::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16; Tue, 12 Jul 2022 15:44:00 +0000 Received: from CO1NAM11FT033.eop-nam11.prod.protection.outlook.com (2603:10b6:303:83:cafe::c8) by MW4PR04CA0102.outlook.office365.com (2603:10b6:303:83::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; Tue, 12 Jul 2022 15:44:00 +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; Tue, 12 Jul 2022 15:44:00 +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; Tue, 12 Jul 2022 10:43:55 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan , "Rafael J. Wysocki" Subject: [PATCH v3 13/13] cpufreq: CPPC: remove the acpi_disabled check Date: Tue, 12 Jul 2022 11:43:44 -0400 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: 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: e50728f8-d7d0-4c87-6e21-08da641d5714 X-MS-TrafficTypeDiagnostic: MN2PR12MB2896:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t5uRrdzM0x2dEFIvf24kfRqdvYi79HMrQsKsqmCl3vKFzWKl4rSDc+TfxgFEHhcsHRv3UOCvc+IihKgEotF/4SC03cz016gQcBGdCItBRZxhQhjq8EXXAUkBXpJs9d9ec3f3vbw1TV/rSFfx+w9X5bDOap0M7TVXRY3hNlFoRyHySvRQOz/GZs37sf4k2DVXp95swNue8qL99O9mWRK9plGzaV8KSVaAn/sABZzTPMrgGEknvANHsD+UtBoHzfafECf0Hp/VdNy7Eyt9R+pkKsO+LYmCmVRpto76K4agL6e2am5f+sKUEjCucs/iKfMul6yYYep2XixBZdR2cMzwRRsIDHR8aJ7laTtHeFRSok9kiwy/rSCqHKa3NkrFg+jWnXhmLfdsbAaVz2Q14cKd0at8ofu26oGhXKl4qqCl63vwT9Xw5eTsWIjZcfyd5mLDApJUgXfg80hl9LRpvJBVTHXR9pIREjFrRueDuGW/GK3eb+PwH0aVgMWbczZ3VovWxhybR9GxkAaVTfpTcZgZpIs0sk55Ts1k+VrbX3hgfzEGlL3Hj3Td/3zCqbVdM2Q5VCvyIBlpUUL+EajTWtjjEsRMHG9dbdvPPcG9b6C7T2YG/BKvYGdxKpKmZZefXMgVD5QW3mGWV6xmmqw4F0WLKNk1gRFBlJAjYspAJk7ECmW5Cip4466XOc0vSds7np5bYNVIH6/oLgdS4cc6184OM6MzsJ3tJ+U1N8GgDJOu/T31aLFa52Qoqxp2Uz02FS1Jt2esZdSKabw2zbiPm6FYtOoIReRNP9Z+TpViaPzvnzKlsdPr8JjrcQmJKxeZgdw4LKNDtJHAjnnCa+qxM2hrItFxAnmMqtUi5L9V7+l7Wcc= 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)(39860400002)(396003)(376002)(36840700001)(46966006)(40470700004)(82310400005)(26005)(4744005)(41300700001)(316002)(110136005)(54906003)(478600001)(8676002)(36756003)(4326008)(81166007)(356005)(82740400003)(70206006)(6636002)(7696005)(2906002)(83380400001)(40460700003)(6666004)(186003)(40480700001)(2616005)(8936002)(86362001)(36860700001)(5660300002)(336012)(426003)(16526019)(47076005)(70586007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2022 15:44:00.2413 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e50728f8-d7d0-4c87-6e21-08da641d5714 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: MN2PR12MB2896 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org "acpi_cpc_valid" function already includes the acpi_disabled check and we can remove the duplicated check here Signed-off-by: Perry Yuan --- drivers/cpufreq/cppc_cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index 24eaf0ec344d..9adb7612993e 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -947,7 +947,7 @@ static int __init cppc_cpufreq_init(void) { int ret; - if ((acpi_disabled) || !acpi_cpc_valid()) + if (!acpi_cpc_valid()) return -ENODEV; cppc_check_hisi_workaround();