From patchwork Fri Jul 15 10:04: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: 591296 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 89376C433EF for ; Fri, 15 Jul 2022 10:05:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232598AbiGOKFZ (ORCPT ); Fri, 15 Jul 2022 06:05:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232684AbiGOKFK (ORCPT ); Fri, 15 Jul 2022 06:05:10 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2070.outbound.protection.outlook.com [40.107.244.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67E6882F95; Fri, 15 Jul 2022 03:04:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hexZHENE4tjFFtsrMSez40gypjcnHzCrdMP/dtnYc8T2i3V8f88qqfo1k0zZ8XC4VanxeQxnt7SKD1EdD71tfaxYMhnVI1h0BtHZ7Aq8D9E8WyGk07ErkfCw4Iro6hHLX+fk9dtivSgWnoJ1A8F2C4BvSH1zq1qn1zYVuwX1eUC5P23cSq0KFWFmU+BiZxL3HqxfwPBnN8hq+slELmGQBihRDd3E+eR2nhXMsiRAHlkN3tBGE0IvXPy/FMngvDgdbXc0v+nHAEK2u7ygezmvdh/SMK+1RUW8qzuWEtaLTfXWZ7rjimQplrlyhe5zhiXliH+9oxXb5zfPTkV4KJYtwA== 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=pXVfjQaeiZA12KoI9/XHeAV8GzSiN8BYTgOJedGrHB4=; b=GFhpcWIgkWjgXX45+fOgwKdmZ89X1UgIXgecO9SF4zlRwYMH830K8GAlDCpCT5MtF936z+nEgMXf72gPNaFaIo1a3eN59QfiRCZA11w8v5eCIz2KXH2gqjoqPFTqLxEG1njhKnLEgLfsaLM/kPinhqLI9oLaiGck16ObdnCk8nmF5xJZG8p0gHMsopr75a4TrFbSHe+1/A/J2lLNGYMNYEXkgzFD8sGoRRRJbRyimMHGvFexPfuazMEDay657ZsOLzVccN8gzBmqc9senSRsPcRmRpeNLIRg/aFe9642/oKTGGgLIJqLm2SoRTA76qZBpQNpEUSmRdiQhQejZZTX3w== 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=pXVfjQaeiZA12KoI9/XHeAV8GzSiN8BYTgOJedGrHB4=; b=XVZKiZGcitkidedOY3/s6ikiYiURt3jpvDSKSVGZZN5ZGSPdWoNu3h0KoEFACgjfdhS2MCrsCUQqolYjpOIrMZFrYgqFTsFelbqM12H3NVO9nqsPSQKQFDUf8Ba1OCc9hohAcucKR9+h3Sg2U+ta4Kaa8lW8XPVrrezHM61x7Dc= Received: from BN6PR22CA0070.namprd22.prod.outlook.com (2603:10b6:404:ca::32) by MW3PR12MB4522.namprd12.prod.outlook.com (2603:10b6:303:5f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.12; Fri, 15 Jul 2022 10:04:52 +0000 Received: from BN8NAM11FT057.eop-nam11.prod.protection.outlook.com (2603:10b6:404:ca:cafe::55) by BN6PR22CA0070.outlook.office365.com (2603:10b6:404:ca::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.26 via Frontend Transport; Fri, 15 Jul 2022 10:04:52 +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 BN8NAM11FT057.mail.protection.outlook.com (10.13.177.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5438.12 via Frontend Transport; Fri, 15 Jul 2022 10:04:52 +0000 Received: from AerithDEV2.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; Fri, 15 Jul 2022 05:04:47 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v4 01/13] x86/msr: Add the MSR definition for AMD CPPC hardware control. Date: Fri, 15 Jul 2022 06:04:20 -0400 Message-ID: X-Mailer: git-send-email 2.34.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: bb677de1-3489-4cdf-c13b-08da664975d8 X-MS-TrafficTypeDiagnostic: MW3PR12MB4522:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ++99bUqeRG2RfTv4szQcl6WOdfRJML0FyP3/LPueCKRjFmWwshILYSWYw0GMKtnxtwlKa1DdNe3Yqzizo54Eo2dDkinFXAtcUuvXzy9GYHS1iTxnU5oPtMFnF+jxOd7GNjkfM//1CvfTUfHjlzefIcutiuWSgHh3MtBXR4eKSnPtN1tpHAkeBEFS4x7857x4oqGI+pDQtvxlRz/S2Oz1wFQpEfz1L9jS7JZvlyuMX5yrgx953l8pEmQgLuhJYG2dhBoshf6+kGvoq/K1kpq7AnM1Dbxa5ryLHe6zTaqxb6QCeX1JrgJ/18c0AxzfuzRnJtAEu8dxP0Z0bkoE0v3u8W5qIO+h8cqbBY0tSGssJz5jx4NiJ4k6yincNoR6cOvjr9d3B2rXaAGgTuO5tthDoIgKuXlI07nC4O92CAKscrJ78r3pX68M4TpkQTZ3ezqcB3+rBgGP9dA2tXt44neYu7Efnfz6jJbQxeCYxN+WHC9sQSr8Izui/Q0ZaAyoC8UanVCqXK7UhrJLDWkZCw4wWNqmDh1yjQW06NsrxMn3WZgiqTyzy/fYYozp2mp9UZsoYwe0iHH/vBtt4inlsSSNyvTRbyOQwybrJktykb0C6szeV07FIgUS0g9hCPzyxYHUObVRkyctzyZhKE1n25a0Y0vT/AS1QNhVa2ecuoJZb0ni0mes7TVCdQY3loiRL0APbsNffMqLR7k9cT/sFKmVk6p7m1H1nGeGpZLyDN7Z2vW2K+M9sxuefRT6Nz7V8/OkngbYaLB+1haI0KtnheEOzBZclgAdd2/3jYogZTeExWcJjH5Gzo/6GXlMqy4IgviZ11Ttqs6z7WOn5M9DAEm1uUPRz2KIcNaSMiFVG6kZAz00Z3Lx5w+CtM7w5PBR8HtOUMwjrBw91j6dUgaY9H2zGITW1rwGvHhhBX52uedHkf8= 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)(136003)(396003)(346002)(46966006)(40470700004)(36840700001)(966005)(70586007)(110136005)(316002)(426003)(6636002)(54906003)(26005)(40460700003)(70206006)(186003)(2906002)(4744005)(6666004)(36756003)(336012)(41300700001)(7696005)(16526019)(4326008)(8676002)(81166007)(82740400003)(47076005)(82310400005)(86362001)(40480700001)(356005)(478600001)(5660300002)(2616005)(8936002)(36860700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2022 10:04:52.1506 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bb677de1-3489-4cdf-c13b-08da664975d8 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: BN8NAM11FT057.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4522 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 Fri Jul 15 10:04:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 591124 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 37D47C43334 for ; Fri, 15 Jul 2022 10:05:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232981AbiGOKFg (ORCPT ); Fri, 15 Jul 2022 06:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233369AbiGOKFO (ORCPT ); Fri, 15 Jul 2022 06:05:14 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2062.outbound.protection.outlook.com [40.107.237.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 091A583F1D; Fri, 15 Jul 2022 03:05:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KiUsXII+eWA2NIUxruYJnqUEqfWsIWKr228rxCfAHpMpJIdWYSRLUl/0xHXyP08F01RgKrmi0Mo4EezQbXobvw6iGtPR2ixSSfAcJMOekIOwmd+w3gEybK8h4ZT60W4JvDpFxXj/lxeLngSrXu2x22+CG4Uck+dsAi6RJzU9CiTknKCf4jICTFdrOaKDr2lLz/8vGJZhtTu73k/f8LLcUWMdxmJbAmY5z+H3OuniapfW1AwvqHy8M5RphiailxktHFY3VEXsrxJozcWSeSox9yKAwxKQZOK4Efvouxl741lU6jD6vEW/wNBYRtotLTiwOTBq4Bc8lhj8xRwHfJAmSg== 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=pvAEdmGWIfoWRkzwcliXGMGGn9wOjYVOFwAF5eM65+k=; b=k9pUcakIUSpkU9uTJw8f6/gpNJmBZLJEAHSYHz/tei8r5/ypAzcPUW3zGhz9VvoBbqXKEz5AoIWeHLkZGi0HzPQSGL1UsWBxRizY4EgtOWmrObne0cuJg2zuQnusQFkiBpMAwT5SBzrbF50qWTt+ZmCvSlSxls3Yl5WZ0HxIisX03uG2J7Ok5o19mN9/wdDfZ3cra+MDB//sAeqhEhrq++7MpV7gAm+o8NOCfpZdTgKG/snCmIRGIRtYmGmunYpJ2gJ3aWDafnbju3NEW2LlDQ/nDViVkThrtywtuJKF9uSdFzdDvlrhwi9JgQH6e2mIZ1SOF8nXSDj3wwrRQx17QA== 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=pvAEdmGWIfoWRkzwcliXGMGGn9wOjYVOFwAF5eM65+k=; b=YBK1VCXxqvk9HtUdeZuksjsq9enB2NQrINCQCQlaJ6L8y3nWjYc7oprX5DbXx2A89i2KzV7GA6sRH8NP4p/zyr2LC7nXb9kxMUo6cRNrdhHUMiAZU8M4VihRjnLh9v+ptujb9KoWZaF1uNkaI6fAVrNRzqqTmdFbbSFzA7x63rY= Received: from BN6PR22CA0059.namprd22.prod.outlook.com (2603:10b6:404:ca::21) by MN2PR12MB4078.namprd12.prod.outlook.com (2603:10b6:208:1de::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Fri, 15 Jul 2022 10:05:00 +0000 Received: from BN8NAM11FT057.eop-nam11.prod.protection.outlook.com (2603:10b6:404:ca:cafe::43) by BN6PR22CA0059.outlook.office365.com (2603:10b6:404:ca::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.26 via Frontend Transport; Fri, 15 Jul 2022 10:05: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 BN8NAM11FT057.mail.protection.outlook.com (10.13.177.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5438.12 via Frontend Transport; Fri, 15 Jul 2022 10:05:00 +0000 Received: from AerithDEV2.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; Fri, 15 Jul 2022 05:04:51 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v4 02/13] cpufreq: amd-pstate: enable AMD Precision Boost mode switch Date: Fri, 15 Jul 2022 06:04:21 -0400 Message-ID: X-Mailer: git-send-email 2.34.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: 4c337b38-2ed6-44c2-e86f-08da66497aa6 X-MS-TrafficTypeDiagnostic: MN2PR12MB4078:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uR2E/K9f0sw5k3ZmqY55U+diRCGL3WFHtzw0Pv2N33V1pb2H/parNw9ylM7p4vZAGCjtaVFcdOQw181ncfVZNr4h1IOZHEYYTswhe8wdq4+Z+k14FnQ9XJBo7+bAkgKHN4h5uIB3Yu1k8GDOkiVffV1ikchHK3SnQXx0ij0OhehP0buFZ4ubnsUG6wILdiWjOZ5silxDz7QlnMB2GUDcYH8qVA9JIxTMV0ubvMwKE9Ri70YB63SpOG4UGWg4cSAqQKlBuJcXsLu2bC1Qmgq+bPQYfbye0LVcAMqDx5/kbUHFX5pjhnYsTWdxHY4VvDnUPbCoegtH2Fk/vVdAb2J7qsyctpNd5EqsTR8OyA6Xba4T+LyM/IXmy3M/mMHazU103/AYQaMuttrWgeRYz8Io3iIVFxYZoSlDbReZGEfApMqGx8AIi9u5eYiKTmhxAP5zhvvc4g401ZAUPLnV1goLrYvT/U3W2jRoVZ6xi+B09BsInnLb1CZcNsoDplSGA6F5HBMkBwv9eK7dt+cRrC33/uZtW0L2CV45/4gKSjW9xQMHKpgE9e2IlghHKIhnfIvnq7bOquXimsn/L0mCKfy7TEzUNgRslbACZYpSABtaRnkZcTaKsQjCUziREVEU/5zvpsRtHCUdEmAA34IGkQsFgNPgL1ejulUs/CwSQRnEa7tciiiZYkUm6FfhsTQvr6x/VXzKG7h1XkC/LswiepoRnXFeDG7QzJhLvMxlout9aUl0s8bdtZk0AfOaDE6Hr4bwj2jKHRbqou80mQVLnz7JJPhD/IAa8KptVqtL2e3XCH6nKzX0RdnsKvcYvOvJ++sCauN4o0Tbdb259rlTK5ojVGqtUssV/zu948vlPiNGsro= 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)(136003)(346002)(376002)(36840700001)(46966006)(40470700004)(110136005)(82310400005)(316002)(54906003)(2616005)(41300700001)(6636002)(7696005)(86362001)(478600001)(356005)(40480700001)(6666004)(82740400003)(40460700003)(26005)(81166007)(70206006)(83380400001)(426003)(186003)(36860700001)(36756003)(5660300002)(336012)(16526019)(47076005)(70586007)(4326008)(8676002)(8936002)(2906002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2022 10:05:00.2126 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c337b38-2ed6-44c2-e86f-08da66497aa6 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: BN8NAM11FT057.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4078 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 Fri Jul 15 10:04: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: 591295 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 100AAC433EF for ; Fri, 15 Jul 2022 10:05:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234251AbiGOKFg (ORCPT ); Fri, 15 Jul 2022 06:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233370AbiGOKFP (ORCPT ); Fri, 15 Jul 2022 06:05:15 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2067.outbound.protection.outlook.com [40.107.220.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A8B479680; Fri, 15 Jul 2022 03:05:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dy7SDa0obj7g5bVAu+es//g35yqVDInwPgeD0lHbwBIcTRyBfLXUQi78pWBpz69/jSTPkNkzFeYwl4IhrlYIzYTXt48bYwQz/P8Eq3dbRp8yEVLZo5LlVqYmDepsIBQYH3ttNN5zM3LtSrzzgpYjXT5dhFDb/sqr/vQx3xGt0Vq+ZzLk+uWnHeXh+iquaHeHKUCwpLw2QYcywmqPPM5iMftRDPlacYPPP11LavogDF021y1FRKnbfvHWnCORKQRKela3+6mo4MbUlPRJLWXKorDfIEfOGTGrDNFWrL3Y0PtnFjoR1xUgDczuKxfj/FFK1lgNYZrqdzqxqJhp7r69aA== 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=Zp3o4SR4uEqafdVURj/Agxl4+HI2mEwH9ygxUNMuVWw=; b=dN9X6W7DqYEd3I/vmrkmOW4nwRSVS+7HjEoGijQz989qWhs5PkyqhgcbGADLRTQxF3ClO5tov/W8Pnf/D8LZnvGvRp2Zbep+0pZTERdQTUC69Gd/4tuSRxOYCMUBZyutdxYFEDuZoXGornajU0Qyc/BALmyClUWJZ67BmFG4BLv7rH7antON97bQt9qE5r5WLmyNc65ns8bSbKJFHTSI0U/gM6sJ6c+919tyO9RntnX+lfogihRKBZJGKBYNo3qEDZcQUf9FmwlYO6N5Pt7+4xp5BTmTjP/0zCkKrk3sNtg9T6o8Qwqp6OFGjuAkS+ADWFpUfK3UcU/reK5qLv7cbA== 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=Zp3o4SR4uEqafdVURj/Agxl4+HI2mEwH9ygxUNMuVWw=; b=WGsoROw4zUwtcykgdA0XB13tCFyLOcEyEBcDusjcojxOlUx3l64jLcJ3gCKi4bU+r4c0wQyjm3ZAIlFKh+bdeE1LyMaxJVQ3lfStDG/V7SU5+E4rTR7lKxnG60e/VMVxsApjsGX09nyvVyu3r0oerm02W9S949M4rYI5uE6Arm8= Received: from BN9PR03CA0357.namprd03.prod.outlook.com (2603:10b6:408:f6::32) by BN6PR12MB1905.namprd12.prod.outlook.com (2603:10b6:404:fe::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.12; Fri, 15 Jul 2022 10:05:01 +0000 Received: from BN8NAM11FT007.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f6:cafe::d1) by BN9PR03CA0357.outlook.office365.com (2603:10b6:408:f6::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.17 via Frontend Transport; Fri, 15 Jul 2022 10:05:01 +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.5438.12 via Frontend Transport; Fri, 15 Jul 2022 10:05:00 +0000 Received: from AerithDEV2.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; Fri, 15 Jul 2022 05:04:54 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v4 03/13] cpufreq: amd-pstate: cleanup the unused and duplicated headers declaration Date: Fri, 15 Jul 2022 06:04:22 -0400 Message-ID: <6fed848fc6694074ceca16a9a45e4084fa33b511.1657876961.git.Perry.Yuan@amd.com> X-Mailer: git-send-email 2.34.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: 6858c982-ef75-497d-9cf5-08da66497b0e X-MS-TrafficTypeDiagnostic: BN6PR12MB1905:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jyfj0fe3+ZIEKRqAaegyufiTqGfyVxsawRKH7huMxAy3Lv446n2vf9LXKna00UEkw8R83HHipLYrIzv5CujDADd6+DOQ9d9cKPxdjS9ojtwCkRYyQpFpjI0252DH99rQwT2WLKNsOsE7wCDmVxOjtEtGOMtNGL6edXvCAYqCIMx5/p3SKMWE3gy+3Pwn3qlXaUUsJ+mm3rI7am2H3NeXykWGRlxE4L+Tkk1GPN/3IOjPEQy8g8pgIwd2nAq3uz3bJGgmcsFYq7FwS0LA2fYIj8qN4+Cc5W0wEUzFGgOVPayIjop5VRzMI11m40eQgwKdd80OaN2dHlvVrCgbyLVXLa/1r2AYNHZEJ3fpT/A4NQsHOJUNUX7XnRdTg+JrRcsfCrGK68/TMYRAt3qu5+yUoD74MDNXvOunPCtfG1yV09ZXTg1OA90PnrQ/bKMVC/BQuZovmNFKt6emgr11MjpLrlfANbfEUFuSoteCgsJ3eFWH4M68UuRw8hi5sOZf+31OAznFvRFqET/FMoXclb9uvrtT+kaZ+NgC4cALtp+r0Hp6uZ+L58315zDC9uFdvzpc9W1hCC0qBOLhVRcIUzD6oos5DtxiSZj7reNo21llYaD9hn1Vwr5m1TSbXevbtkdXamvnlgo/3rv2k9HkAn+02pPw4a2zjfeG4egdDdzGVkpwIwS9A65O/ICeMnN52kRG8/KaqUjtXOHUdBUrUyx+w/ZL8GtMEB/1yuU+DX0+6eT+DTW8PF2uXXZk1WPa6FMnol1t5vdMEIFEoHinD0tMwHilxLw9LDdiyxCx/fqlBFI5hXBqqiVQ75t3Ea4iBSZowcjTZc3P0SYERRPZjdIITLG/TewsaJ/CccFHXRX2ODc= 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)(39860400002)(346002)(376002)(396003)(40470700004)(36840700001)(46966006)(426003)(6666004)(83380400001)(47076005)(7696005)(2616005)(41300700001)(26005)(16526019)(2906002)(186003)(336012)(478600001)(40480700001)(5660300002)(40460700003)(82310400005)(316002)(54906003)(8676002)(110136005)(70586007)(6636002)(8936002)(4326008)(36756003)(36860700001)(86362001)(82740400003)(356005)(81166007)(70206006)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2022 10:05:00.8922 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6858c982-ef75-497d-9cf5-08da66497b0e 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: BN6PR12MB1905 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. Acked-by: Viresh Kumar Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 188e055e24a2..43e6df9f67f6 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -31,19 +31,14 @@ #include #include #include -#include #include #include #include #include -#include #include #include -#include -#include -#include #include "amd-pstate-trace.h" #define AMD_PSTATE_TRANSITION_LATENCY 0x20000 From patchwork Fri Jul 15 10:04: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: 591123 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 A5EF2CCA47C for ; Fri, 15 Jul 2022 10:05:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231617AbiGOKFh (ORCPT ); Fri, 15 Jul 2022 06:05:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233400AbiGOKFP (ORCPT ); Fri, 15 Jul 2022 06:05:15 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2067.outbound.protection.outlook.com [40.107.101.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A00133A08; Fri, 15 Jul 2022 03:05:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kf/ARAi9z6UGV3hCEReLPOUoNlItPtqiInUrtLUR2jEXWyC3M5svYF79OrevApE8AK9AH9CDATv6NRUx7lu5YksvijzlVmlLbXK44HN+Ze56ImQfe07IB24WIxAzDyBp8dAIBzUOHclf+Afcg94D/srQANJtnN9od15AMgB/8RtAsFYcjeEbNrbzSp6M4T+77RG6VzvPzkMre/y2hX+KB2R1y6L+9rubqH4gpu4XXpjGLZ4y1EJYPsh6SJWlMhUF0d8RwhQ+EegMwpF6OYb/pkOMB/bo+2qohYHQwfesevK/DUXYHuSyYttpCCwgjP6Hcz1uxcxGAtGfApzBGYL0bg== 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=NbhNxgmTeWy6Jq2jT29MMre/xJvh6Q5oR8ySWlwZNzk=; b=MPdtxWyXwk2xNPyMx8UAmhTqYsp3fvIQ+5yzWQTGlQzV2U0GEQMpA2Grz5hBhfdT4zkNGUjOR8O0dKfh3f00aOoR5onDQUGAEMU5kV3yc3zpIqK9eUsvn4FlX6eyPmIIv3p3hYBKbraL9uKkPJ/hwvZaUYyPKvpJnkrWuKZOLBL6cC5aewjUXdL/q8k3ewdPuRmgrdBLh4EC15ZoPsg7Sj5aT5mvWNjRNJ3fT428O1zYDvb53tO7uVpF5aU1uUh66KMlXnmcNh5/pXhSU4R2P1tUXS5bmsjr/dOFrC7DzbsALegy6XWOIZDz1aYazUJolaHdFTOS+zb8PCwiv+Iprg== 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=NbhNxgmTeWy6Jq2jT29MMre/xJvh6Q5oR8ySWlwZNzk=; b=f0JLntudF4SyW86JAGHpR7hyW+RiHMR5KYUpHBmFiLACeujtgFSl4zsdyZ+XSEE5SKbVkMcnmN1JqTLXojmgo+Dek2Jm49Dc9u9J7fw0siY7AbS2fbzhj1PJL1bgoBgiwzk1Z5gV8wfCbX4QWicIHv5eQAF0rbc6DlBWm/ytCNE= Received: from BN9PR03CA0335.namprd03.prod.outlook.com (2603:10b6:408:f6::10) by MN2PR12MB3616.namprd12.prod.outlook.com (2603:10b6:208:cc::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Fri, 15 Jul 2022 10:05:02 +0000 Received: from BN8NAM11FT007.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f6:cafe::16) by BN9PR03CA0335.outlook.office365.com (2603:10b6:408:f6::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.20 via Frontend Transport; Fri, 15 Jul 2022 10:05:02 +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.5438.12 via Frontend Transport; Fri, 15 Jul 2022 10:05:02 +0000 Received: from AerithDEV2.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; Fri, 15 Jul 2022 05:04:58 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v4 04/13] cpufreq: amd-pstate: prefetch cppc_req_cached value in amd_pstate_cpu_init() Date: Fri, 15 Jul 2022 06:04:23 -0400 Message-ID: <686bc72b4dc3a663c00126c852e3b4774a280700.1657876961.git.Perry.Yuan@amd.com> X-Mailer: git-send-email 2.34.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: 86b3f28f-345f-412a-dc8e-08da66497bf5 X-MS-TrafficTypeDiagnostic: MN2PR12MB3616:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VPl3plYHuirgVcRi7b8zhiD00tk2RJlumezyWMcua//REzgklYnRdcArk2tha5NUHNg4Y0HDnFj7apkuZVZqRYEBioWp0moyUVTIzzHHX6QV+eD9UnlGesN0+IYkllf2qTXrIS15xId+0jssJRNZM7PgYP96sWm7HkdggAJCjNzmQ8ensrTNV0xvH/zMZnJ6zmjZbR3ptQOWzPd27p8MEu/0eNAQn52R9+fRR/Mw5zH6yC2ja8ioWBzsc/wL8ETUv/gtboCQdgpvMDfoVe7Rf7jesewWHg0TfF/ZchsiV4WhZJJECeN83kgwXUoVPVq0UWUuzAdTiMLAFx6T8fjBUBLuSP3eoLbV+91nioImaFISG3qx74a4ABcxUGRVuz5qm5faqXFu0rlWWA8QUBTRZLXiMvioXRca5xo1nOyRvXpxNbOJbG/wW/Uz1uOMa5GIEsc/jo2DE/guwjCUKcftvABoKE9jSzn/GoFfUl74w3OqdNn6o0J9M5faNL7fiaDYeGVv8lOewmi8WGK9HwPXbvAwEzlhYBK+fMIwcM+cIWDIkxCwWGB7vY1UccW4Jey9sx8a/kD0r9uaPOAoNpj/VZX47+euRBX7qUawJuiO/AUc870rVpCHSkjdHCjxTIejv32Cg4uLAoLxCx3/naooVczbxXZrhmzlzOZTW6muj7EDsvUnKJzyRc3tURjlb5iwMHNneC4WsY4QJyjo0sX+GAEXF0biyTqMQfSckBHe+XyWwNpmqjGqO8pKTWIk2/Z+mMjosFfMxEumIr6U7cQGtPgtSK8cjbSeEFroN8ZaTBDpjrBjmWpwtvJdDQMtiR0XSEsrugk4biHzIMpsYECeNVWyZJOWX/Xgq3Bla9wHL3E= 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)(396003)(39860400002)(46966006)(36840700001)(40470700004)(110136005)(54906003)(6636002)(86362001)(336012)(316002)(16526019)(83380400001)(40480700001)(2616005)(47076005)(186003)(41300700001)(478600001)(6666004)(82310400005)(426003)(36860700001)(26005)(356005)(7696005)(8936002)(82740400003)(2906002)(40460700003)(36756003)(70586007)(81166007)(8676002)(70206006)(5660300002)(4326008)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2022 10:05:02.4077 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 86b3f28f-345f-412a-dc8e-08da66497bf5 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: MN2PR12MB3616 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.The cached values are read through MSR interface, so here use shared_mem flag to check the registers are accessible Also the core performance boost state will be initialized through hardware configuration register * shared_mem flag is used for the shared memory type CPPC implementation which dose not support MSR interface operation Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 43e6df9f67f6..d8c4153dbe4f 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -92,6 +92,8 @@ struct amd_aperf_mperf { * @prev: Last Aperf/Mperf/tsc count value read from register * @freq: current cpu frequency value * @boost_supported: check whether the Processor or SBIOS supports boost mode + * @precision_boost_off: the core performance boost disabled state + * @cppc_hw_conf_cached: the cached hardware configuration register * * The amd_cpudata is key private data for each CPU thread in AMD P-State, and * represents all the attributes and goals that AMD P-State requests at runtime. @@ -117,6 +119,7 @@ struct amd_cpudata { u64 freq; bool boost_supported; + bool precision_boost_off; u64 cppc_hw_conf_cached; }; @@ -547,12 +550,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; + cpudata->precision_boost_off = value & AMD_CPPC_PRECISION_BOOST_ENABLED; - 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 Fri Jul 15 10:04:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 591294 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 BED14C43334 for ; Fri, 15 Jul 2022 10:05:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234025AbiGOKFi (ORCPT ); Fri, 15 Jul 2022 06:05:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234004AbiGOKFQ (ORCPT ); Fri, 15 Jul 2022 06:05:16 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2089.outbound.protection.outlook.com [40.107.92.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A8377BE21; Fri, 15 Jul 2022 03:05:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QzTxaLyzIc3Cw6xf6S90ENtM/QN3kBfWeEx1FXp+FdhilEj5i/QmCzeMr+cz0Dam5SYfol2cNQxWKXFuu7Nh4RRMHnlDSgT25WopxyHJFx2qdYD0rLhgr4bYckRKfQ1GQamkOs3p6eUTGxRxBG4w3RL3M2CSIRdfdnJO5wQ+HBW4WUsF45hFEGlSTbu0qi9aIwSqevnrFcizfT7pSNfK255qMReq86tNc2v6djJeejJ5bXfmYmTD//KLdJaYb+X7UIRxDh1bWti+Iq5s7TWd5QF6A2PyOX2WZ+zg2Bn7Z4sN2cI/UbxFAV/mqUeKUUIZxPflM47+Ve621BIFEXAyCQ== 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=ZNefItLSEw5zcz1l9vPXNypnOlVbiRq1Ye3gOwzkO/U=; b=Hbhb6A0RMJBHLjOA5k2UO6JtgOuvFl7hm6GR5pdhosygEoPonwPDg0oQiMsz/S92xQMKv7C9rQRbpDpA5EsAk9Tqpv+GkVS5GOzOisGOca/PEDjZy3Q+Wt+b9v+/wetrQ0i7mZrZKC3QNnrPKpHrHpzErBpgyIjW0eIM6GczqHmx7PIfWyg+NddxR+BQF6sI6vukzYzDzpSLU389iyTWBJUOfo2W95BYWJ6bdZIoTJ2tatahGpMHdRFmwmNnCmulMCS+8/8luoDHoD4foYValusG3k6RwC9N3ehRCRW7K/hSWEveKcy1Us/WbTgsyYZBgFkjvJp3LWWWuJta0oG2UQ== 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=ZNefItLSEw5zcz1l9vPXNypnOlVbiRq1Ye3gOwzkO/U=; b=zKoC5ZtI5Lu+boMrWyNJIYfLI/yusA7R3eVfS4XmzRURzOYtXJeXRr0i9KdUax/SOVCz38ieIgZPSCd7pgdSlHp85Qy+zeLyRVYScra175Rc65mnq0ERgI17OhMlzTCQY0Iz5LTu4gwMO5nqI8adUoELu0FyzMS+vt51u6jczSk= Received: from BN9PR03CA0209.namprd03.prod.outlook.com (2603:10b6:408:f9::34) by DM6PR12MB4418.namprd12.prod.outlook.com (2603:10b6:5:28e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.12; Fri, 15 Jul 2022 10:05:06 +0000 Received: from BN8NAM11FT038.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f9:cafe::3a) by BN9PR03CA0209.outlook.office365.com (2603:10b6:408:f9::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.20 via Frontend Transport; Fri, 15 Jul 2022 10:05:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT038.mail.protection.outlook.com (10.13.176.246) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5438.12 via Frontend Transport; Fri, 15 Jul 2022 10:05:05 +0000 Received: from AerithDEV2.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; Fri, 15 Jul 2022 05:05:01 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v4 05/13] cpufreq: amd-pstate: simplify cpudata pointer assignment Date: Fri, 15 Jul 2022 06:04:24 -0400 Message-ID: X-Mailer: git-send-email 2.34.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: 945d9ac4-ffd0-4a5a-853b-08da66497df5 X-MS-TrafficTypeDiagnostic: DM6PR12MB4418:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CFz8PQipw9omZ90Pc1T4/MZTDsSfZfAH42iuUKp42gZpGfPiRN3vHHhj61K75ZesQxkCgfSnkdRRygU3UOWtfAqqrOVNXrnttc7SYOOmHWuLGf0m0sSfLcGkL8SMURYoFFX19FyuYxwbAfm0v5zYPKemAGSndY8j1tt9sJYEcbJdjSHiZ/5c1BMvY89voJtkdUcmoPmv3bX4rnd4ahZOprYmrbbc27a58veOTaLKsR/gjFLm9m7pBg/SaukpOn8QJNm+NXEZqTfBOhEDu2u1qVz8XBebHGTsbTCD5NP3A5AX1W6QUz4YIzXuPXtB6W6pPmen4L/u2X4Tcahjckt0DyvxwkcZjAL7JGm17ykXKPzIbor32MwmdcyHuMmb7aEhflmebVmAbBEL0ugw6D1q4SywbL03YYJ4PEqPh+4z4XZZmw/7PdcNRxKl7TSY1M6sDsgknToFbEL8IT7M58IkDli+lrbkgn/bc8mAxNugR5mcMW45EcXoXFZYN/zVAARsRRFlnjCECHjMPDSkGUxkRtQBSepCkJL6BaQjvCB1dAAGRyGr0UJL1W0LE/tIc0eLY6ngUFIY6AJHJ+6c7gyz+EHxSJ2mNblABfwaj5bIVeHom0qbY/4Z9whqw47NpgU7LBCEt38W5nOuazR4TDVwezVW6dxmFIGt78h0+ak43nUoDsmDP/IqNCwMmusmyoEfq82K8Qpxen/uWeUffqE3h7rzRFL3iZQvH5k51gu1oVwUGYdX52gEbS8rhkIe3Ck38jo8/eDJq0aYAP9QSW5K3Nm7xYTnlr7o42Qx+PfqcIHg+qxIbgpINa2+tzjRkQSjibs3T/Q2FX/qHwqluRb8/pAgqptUtn0KsrHz8qhBMFc= 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)(346002)(376002)(46966006)(40470700004)(36840700001)(36860700001)(81166007)(478600001)(356005)(36756003)(82740400003)(186003)(316002)(4326008)(41300700001)(7696005)(54906003)(2616005)(426003)(110136005)(6666004)(70206006)(16526019)(70586007)(8676002)(47076005)(26005)(6636002)(83380400001)(82310400005)(40480700001)(8936002)(5660300002)(336012)(2906002)(86362001)(40460700003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2022 10:05:05.7609 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 945d9ac4-ffd0-4a5a-853b-08da66497df5 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT038.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4418 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. Acked-by: Viresh Kumar Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index d8c4153dbe4f..0c8256638ed7 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -574,9 +574,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]); @@ -618,9 +616,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) @@ -633,9 +629,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 Fri Jul 15 10:04:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 591122 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 98FEDC433EF for ; Fri, 15 Jul 2022 10:05:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233489AbiGOKFj (ORCPT ); Fri, 15 Jul 2022 06:05:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234074AbiGOKFQ (ORCPT ); Fri, 15 Jul 2022 06:05:16 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2048.outbound.protection.outlook.com [40.107.92.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE0C184EC4; Fri, 15 Jul 2022 03:05:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nLAhyVdCLLNKYbsg3wUc/Cev2S2QrFvpqKgjeI7rfC5AovzZs3zewlcmDnOWskeeJ8vDnRaItNgdoRHuwMgWUcZF40I4dk2AJQw2e5eD7QeaGkobZ0OIc9JXadZK+h2rX3W+nhY2NzKnhLSHsYYoBuYeDLNAwM6YN5OkQkKiHZQ3YQ6pHwowzfGT829U9KH/ycmqQkDQyF/tGSQiCrTgUqZij2vxCK8Y/HT3aIsQ9ImZdSb0oxiKuUwX0LNf+c5HAK3N8TpTyIKAdwdbTHlfWR5iDdAdzot1+9j7Z4WX8QljkXHLWAJeieDfDhBX8F28LsPIPYXMgbhqWVGWgun5/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tstHPiTPGZyIIUpZRPQPnBlc8CCgMG9WDEwA/OgWIII=; b=E8RPCo4hrVb5bWLVddgzsslDnBfjoyNtC0TW1KF3N9WEIMmHpMsQX1dNQwUEa+IIbN3PwQP7P6Nx7u5Ob2/Yd0Zsy2EZI+csKjEZraEWYjgFFr0afMV6j/zuWN1Fw+0g590HV+l+KqNe8HZge1lxhkrjxupBN4g7+qqiyOW/tj3bRW19X5TWkkEd/x7Uswf1GGW/fRvoD0j0JRgw3hdp5IwUUlmgO60WnUOU4fwGqXMkm4iG1gez/gAlBU2t3ElnAz4G38TlTSNtbN9hARMrFyNIP/STXq2sgHUZioMQQ6zxcBcCgPRdRdMGZwHgcHp3VZM0SWmhOmRX7XbMshOeDA== 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=tstHPiTPGZyIIUpZRPQPnBlc8CCgMG9WDEwA/OgWIII=; b=s+kyLWhoJ7e7T0eIObaT/+D70SI/W2Ztey8qcWY1PHXpNMJuZQBLZq9qU+A5Hd0jlXnbRHSNZaqPUW5V0TVzInZ9rBiMJ9I9HHtvBvCGHT4aQIofOSZbH9YzNJvvUFp6HkQT4yj3iYsgyHHrwQsMMnVowBA+K4ZDwOluHCIHMbY= Received: from BN9PR03CA0520.namprd03.prod.outlook.com (2603:10b6:408:131::15) by DM8PR12MB5413.namprd12.prod.outlook.com (2603:10b6:8:3b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.15; Fri, 15 Jul 2022 10:05:09 +0000 Received: from BN8NAM11FT031.eop-nam11.prod.protection.outlook.com (2603:10b6:408:131:cafe::e) by BN9PR03CA0520.outlook.office365.com (2603:10b6:408:131::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.17 via Frontend Transport; Fri, 15 Jul 2022 10:05:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT031.mail.protection.outlook.com (10.13.177.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5438.12 via Frontend Transport; Fri, 15 Jul 2022 10:05:09 +0000 Received: from AerithDEV2.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; Fri, 15 Jul 2022 05:05:05 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan , Su Jinzhou Subject: [PATCH v4 06/13] cpufreq: amd_pstate: fix wrong lowest perf fetch Date: Fri, 15 Jul 2022 06:04:25 -0400 Message-ID: <7091e6ddb8605bdd870bad3273b03eea67354bdc.1657876961.git.Perry.Yuan@amd.com> X-Mailer: git-send-email 2.34.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: 495bd8bd-ad69-4d31-df72-08da66498032 X-MS-TrafficTypeDiagnostic: DM8PR12MB5413:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3E3I+9OipyWXTu1E84fz3K/dxECxXp63vY12bzcCQ8T4YP1NBa78/SGXYtDP5hsZpQtMmgkxwx3Fc6erc+yEvp6zz2drXr0QftovjQvvplQl8hSgSNf3R7m9ItfMOmXFfirKybFSR+nCwMZ4rkMn7SZH7rhYhZaxWrMayFkm19c9j3YR6yHkCEZIB7aVXkwJ8GOC3AEyfYIr9yL4q+GFWvGmTIXk1rOSvRbC95Dw4TlsBN+wa45EY36jDNObJ0oo6OM79pkZqzTDegyNcZJR2FbnvbBrGUUwVo2aQtQAaL2O6NJiK/ng0TGqllFsWsEVWEPRKJoI0/CwSCrjrgaJVXO0Szk73wQhmM3CpYHsSsqro+mlLUoSHqvYm1NZaqjMYi6NbXIsxNGuq1sdMEqwad0eLKn88aWVX5P6fXLcOJdje7R4vuaweLte4luJYznx1u5DeIi8pKE6cBMLmlbOR5ibPF3V1k9y896HFWCUtcS2sRao+FWWa8jLS04EJD8DD0ofTRd9sw8m8fnnotvw6WlAXHN4AKcNTi8Z+nBM7Oh0gvMwYWnMS8qq1jLHZtxvqQY5uX0eahVWVRG3C8jDwlyZVIU0DFUxVVRv0oy/fRiillP5m8gHaqbgdylZtCKO82F/c5IA+bcVQ8vVnWysjtZdQX02yt9XjVk6fXcVJTh3qaoFlCKpXGst1EsToQHUvRNOAtwogeffnWvuUj9D8xeRfkBGlKcQD1NBrbByb7FXtIY5FWOqOD4F5Lsc/FEbj0i/TL43MhkSJ0QL24vgq/EGvczWhKxjnf1iW0da4vfxy0yM6Qfe70xKzuNwbsQkqWVSyiuRRuJkCKLoXfNgnWM3dwCLFzp55VJluKyxn+8= 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)(46966006)(36840700001)(4744005)(4326008)(5660300002)(8936002)(8676002)(40480700001)(82310400005)(40460700003)(36860700001)(2906002)(86362001)(36756003)(356005)(82740400003)(83380400001)(81166007)(70206006)(478600001)(316002)(6636002)(426003)(26005)(47076005)(336012)(16526019)(186003)(110136005)(70586007)(54906003)(7696005)(2616005)(41300700001)(6666004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2022 10:05:09.5028 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 495bd8bd-ad69-4d31-df72-08da66498032 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT031.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR12MB5413 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. Acked-by: Viresh Kumar Signed-off-by: Perry Yuan Signed-off-by: Su Jinzhou Reviewed-by: Huang Rui --- 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 0c8256638ed7..4b764870035e 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -311,7 +311,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 Fri Jul 15 10:04:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 591293 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 BF403C43334 for ; Fri, 15 Jul 2022 10:05:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232542AbiGOKFk (ORCPT ); Fri, 15 Jul 2022 06:05:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233500AbiGOKFR (ORCPT ); Fri, 15 Jul 2022 06:05:17 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2052.outbound.protection.outlook.com [40.107.94.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3197E823B5; Fri, 15 Jul 2022 03:05:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b8qXIHC1gycvLjC4HVygBGjrhv9eca/AVq5bmanbDg8rUwjX3Mj1o0hCRfMEp9Bv6cQN1pab0W4sQOuQA0K2HnRgA2UmbRxWPBfiKSSBWUr0ze9aCwPR90KZD3ghdCwD3RPg8KfQ9EfHi8+WO1CvbAYia0m0C2yYNb4EtAlXsVcBfwtnPbF0NeyCi2qmK4joPl5M9o7Z6XiU3UrI+VplOu6u83y7sVQQfRKBSQAzqLRPMRfwX22bAZzQUihJijlRtR2QaEaxiVNTrD+KZBK1aCzkLKd/z6rN9/P7+r0lfFPoN29erSH2tS0K05utr4KIzQLR2qxaX6ePxO+ZX1zYKg== 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=V5m6E2DtFSDmFiXas1eyp5utcmdhxLyGDwQDmwN36tU=; b=OMT7iZ63D1bNtGtoO0caBW9vOX0Su9mbrmThhDgmze5qHqXyFpMOSR5cWh3Z64IS69IGZe8/fzU7mW49pgOoGl1fyb5+pP384y/9u+04Z8/Oki+QEO0RtteulPKFgpek+jjEeDaBBS7y9vfxovAE8Eu/8BHG2KIJNL6G/cH6Mddi0jDZ5GnU61GA/YhrXv2DOpDBibleIRthzAU/WgTBIBhKnBYDYwPvvHQXEuQ8ATe7Au25rMB/B1upvObD9e3TZFqYx/UuwkdCtSMrvdTKDSnIIZcRIdZEuX8H7aBaDoP0lxUFoGZO1s4MjSq51OVkiEzN7kGpyVDia9d9amFfWQ== 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=V5m6E2DtFSDmFiXas1eyp5utcmdhxLyGDwQDmwN36tU=; b=CyUGtouJVJVf0RyiP5Y6qt86pFdAGUsH34SrTraANdaPBaNX4PCQYvPOZAGlTmYfQ6WAkpQIa44VWwXU2LgelzbJkyC3u2GVaDfZ7i/1XrPPIFNco/t1fcDeritQYe4qiMWSetPds9IkhqxWcDHcLgf46r94TfX5knhjpul8MvA= Received: from BN0PR02CA0048.namprd02.prod.outlook.com (2603:10b6:408:e5::23) by CH0PR12MB5059.namprd12.prod.outlook.com (2603:10b6:610:e2::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.21; Fri, 15 Jul 2022 10:05:14 +0000 Received: from BN8NAM11FT022.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e5:cafe::2) by BN0PR02CA0048.outlook.office365.com (2603:10b6:408:e5::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.19 via Frontend Transport; Fri, 15 Jul 2022 10:05:14 +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 BN8NAM11FT022.mail.protection.outlook.com (10.13.176.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5438.12 via Frontend Transport; Fri, 15 Jul 2022 10:05:14 +0000 Received: from AerithDEV2.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; Fri, 15 Jul 2022 05:05:09 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v4 07/13] cpufreq: amd_pstate: map desired perf into pstate scope for powersave governor Date: Fri, 15 Jul 2022 06:04:26 -0400 Message-ID: X-Mailer: git-send-email 2.34.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: 8d379522-21fa-4f54-9524-08da664982e5 X-MS-TrafficTypeDiagnostic: CH0PR12MB5059:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NBwrBkzcX3NRqll+zFzn1GtO+YHBg6wTwJjht7OfAFCwGG2rZdkALUzntqtc34zw7qqrp2PixW9a/o0y+kssVd4x2bTPCsSeL+3bjU+by5f0xMlR4GJXBaJ6Q1RzAVnplkRE3pzCaXTUS3IY6RONzbuRnZs5TKuvRScOrOwWYorv/lrr/2Pi3klluQfkBmK71K8A5iC8yQD4pU4iobvX9E5aAtlKijOH1BhtmYk36gF6kJJAAzJeit0ORhL12oUqqtFetFTSXJcp3tzK1JdadJn65ykw4nJG/TXk7l1b4Uz9rwBtU81o5qtwordMcyDi7mVV2WjAjwZRzaCVTezLPi/tzIhQjNS7InQRTlTaTVKjetqONeIZMlPT9gpl6zoii1kX9290olWfsV0ar6gbQ/LXVNz6VleEbhRv0z4xxBALJgMf5EdqOOqk1x50hl+r5tYN6onMqHG9iCFDU6oivuASrDLrvBdJiO7VYnI+yZIWd4iZclc7ZTc2wkR/4gc/Uequnc93on5+1iBUe73jg4tUpj/IupbjUNV5jySDRk0F/3HhOIZGjkp1eEpeSxJ6+79/33PyvcsX1t5zIZzk6qC7/HBL/1e7TH1C4LGMHMrkDLuNqf/TaqSWU/ZS+bbnvx/15Lo40dxgpUC+z4pAVMXiwUb6rxtu8jkFSFqRi4HyhmcIs6IGsCV0v2R0h67/xAxzAWSFV1uxHorMp5pUVFDUqkwN7L9/fR/ORoQosrDKOyV7ntwnIlYmOKk4vOFyaa9L+xRTeAb4rvbHNQffeM6sCGhnmZxlX695Kb1rOESqQ1I3tfFJCgcHDRaRr9t8fMZgKDJk/hocTnDsS4UWPmUMTr5CeKLnkiKlRJ8xdhk= 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)(36840700001)(40470700004)(46966006)(8676002)(86362001)(70586007)(81166007)(8936002)(6666004)(40460700003)(2616005)(41300700001)(336012)(40480700001)(110136005)(2906002)(36860700001)(316002)(6636002)(356005)(16526019)(70206006)(426003)(186003)(47076005)(36756003)(83380400001)(7696005)(82740400003)(54906003)(478600001)(5660300002)(82310400005)(4326008)(26005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2022 10:05:14.0451 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8d379522-21fa-4f54-9524-08da664982e5 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: BN8NAM11FT022.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5059 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 4b764870035e..ebc7c6d389be 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -268,6 +268,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); @@ -356,8 +357,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 Fri Jul 15 10:04:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 591121 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 7C5CFC433EF for ; Fri, 15 Jul 2022 10:06:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234320AbiGOKGB (ORCPT ); Fri, 15 Jul 2022 06:06:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233058AbiGOKFT (ORCPT ); Fri, 15 Jul 2022 06:05:19 -0400 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2089.outbound.protection.outlook.com [40.107.96.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09FB782F8C; Fri, 15 Jul 2022 03:05:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QKjjHy2O0lU7z6vzn5b6f3V/4ubizZRT+YznzALlUy/tF4VS0tVj1MypIH435V18gVNskJsxAtK4ExGCPLJspWnix9/Pm+WW8Zut2u60yuwpYMOzqa9F5yBX0Hyl3qbS5TYgbe/WX7Yd+x4Xy3gaFocg/Bdgc/5NIOmwdObFKF0ZuVSmKoEx8TcflVYE7Qkb4Lgf/JFtS8Fir2fvJczsEDRXmEQ3MG8jTBT+muShIpSS5d1TW228oGEqaUcY4Vm15VdllvibqEJG8uRM62tF6UBf0VS76L421bugzgoLiOW/+JyGziDLASJUUEGn7xaIpC4AZYlth4slBGXK7IZhcQ== 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=u7Dge5roJ1lX7QI35KBgccomo6IM3GEDgTMHIK68aPk=; b=WSoFGtk6wjcQNvg6JuNVlKBnWk3iudaxwtTcaBqPQXIsc5fn8W9yXzaD5UrqL9Y2WbdpBO8zbqV8XeTP5nhkyRSIzaxMOVjWGRMPmAhgr2uMb8qnkiXhzFkKUBUpzXAuxrQl2mYw8aOMgOIdWMeUSgIn6Ev/HR/0CXWxbCLX3/C2E/57Z42+eGo0bSWZQaMwg+DkiYH3fkXtphvxVUgvpVQoh6pXVoqjGCIE5MD9v0NiSd77vBDfVXssRy+lAWVfo9BvlorTY5Br7pRDmB00eBsodepEzczn080vbKfB77G1U2utO8fXa85A6v0n05nH1PvFX4h3IZmVR9RfvvE1MA== 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=u7Dge5roJ1lX7QI35KBgccomo6IM3GEDgTMHIK68aPk=; b=GQV1CDkIr9L9ADGozoGhz2VkUmj429NmzF8B8zBO15kdkYYGd0B80YcAVf9yjfVZ35hpsfrT3Wq8gjXLpu/z2HSenDbGH2oif9AHQI4k5mRW+M7ZtIr5txvT34zlq7P87TKLc2eTdMN6N2tDWO4dBJXgx5T2DntgGmhVAi4lBIQ= Received: from BN7PR06CA0055.namprd06.prod.outlook.com (2603:10b6:408:34::32) by MN0PR12MB5836.namprd12.prod.outlook.com (2603:10b6:208:37b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Fri, 15 Jul 2022 10:05:16 +0000 Received: from BN8NAM11FT064.eop-nam11.prod.protection.outlook.com (2603:10b6:408:34:cafe::b1) by BN7PR06CA0055.outlook.office365.com (2603:10b6:408:34::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.22 via Frontend Transport; Fri, 15 Jul 2022 10:05: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 BN8NAM11FT064.mail.protection.outlook.com (10.13.176.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5438.12 via Frontend Transport; Fri, 15 Jul 2022 10:05:16 +0000 Received: from AerithDEV2.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; Fri, 15 Jul 2022 05:05:12 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v4 08/13] cpufreq: amd-pstate: fix white-space Date: Fri, 15 Jul 2022 06:04:27 -0400 Message-ID: <3ef38105e85e6527d14d9d0e2f969fe2ff86ce45.1657876961.git.Perry.Yuan@amd.com> X-Mailer: git-send-email 2.34.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: 8eb14195-4bbb-4113-f62b-08da66498473 X-MS-TrafficTypeDiagnostic: MN0PR12MB5836:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d21uW7vT++9NfRecwURQMPxm9yzgjaQfWV/+7lBW9fUKntNO6C93t7Z+VBSLj0lJkMKww3e/wJG5LouF3/7mN83yYYSSvY/9i6whyHPUmGTzhtn3KKrSVbwS9MZKkRKJrwmTnWFKIGjSOsmd0y3E5JtJwqjUsnxuuQwoS2DAoMyieYsfe8EoVzJJgLcSE5cUK2ecX632RhjXG2quGYscxsM7epJe4Gnl7GyUX34l1/mcHmJN4FuX4O82DUbJACTfZjyAfclR4jc9GIRmXhjnhWnW5WlrdiPtnqe3ALrP+l0snqkMZ2rfRKLNLtz3BnzR9J80m+1+iZByqQ7qwYWONNCwCXeHQ4lM24nnQJwDGDZyHWILPjzKUZMrxEB08HYYZvamsvcTR94PXCDzHysJo+BjR9qqWKmHqv0MOKXokUYtzzYMRQT7iI3nw0UgAEsBJfH2M+a/A4AIdax7xdHoBm7JKbIB93ojenUaUxd5+raB4eZJ6lCyQjEQbg4DTBVJxtW6z8qu+tmnkb4X3JltZ2DZOMLRB8yIzO3ZzKpCwCELwZaccYynVQDOLmt9kS4qKOrdRuxQtAUPnkffBSlauHhYcMVZc4kplx1TATdoMOwxxsS7HSncTztrf8WmB0aH4sUkELe9D/QCV93IvFjDJJEW9d1kUpHfML/VcLb8QaOhJAISY5dibO5WAPOHb9eD16wFnp6sAAyTpcPshy5DuTZu5P7q7Hegf/JtmpXyKRnUdiKhpxT0MYGzyeFESn/5DYilGBV8ZaTsE19ZwI6yclf+YJYUsBQbhoMSSwuh436PP2gJ8bSOH/IKFEug8C4X5fOItZKOSt6g5UPXs1HZUFPQZOzHJgqCYukBHjqLZOQ= 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)(396003)(39860400002)(376002)(46966006)(36840700001)(40470700004)(2616005)(54906003)(70206006)(81166007)(7696005)(110136005)(86362001)(83380400001)(4326008)(356005)(70586007)(6636002)(16526019)(8676002)(26005)(186003)(47076005)(336012)(82310400005)(2906002)(426003)(36756003)(478600001)(36860700001)(6666004)(82740400003)(5660300002)(40460700003)(40480700001)(8936002)(4744005)(316002)(41300700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2022 10:05:16.6403 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8eb14195-4bbb-4113-f62b-08da66498473 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: BN8NAM11FT064.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5836 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Remove the white space and correct mixed-up indentation Acked-by: Viresh Kumar Signed-off-by: Perry Yuan Reviewed-by: Huang Rui --- 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 ebc7c6d389be..acb62ec5ebab 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -117,7 +117,7 @@ struct amd_cpudata { struct amd_aperf_mperf cur; struct amd_aperf_mperf prev; - u64 freq; + u64 freq; bool boost_supported; bool precision_boost_off; u64 cppc_hw_conf_cached; @@ -674,7 +674,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 Fri Jul 15 10:04:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 591292 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 09809C433EF for ; Fri, 15 Jul 2022 10:06:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233085AbiGOKGY (ORCPT ); Fri, 15 Jul 2022 06:06:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233760AbiGOKF3 (ORCPT ); Fri, 15 Jul 2022 06:05:29 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2079.outbound.protection.outlook.com [40.107.102.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DE2582478; Fri, 15 Jul 2022 03:05:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kV0dCyG2YbpVJla2YvlsMFdDBph2gJ3or2DKS1ZtSX9CookuhFghdoqM5ycdSXULxJm2f8hVu/N9gpfLjgizdz4ABN5c9XH1+goKSvahd5sF4GXJO2erA41DrRwPWICaOlBArDGb1d/RZmuyhGaL+jSlmbkf+jus+wz1J9m7nPO1UQGvOR41a5ltxxXj6kLjRIsEqwItxrp7F/ka9ulnpHf2fDt565De8AfQtLRMRS3kj6grckM9/XYvyUk4SK9890+kokZ2RLx6PVqsZXROAOOaGGq/w0w33lC8CKtkgqg3vAizQ3k/AGYiGgYGACuwHxxZnzUFdPiU8L3CGVzTtg== 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=rCg4mNWv6SPudk0gzXx5yyZeZmHTwUTCNXKphpEyDKU=; b=mOlMOQ3vBOcRlAHPuP2F5eLY6OyEaJ3WJTZPMQyQO5HaFlOLdmx2/djS+akXBWnaD22dGFLZDrYJLt8zLbhtkQVDhtScwQL6u4Wwbp0Pn8aO2DRIH84goKbBPoDL3fynyYwHPpHqHxHimcLe96irbjxf8ORkoC/qTnZCekyoUrNbHlTNTxx/SY0ahgjVxTZvAVx8gHzb3731qRnznSSLR5R2W0DJ+csmduvB8HmPDYFUNB67Ap+7U+QpWZzqvhxugvFz3jIQsX/v6uGOapzcgrfllCvX7VA1Ap8mWC/jpVjHu3Bon0iWzqiz3LIM9vXXlj9G0hYWOqBIdsbfcoopDA== 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=rCg4mNWv6SPudk0gzXx5yyZeZmHTwUTCNXKphpEyDKU=; b=JFsCeGVR0UCboH+JMI9sHRaUBXDEe6btHvfCjbHnahhKqNQ07WgfH2+hRvagsAk45odSSXOgFGnDBfz7JZfRTAYHzIstPuyWYKX3J0g4KYmUzrUB3tb91z42t2MHLdFQgmxOKyPk1UDCLUalHIUSdiZwEK5ieRY6YRIuSHEBfS0= Received: from BN0PR04CA0177.namprd04.prod.outlook.com (2603:10b6:408:eb::32) by MWHPR12MB1599.namprd12.prod.outlook.com (2603:10b6:301:10::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.25; Fri, 15 Jul 2022 10:05:20 +0000 Received: from BN8NAM11FT004.eop-nam11.prod.protection.outlook.com (2603:10b6:408:eb:cafe::ba) by BN0PR04CA0177.outlook.office365.com (2603:10b6:408:eb::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.19 via Frontend Transport; Fri, 15 Jul 2022 10:05:20 +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 BN8NAM11FT004.mail.protection.outlook.com (10.13.176.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5438.12 via Frontend Transport; Fri, 15 Jul 2022 10:05:20 +0000 Received: from AerithDEV2.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; Fri, 15 Jul 2022 05:05:16 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v4 09/13] cpufreq: amd-pstate: update pstate frequency transition delay time Date: Fri, 15 Jul 2022 06:04:28 -0400 Message-ID: <507e6164192c0922d3101591edc6ba39f27556a1.1657876961.git.Perry.Yuan@amd.com> X-Mailer: git-send-email 2.34.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: 4c99f981-20d6-4570-6274-08da66498695 X-MS-TrafficTypeDiagnostic: MWHPR12MB1599:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 95Vz2HQZcUs5SFDt2dfmE9qFF+d1uUTWHlIkErb2rEbDwG/MSjkYY4m2N9AsYJluLiPgvOf0lG7dWcXTFSYrr1sh1ixRAfXHT7o6a8Xl2AWkiGKhSD+xzRIOKEDC8wI66Ef+ZW/XNqyRXxteabglk0QNBEbys06FFydljoebErLcqoIDftp2BUGA7V8seB0lSxrigtEoeCcvo33amMcQ48eljfxWbYCeEzApKl0lZwSQ2do9Gs7m48OT0gzqzRr/u4D25+ouwxMjYbjj4RGt3GoJvVkgzkYilSa6+ygVTNk9uAuUeZc4UGsAdF4DrL6EZy+9ub/fzu7QWkjv1GRLGiMBiSDa/LEvdVboVUCJGE48y+uuumS5hnEyfQkwgJ1ctGcxZNFsEhG7IPTDTzNG1l+UUl8V3BdiPfGBVl4oyMzoAe+zc1tjpPWBNss2sq7hwUpny0FNcb3isob+lcBc0tepagA1/3RTsmcm/7a/xjg/RhnK7kYqI4NbE+Kw40EHyN66p7xANWNJRGw25FLJ6Sr6JchKnDdR4G/7fSfwpg7Tmt1fc0ke/uSa+YVH5c9N1KuiVftCRz4y7cVMfyqZkIUxRFMV6WzLIAktTaNrp8NG3IlAhKMjNtpbtZXWwkJBB3DjM3qbmniXwd3+KfuKhAWNDCcLXI1d7hm4a0xiG1BKKsq06rsQ+Vnq+evHHsjFKTASSoOqyUSwgZiRX+dKZps2z3fmH6zc5wpNS+4BMQ61YZePQnx0TkIOX8sInAWm7/fVzucbxzPkHRbLIJbyyUG7p6WbaapGU9avLHuTZ41Ihu5vJMY23PK0FuAs8Cc7uieIzCLleQ/H5YUpQfrVPNLJ1+kjtb8G+bwKoxM/NuU= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(376002)(136003)(39860400002)(396003)(346002)(40470700004)(46966006)(36840700001)(54906003)(110136005)(4744005)(7696005)(41300700001)(36860700001)(356005)(82310400005)(82740400003)(6636002)(26005)(2906002)(316002)(81166007)(36756003)(8936002)(83380400001)(5660300002)(70586007)(4326008)(16526019)(40460700003)(186003)(8676002)(70206006)(2616005)(40480700001)(86362001)(6666004)(478600001)(426003)(47076005)(336012)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2022 10:05:20.2304 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c99f981-20d6-4570-6274-08da66498695 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: BN8NAM11FT004.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1599 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. Acked-by: Viresh Kumar Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index acb62ec5ebab..c29d36f56ab4 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 Fri Jul 15 10:04:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 591120 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 2C8ADC43334 for ; Fri, 15 Jul 2022 10:06:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233335AbiGOKGZ (ORCPT ); Fri, 15 Jul 2022 06:06:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233750AbiGOKF3 (ORCPT ); Fri, 15 Jul 2022 06:05:29 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2042.outbound.protection.outlook.com [40.107.237.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D203E31DFA; Fri, 15 Jul 2022 03:05:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d75yc7YIlje7lw/RaH62nCFZVJlmfBHuhf0wc5AkmiYLfrvZzgpZJqsExXg7uCUia5u0WVj+c4gz+0+/N1WtoPIPEqkBNRX4EYnm/ROziTy+oAy72aLntP9ksdu7wKEmQrRHeJHJYhVws2hm3ssHxZg2EzU9V5AXHJl06jRL6bd/8OlPZf3Ph+lmMkdJjUaQXnIHOdC6Z82kjkYvLKsvgNxshJ2uB8aEdGBRj1i/MaV9ctWTcxNnJAIgm/LpThCHwmn6201z5DKR3Hr8YBzJ+AfOs5SKX09rOb0FtAXhn6QBHKAcY5y/8QNindWQO/E9Ugny/dcHY5rPHKf0N8QNuw== 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=vCpjWS95V7cNh099uTMhHdGGmu7BXkk3H8grHTVglIw=; b=lU5bp8+eZVY246ksyhBTJ7mpSY++UtGzrQk98ymPfERodPszj5hp4dzQ7I2KmeEXYqVUi2O9KZipNz5KIkMEzZZ5Y6uZuOsJ+xEXF5YtO5z9WKFd4ELcd+Xot4SpT6Wti2tWplUgCqchNbrgSuZTnraTYn5NMzlbx355eap8JwaId0FVp2/IjZz0TdCq7sDmY8xKairLK21oIrpC6kXQ/5v8R06jWcbgp+SFh6rcKx1vlKE/QqnsPcgmme4owVI84JkWeqf5vaJdKQdam+UUK9loprNIN/7neYSmOUJRIzGSTnnIpApLcHAYHT1HOxZnFuZr2/OlJCYO1CitJw2hPQ== 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=vCpjWS95V7cNh099uTMhHdGGmu7BXkk3H8grHTVglIw=; b=HN2Dq6dGLr7mL7kqCJGt+aL7hZ+yDnQ2nGYAPu4xBQFr4Gv73JQ8kdlempbz6xUBhV9ia1hTSqj7oz8t/M8LstM1/QHDxiWmk5GJjVIaK9MYG9psU8Anv5L6W0PFOW5wj7moY2XjEsjuUvYqmVmRgt7mzr8rrFxCwXfGP4XEwdg= Received: from BN0PR04CA0152.namprd04.prod.outlook.com (2603:10b6:408:eb::7) by DM4PR12MB6254.namprd12.prod.outlook.com (2603:10b6:8:a5::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Fri, 15 Jul 2022 10:05:24 +0000 Received: from BN8NAM11FT004.eop-nam11.prod.protection.outlook.com (2603:10b6:408:eb:cafe::19) by BN0PR04CA0152.outlook.office365.com (2603:10b6:408:eb::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.17 via Frontend Transport; Fri, 15 Jul 2022 10:05:24 +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 BN8NAM11FT004.mail.protection.outlook.com (10.13.176.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5438.12 via Frontend Transport; Fri, 15 Jul 2022 10:05:24 +0000 Received: from AerithDEV2.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; Fri, 15 Jul 2022 05:05:19 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v4 10/13] cpufreq: amd-pstate: add ACPI disabled check in acpi_cpc_valid() Date: Fri, 15 Jul 2022 06:04:29 -0400 Message-ID: X-Mailer: git-send-email 2.34.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: edc285d5-146a-4879-9f17-08da664988e4 X-MS-TrafficTypeDiagnostic: DM4PR12MB6254:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kixG5VTtKQV8/SZiGdm9uvtKQp9Yca85INxCdb3J3iFK+dwyPR4U4LhxyhyxWLs3FqG1cmFTIq72zEAgvfSZenr2dWacX8YEDnHftkvylqrVU5jznyTgPdgf/3jqlcAO9xDPv04gSA+JVel6BH+SNKurYMEeLy1N92jLFED8z5HObrROMyMFRRu55uPXTwmh2kSOd1JqeBst0bJW5sFYSBf8s1mgCkTcM6MqB1rwqSjiDNXFg5fpVjPsEF+YYgoYX1dpIIywGLN5hysQvuvNBdZg8dbbU9PCqdgkbm3PQ97wLJyh2oRP4tzjW22nXHCS2U1bxQKZa8JEBK20iWb+v+1xz3+19MkjpraNDMpgPdonNfPtyNtWjcjU+zv4QCJ8Vn4bTkVeAyL4Nk2CbKrGZxscUIJC0kDVtfVjB879dtCdDMZH5CHvPSlz1sEHSaHJkCSuoEsIsZtjzCtfsTAToEcX49pS5nb5T0fVbhsI8A8lS5K2VN2JkQO1djtkbO8pb0jnpwdxYJ/potqzeOrPSuBDnalhAHxZuh8no/+RVsS5rkHwu5diPRMWAhRZ+ED8eAkQFepYwYReqDLSQasjCxJkDMwFP5gg7m/bXN4L2fpq+ILeM7pJU+XufBBJzjKJSy7Jk+4DC3ry7ecYd5XwCfIa4Ekdgewda3SUAlqQKM/f6wIlhrJxnzBGnNzztsTYV/vJq1cF04VD1OuTxS4fEQZ/h2WO2PNl0R+XlCI1plRCuf6ggRhJr1UCbOFJsgm8rRTVDbLrSw+Uksj38UVzyLpD05SSniwbxDakRDBqH76yioPQHPxXdhGFJo6RKscLaOe4RKdQ0BhWZZp3cjqm/HSzFR5ar9YuKmzn6yPc0ZY= 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)(136003)(39860400002)(346002)(376002)(36840700001)(40470700004)(46966006)(336012)(478600001)(81166007)(82740400003)(36756003)(356005)(41300700001)(7696005)(70586007)(186003)(47076005)(26005)(6666004)(316002)(426003)(6636002)(110136005)(70206006)(2616005)(54906003)(82310400005)(40460700003)(16526019)(5660300002)(8936002)(4326008)(40480700001)(2906002)(83380400001)(8676002)(86362001)(36860700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2022 10:05:24.1051 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: edc285d5-146a-4879-9f17-08da664988e4 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: BN8NAM11FT004.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6254 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 c29d36f56ab4..4f8600a36194 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -685,7 +685,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 Fri Jul 15 10:04:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 591291 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 BBFABC43334 for ; Fri, 15 Jul 2022 10:06:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230245AbiGOKGd (ORCPT ); Fri, 15 Jul 2022 06:06:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233824AbiGOKFb (ORCPT ); Fri, 15 Jul 2022 06:05:31 -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 13C2382FA1; Fri, 15 Jul 2022 03:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Klvv8E09ggdKzUIJDSArKitNAmgn27qp2+nxmSsbFGiFMYMnB3hyU8xsRdmw5F9ibe8BZRQvdkp39A7xFW/hy2uvMwzArFaIg35UjoWksB029hAyaDOLtrzjBzmU1jo+ZRHJfxUz5xodS1KQ+SrTFG35Sfdyr3i7vIDngbZWQqgX2HwHHE7WskTyGm6jOrGydCXRG7DKo5OAsT0wnb/gR2qmqHViEDik0qXhW4FECUhXPLd38dm5l8yah2dZOWwCTA21pOs4NLvTg5m71WJkmoMOk3zX6Xc6ccGAqduU8sfknUEIEKdSyM8eZ3Uoj2Zy+/qKYsBEyOk6PX5gBTh0mA== 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=MyEfC/pQFjsoMpJM51dDEFp+MNBMAA6Dy+dVawzhXM4=; b=SSud0UGZK1MZfwz0/o+8ieQDuwb0UggLDCITBdIu5fQbjm4vjH4JR29LBEhRTqa3+xk1ijqC+fRXS/JY4vPNdHIBbJmG8SiEcr1bc/76DP8UCSBR373EH5YakCLfTQo7N/MisSFuMgEKJeGyAvlaX/hMDln4NbkyBBLjUHF7bjOl+0HL2/6X8+iz84PcUD9xuZwC8ylN3DmYXMKr1vC1+ovjR/uOoe+dXqqYQhS3VZswGiZWyc4Fr5jxYLwrpwt7H7E8Rbh6JGjgseH4sPOHa6SKBuH1g9E/gLgQiRmOFflruc0bUvtRcvK5NhJk95YLbnyz+ulgBabM/ZEN10jtvw== 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=MyEfC/pQFjsoMpJM51dDEFp+MNBMAA6Dy+dVawzhXM4=; b=4yTaH/J40ij+p+HA2aD2sw/N1GWlApyk7JihaDBWdGMIYvLXVwSiPEB/9yoWvmh6L889yzWH8oh+F7ZzBPa5ksxYa4k7W32pw1WVx5eNt9aebeatpSlT+qGQXNDCv8h4OmZff7qfZuBiXH/doE39sdc659ztI344VMTzuHknPXA= Received: from BN0PR03CA0053.namprd03.prod.outlook.com (2603:10b6:408:e7::28) by DM8PR12MB5446.namprd12.prod.outlook.com (2603:10b6:8:3c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Fri, 15 Jul 2022 10:05:27 +0000 Received: from BN8NAM11FT029.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e7:cafe::ae) by BN0PR03CA0053.outlook.office365.com (2603:10b6:408:e7::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.17 via Frontend Transport; Fri, 15 Jul 2022 10:05:27 +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 BN8NAM11FT029.mail.protection.outlook.com (10.13.177.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5438.12 via Frontend Transport; Fri, 15 Jul 2022 10:05:27 +0000 Received: from AerithDEV2.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; Fri, 15 Jul 2022 05:05:23 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v4 11/13] cpufreq: amd_pstate: update transition delay time to 1ms Date: Fri, 15 Jul 2022 06:04:30 -0400 Message-ID: X-Mailer: git-send-email 2.34.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: 093b131b-543a-4fd2-e094-08da66498b04 X-MS-TrafficTypeDiagnostic: DM8PR12MB5446:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: umle0qvW+COktyUIWFy3Bk0aS2Yc/Qv1WMLK41dPIEe1spXYbvoS0RFkwmjG3urx4BO3546b/A6EfKpEJPxq+7fXHHjIQgo4k4JQ7H0Y2uqZeeGAy/PG0X8NgB56Om3iFdCZex8v0EQDOxLqpJ7IwbOKYfsdEt7M4JJ5PYR4v3Zxgthopgoxz9TjkhD+/yL5yLP2+naugo9gplblngvYiDh6ug+T62PVOeHnqkx+6EDLmjaxc4qOnSHcT8SwA/0Fr+3CgBtfAqYemcERuCsQnBLl7PooX40EuMCfVGX6FYjK+MSbdZLCxYIv3JGRcv/2IH4ns3eWHKTpvIu6Z2mcVwER+PVBc26BX6NRLT2CMBeO4rUtxOhzdrxfPunmOzYsEjl36PfqHbv7I/ygkC7sE42+W9O6OW4GtaVa/KE8hqT6SggHgI2cd23Iw7re93hQ4QlLM6kjP00QqxtqjRIkHWvTXT+Z+1Mb6OSi5AoHIWcpmY/A7iOhaHW7PyoLRnUHemxrtIYPaNzK1yVcNmaCaCQiuE0pAjifTEOPT4EMgl6YhxnIEeR+mbFywtyXijE0GRScvmwyRdMat0C1sM2wGxvZqXnIuQnk5R0eHF09iHnkW0XwSlFxhld0o8Lh/3nrrE5i3ZKuklXcTmQSWFWdNnDE1D4Tue4TiD1VvqvAlVUxrxqY454O+1XzTZNkvYUxYyRjVN8F8wSCH9Ytrl63SBM9u4e3kVM0aTmjAHaaYtcvVwqNg7RUsCh1v53q5kJ3BN7XU5HbOswvtsMU4+JkB0+ZwdNrQgphxO5IFVBf6h7R3CsMpHje1rwXJDpGY2qVcakXv5Ap6WUKnXbgqnArUA+WvlJg4idqHzAe0N2cR4c= 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)(46966006)(36840700001)(40470700004)(70206006)(36756003)(5660300002)(2906002)(16526019)(426003)(186003)(47076005)(83380400001)(8936002)(15650500001)(4744005)(336012)(36860700001)(4326008)(70586007)(8676002)(110136005)(41300700001)(478600001)(7696005)(86362001)(82310400005)(6636002)(26005)(316002)(2616005)(54906003)(82740400003)(356005)(40460700003)(81166007)(6666004)(40480700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2022 10:05:27.6563 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 093b131b-543a-4fd2-e094-08da66498b04 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: BN8NAM11FT029.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR12MB5446 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. Acked-by: Viresh Kumar Signed-off-by: Perry Yuan Signed-off-by: Su Jinzhou --- drivers/cpufreq/amd-pstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 4f8600a36194..d3bc441b3923 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 Fri Jul 15 10:04:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 591119 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 0F6B0C433EF for ; Fri, 15 Jul 2022 10:06:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231411AbiGOKGu (ORCPT ); Fri, 15 Jul 2022 06:06:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234283AbiGOKFh (ORCPT ); Fri, 15 Jul 2022 06:05:37 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2040.outbound.protection.outlook.com [40.107.100.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DE0284ED0; Fri, 15 Jul 2022 03:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bdoeqOtJIaTCp6oK7j3z0ICQbkv/H7t0uH4lOU+Cgq+In4SyP/yejq0RJCSzxfRcMjwSsDMkBnxZsVtBHhvRC7PcA/SQlv38aAISFwc2Oj+u/lLTurjT2RPwQ8ELMlexwENrheWhBuG3ECAnNJaWycyZQyolfZoWDTD9E154Zdm+KqWYk8hfW88Y7Nzvz8ViBKxHFwsptM+EYXClzJ7HfgtyNjVyA7AFUQCqGVUrb/kpzbEKbagq2++8/T+hfI7nB21oOHtHS5u44Ei3ytCTSzA3vnjQvcBjfPpMqJVFkOEVEftx18LyP2bO2jiPLJU3rmygX5FIFIWbEyaw7Q54ag== 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=lYjL+dKiCfASg/bPbZ75wr3KzbdhPszKwAUG3evHkg0=; b=bFYrIXs8AExrc2JstdFCwA2One9qAuihPRQ+C19ufuYjINnIAdln+F1Vu6EZfI7oO7QTHqyW+6SyouA+syOY4bPS1q7lMqPMjbfdwkEit6Cpe+Qq/bCbeh/L55/80wUeYwImsIEvu5rq/B5nk3I8FAcTiVBakaPII3se/9yAhspf8c3Rbvy18ozCCw7nFop9QaRTc9z/zyPksheDkph5HaeFQu3FnujIqJvjvHvkOFDp0TkMONnnAcyLQZrivLik0OVDo5o2756/fZdq1dXUSZ6Nl0k7QFsRCsr19FHhc7bSWhucPgqsWtxmTv9VTrXOFCGiEJcxxkFaWHZgwCeYKA== 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=lYjL+dKiCfASg/bPbZ75wr3KzbdhPszKwAUG3evHkg0=; b=MlkCGiuV+fgbPNvxuVthPxXWmNhmD3aj5uLmqwIca7EPLuboU9bafC9VuNWcl1LsHjPjNx5OwRtl+xLJX1hVXHmZYCsGNR3tdT4tzQba6qzpDtAuHPImabWILa3UesKlTiIzMZ+pMJpcRv4N71pyVZ2+M7ZY/J2ALFQW8M11/ho= Received: from BN9PR03CA0409.namprd03.prod.outlook.com (2603:10b6:408:111::24) by CY4PR12MB1799.namprd12.prod.outlook.com (2603:10b6:903:11c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.21; Fri, 15 Jul 2022 10:05:32 +0000 Received: from BN8NAM11FT041.eop-nam11.prod.protection.outlook.com (2603:10b6:408:111:cafe::91) by BN9PR03CA0409.outlook.office365.com (2603:10b6:408:111::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.19 via Frontend Transport; Fri, 15 Jul 2022 10:05:31 +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.5438.12 via Frontend Transport; Fri, 15 Jul 2022 10:05:31 +0000 Received: from AerithDEV2.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; Fri, 15 Jul 2022 05:05:27 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan , Sudeep Holla Subject: [PATCH v4 12/13] arch_topology: remove the acpi_disabled check Date: Fri, 15 Jul 2022 06:04:31 -0400 Message-ID: <84ed5051c2494f7ec25317b6857f27b8c6f1b6b4.1657876961.git.Perry.Yuan@amd.com> X-Mailer: git-send-email 2.34.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: f3054ca7-a417-4a0c-2402-08da66498d48 X-MS-TrafficTypeDiagnostic: CY4PR12MB1799:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mYVcgp3I2F3Senjo6HbrPa9Lhc2OVLSmzzv2Euf4uZJZwx9I4m98FGV7oIdnnbhB8tkSPStMXtJGumnohWxangu3QrMKPucxMYhFYoRntInsuZu4+yZQIfu2mAUYFmPT2nfZsG0UzZ5zic/NMjldDI3Xb6nzCR+UoToBiMe36T3cSIOdHoz8H1duASHB4fgdKir0uw7zRDOd2nyRlYvCCuBHN863PSqFgh0upt+d5bvwHDpqA7EZCO0MJboyitcGyfC7BZJ34tHwvi+OidQswFhKQEE8oog3RYiVLkb5CjbtTiZ9zkQKIOmsAwnswaezyE9o/30qJzVBjQr6djyhqdegP+SXV+29tmGujA01IgAbG2z6nDfsxCw5Q6fGfewP43sZc48b5s/4NB3Vxzn6DQpsVBDur/SGXVKm4V8XBbWfxYhj1JvojIOrTG8Ko2jVpsv//cLi15Enkn70exQamzqCgwl7DgrNyciUI4WdhK6RbIvXAen12j2i/+fcM8lK+U7R/mCvwxNEkRwcq3LSdWn5ENjTOZ1YD+7CCWIyjlTZb/2+y+Dc4tN4SJnJAE7BKTdLwjN5OY5sfQUbFrPETs5q3i+F45P/Wk1E+zLl/y7XNnKslXwfF+M8hYewZ0XiEgLmDT2N4KIJzafdGnWsNgd/jLfvR1uVSVQNlncJMcFsMd4niMQDX1UF02+qCBd9f6wXyFCQvUXkT+Rom+CfaarDtkq3z7IrByx6B0ONgUTF68F2pvfrvfXB+cGVpEII4TDgLiDyJf6r9MwipUCAGX0OpMdRu+dtDdqlq3gN4taxLoIGnL3JpVuZ0Jv8WR/7wXEGljtsk28cfBfNh0JnG1kDG0a75t78PqcmPkobo5w= 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)(396003)(376002)(39860400002)(136003)(40470700004)(46966006)(36840700001)(478600001)(356005)(316002)(36756003)(6636002)(110136005)(86362001)(2906002)(54906003)(40480700001)(336012)(47076005)(81166007)(82740400003)(40460700003)(70586007)(426003)(41300700001)(70206006)(6666004)(16526019)(5660300002)(83380400001)(8936002)(7696005)(2616005)(186003)(82310400005)(36860700001)(26005)(4744005)(8676002)(4326008)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2022 10:05:31.4682 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f3054ca7-a417-4a0c-2402-08da66498d48 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: CY4PR12MB1799 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 Acked-by: Viresh Kumar Acked-by: Sudeep Holla Signed-off-by: Perry Yuan --- 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 Fri Jul 15 10:04:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 591290 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 95916C43334 for ; Fri, 15 Jul 2022 10:06:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233318AbiGOKGz (ORCPT ); Fri, 15 Jul 2022 06:06:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234302AbiGOKFj (ORCPT ); Fri, 15 Jul 2022 06:05:39 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2052.outbound.protection.outlook.com [40.107.243.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB99F76970; Fri, 15 Jul 2022 03:05:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WmkrpkE6334vOXUNvugux4jJzpooCBsJcEVrr3/MtCVn4WnnlFgoXWdZgDToSv6UQ+kaDJA6wCK2ajTtiZGP6PQUAQzbR3YmObhrJ/sLOiPLwgYZ++nPDr7a9s8xMOY0lVyHlj0FkfagHuHR71XJOWue7xTefWKLiYCDbfaYDPDC3ZUfya621NuM5Ov1A1WV76wF0Ez4FnMvSNE5x8fgHdl6Z/HE3cO0nZjfl4VcGD6JPgkC6SuFFhljpb3y1LW3Wo1frqYi5gVWpoinVeADqEyTSuA1HTwaztqZUVy4opHuYGuHiNN8i+/mIEpUns+jQ4BDuAR9vUyJb4ByYW5IOQ== 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=OEyFi4Da/GHpOR6B5nxXHPlGMMOY1maCq0fjJDPxWNU=; b=f1nxTR6iapLs2Y/WL1i9nfmfYC15d5ywF1dAOXivC11o72xqzHK2GtXI6ieJQZBeLN9NA9UOoiF0plY1xPFJvlV8fnDuYaTO1xtVXAh0+oB57lx4cWm/aAP3jashbTkxbj/Ne4QmapsAZZ8uPsHsVh7MI3TSLbSSj5TtNyYMRXI1x4hgibUlep2sZh7muAuURhJTuqEk+Tj7sx70q6/ad/po81s3hY18Wwq+DudGgKn5r1RW7qzaHMe0iYxX5ljx58GaFKd+W/PQWumlTjE4Mpa8/QX197sVWrb4ZW//SsW4Ut6Sj1PyMJVGM7AnMt54jwdxbiNp2Si3yR3/CHByNw== 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=OEyFi4Da/GHpOR6B5nxXHPlGMMOY1maCq0fjJDPxWNU=; b=r9OZDWrnYH88dQgDE7vGVSpkBjFmzemstYRCcYEYym7jlqzod+EVvv+d4xvvKKQGYTOMCeXMi018FzP0mePpIbkXSfOTByR/ISqxOcpJYubhB9fXp2h9nlDHK4056OiyhMtZ1TGEUEa0b2yQMHvi54n+rxaSBJFv8oZNLlsTXGI= Received: from BN0PR10CA0010.namprd10.prod.outlook.com (2603:10b6:408:143::14) by CH2PR12MB3766.namprd12.prod.outlook.com (2603:10b6:610:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.17; Fri, 15 Jul 2022 10:05:35 +0000 Received: from BN8NAM11FT068.eop-nam11.prod.protection.outlook.com (2603:10b6:408:143:cafe::68) by BN0PR10CA0010.outlook.office365.com (2603:10b6:408:143::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.17 via Frontend Transport; Fri, 15 Jul 2022 10:05: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.5438.12 via Frontend Transport; Fri, 15 Jul 2022 10:05:35 +0000 Received: from AerithDEV2.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; Fri, 15 Jul 2022 05:05:31 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v4 13/13] cpufreq: CPPC: remove the acpi_disabled check Date: Fri, 15 Jul 2022 06:04:32 -0400 Message-ID: X-Mailer: git-send-email 2.34.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: 1b3252ef-f5e9-45d9-464b-08da66498f91 X-MS-TrafficTypeDiagnostic: CH2PR12MB3766:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gsqCj34CCGJG13b+winLmD6wi7CuKuDLzBSE37wUBWi3X9HRte4/rrc7IBXS/qSa3PZ1BwUziKiWkM+0caegqk8Kiv1nWqb+TX0eAVf/T7c/OQGgNk+D++U0PUllOOEmgsa68nSeKfgWTFXqvHbB5ynM4xhvvGc/XUv3HxQwDT/VBOA7tEhpYhxfOu9l/jWik9KAjNAp8zQl7FhZ8O8uhjygCNdIjYTftMS6Zk/EPAXP4RY1VkLE5NV3BypylHnJigT0/ALBfMhOK1VGrw83lhFFvZLOUEad7Q1ACcoVI5JL6+MY8DImGKDjh1G/dzAWwXN3Ue2VHnI/bp9ql5xM5yquWD0BK3LzQ3HWxp+zWEBEXDrMOlZ1Pk5YYL3N2xck0PS0NDaCeURYC35MT2DRfPCL627NODqzVm7pJot/MrSOByJyANbsGOSlQ/sBB29E9Xf2z7BeufcNotCu7kGWBXfyynPZjxcU0xjUFOD05KFXwXQtATdkNAlZdhfNyOdz5Oao29Hc7Kt8xq14dWTAJh5mbtYHc/HIKyebReA7TOKh3Q50LqoNAmgF87CGKVm1135r+ZVpbB/5rk4GvnOyHViLkUsi2wpPnJhovnlgEIOdKyXEqIu1bY24dMYtTJ2CclDAQfSmnKoTZ7mnTG7IUx8FIkToG7N17uY1OuHE7+RoTHMOfr+2DtAXPQlj4PRL5h4wmLj3UoH0SKMqFvt1BqyS93Au76wrfe6+reMiLKBOhi6CT4U6VZbHLAjb0m4Pd9n19E6/+YAYrDjc6I6Q6vjiaU6X7JYj2PGkNLUa+ipg7LZgXioji2L8hYbKsP4kC7GHoeMIMQ6zjtKPpkhJ2WqkqzNGZcscvIBrjzo1sb0= 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)(396003)(376002)(39860400002)(40470700004)(46966006)(36840700001)(478600001)(41300700001)(16526019)(186003)(2616005)(336012)(81166007)(7696005)(47076005)(356005)(26005)(82740400003)(36860700001)(83380400001)(426003)(82310400005)(4744005)(2906002)(5660300002)(8936002)(36756003)(40480700001)(70586007)(86362001)(6636002)(54906003)(110136005)(40460700003)(4326008)(8676002)(70206006)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2022 10:05:35.3029 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1b3252ef-f5e9-45d9-464b-08da66498f91 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: CH2PR12MB3766 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 Acked-by: Viresh Kumar 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();