From patchwork Sat Jul 9 14:17:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 589699 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 93587C43334 for ; Sat, 9 Jul 2022 14:17:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229491AbiGIORo (ORCPT ); Sat, 9 Jul 2022 10:17:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbiGIORn (ORCPT ); Sat, 9 Jul 2022 10:17:43 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2064.outbound.protection.outlook.com [40.107.244.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E4E9CE32; Sat, 9 Jul 2022 07:17:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=abJ0hZEjpx8Xaf0nsJ65qnk9gEtWof1ToIf63WPlRp+zfEyL/QFuC5qo+mtPDY9PB9P8DNtRUab8rpB46RbVCYIflNypYbg2Iez3EfUAl6m2KAz+7lUmTIe3cCWOuqJ8v9l5NMxpponfrKWR6/vgKrzTO7EVj/8v7Tmu4JFfJ6/L7BruMAeDFf4YBlfmXdkehTOiKToL67oV0M2Yzvepiu5ywE3lWdyBFUxgcig5nW7S5G5mZ60JaohABQqHfM5cs9AETqrHzih0NVKWDEf/XT722xg50HMRLjXEt0ga/UieoknLp6fyhSt/4AteuxUe/q03G1p8HmoRgBNbm2lXOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AZjYVInbbsLWr3JkIKw3CSb4z2A1d1LNPl48JfqA8SQ=; b=cwgWpJiMX+yGsa9x3NpFylPcQBW5r9W7r2LuJoHaNPEaeDR1QS40c4/acoUcOHaTQERFVxn6ZMVcAEHkwwAGG1UBl+/s/2v36h0xcIOS07gs1s6NYslUHlveVgBN6j60xx3mCbK1YRlJoG3OIf2qlYxxZkQ+qAfBGuDLIIpHaHk2h7r/i+WNvG17E3cykCuUc8uJD4AbGT5KKWeuYrZK9xGcWYYH0DAb7/gfOB28uEpn4dIPNAxGSFEhtkS5aHXH4u57nY5l43i9kK6tsSu3UY71R6a+g7ksDToGAe6Cln7ot0y6Ymh8vsG5Kq8kPeZwwF7FdmVdWB/aXSc5pDa0XA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AZjYVInbbsLWr3JkIKw3CSb4z2A1d1LNPl48JfqA8SQ=; b=Asdlz2CcDpogbFBDCjtk82MgloQMfc6oqiyCa3rO0Grsh4b3pjrLl7QGktnWjpJcSo8v5q4A51Y4qMxzuCqJDK4r4IOCJuJQG5xh/gH5Td7ngT4c7fsmxi65RV49jyql7oOjEA1Iw3FVr/cdmGnQdGoMrCnhmajJfk1MGPfj7gU= Received: from DM5PR06CA0096.namprd06.prod.outlook.com (2603:10b6:3:4::34) by MW2PR12MB2396.namprd12.prod.outlook.com (2603:10b6:907:9::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.20; Sat, 9 Jul 2022 14:17:39 +0000 Received: from DM6NAM11FT060.eop-nam11.prod.protection.outlook.com (2603:10b6:3:4:cafe::c4) by DM5PR06CA0096.outlook.office365.com (2603:10b6:3:4::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.17 via Frontend Transport; Sat, 9 Jul 2022 14:17:39 +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 DM6NAM11FT060.mail.protection.outlook.com (10.13.173.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Sat, 9 Jul 2022 14:17:39 +0000 Received: from pyuan-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 9 Jul 2022 09:17:35 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v2 01/14] x86/msr: Add the MSR definition for AMD CPPC hardware control. Date: Sat, 9 Jul 2022 10:17:15 -0400 Message-ID: <20220709141715.834713-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fc3f1730-c20c-4c67-4a64-08da61b5c7c4 X-MS-TrafficTypeDiagnostic: MW2PR12MB2396:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sQi0UmND7ZvbthNm5x/kRKw5khRSuu194UX/QqzdSnx/H+Zb/M5ER2fZ3X8kry63yrbrDxJxp5ydnAjCFCmq1OUe6o2pyJMK5iatNWlkJQ4YdncAaoHxlKWqpFgNib6rMQX5gV7l1IRpl6MjkOqwilAHk432N/6F3n4qZHmeYH7oyNEQ+x3OEA+b8nLJv1Ja9usGXsv9dhz89eMD5IrdCWuAMbmg/BZPbBjtydOri2jx/LoF9RAyHSVmTxj+uA+PRulaK5Rs3NtAzIUeZmtX8lTmyUen6QTPvRCiUDvY0j9d+NwZyaGB5Lb01MdxzrtRGUIzl36rgVf5a15WTM23NZ6tDtD1zc2VA+7lN43VVusJ7zEKOzD1puqHjG35WSqwVPqBWmY50Pz/HfbVcvQMLaLfbTAVMtTJwmRQUL0Wa7+eOknyOGorvbyoqNgv7YZL0ueaX9h8DPCeORmPFcRHrXiBHMGPVbCSlTok9ck7WFKQMVQfjrHG74QrdrjHaC+EzBRZC0UB0gdbVnACOGx8CBNT1e9kWEdPUuKWp8veqjtihdbm5vDK6Q0I30JRSuK+VmuRbah4UHYV7snrSgXAAENFRHl4Z4CkRWNQV47/Spwcu6p+3N9RhWmGI/hYaX3iGxKhlJ151UALu3T+RNwpVLNcFdoTKHUQL4SJviJK0fqbuGJgDRoPXJGjOXuBIthtWe6/x9ixk9OExOnXnjeR4sTuz8jE0J411GLE+R/UGUI19xYAajNGl/WImX4vQa0h93DyO/zpxFBfEPeB6niqN4jZOYDs289cfY1uEh80XfrfS1PbE5ZtYidI1b9ZDNvDcXQ/GDzYET8s/w15W/allyPExwZZ65Rahahdp4o/tbty8Rf7s0M4RVWp7A+klD+BUM5nyprZbKSD+a3zx5YNvBIc6oLebeCW6OpcO+zotXJP1rYBJ80AspbJumOaPcfIrd2ICx/vicAqr4SFehBkNg== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(136003)(376002)(39860400002)(346002)(396003)(46966006)(40470700004)(36840700001)(70586007)(70206006)(26005)(966005)(40460700003)(478600001)(8676002)(36756003)(40480700001)(86362001)(4326008)(1076003)(110136005)(8936002)(6666004)(16526019)(34020700004)(36860700001)(82310400005)(186003)(4744005)(2906002)(54906003)(81166007)(82740400003)(426003)(356005)(41300700001)(5660300002)(7696005)(336012)(6636002)(316002)(2616005)(47076005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2022 14:17:39.3757 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc3f1730-c20c-4c67-4a64-08da61b5c7c4 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: DM6NAM11FT060.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR12MB2396 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 Sat Jul 9 14:17:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 589126 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 7964BC433EF for ; Sat, 9 Jul 2022 14:18:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229568AbiGIOSG (ORCPT ); Sat, 9 Jul 2022 10:18:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbiGIOSF (ORCPT ); Sat, 9 Jul 2022 10:18:05 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2065.outbound.protection.outlook.com [40.107.102.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D270E00B; Sat, 9 Jul 2022 07:18:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MQN3z89ExnUSuZA2zyinOChGUAf5JmiKp+QBocuKwnOVvsboHqCAtHIOy5deg1h1vMa/QyXTkDLlTC1JHHqkVyQtiEbC/JFACFxfR0Jza71/zr2mqNYsHRE+/Esclaa4K4Z6yNatCTM8rnFCTpUKu1TR13jawW6lMWLbIin2SzPD6vhN6nGRu2L9QHrKwmESQNj+5U9vswfR22VPnYGnJZnR1+lO6ZMusNgj/Sar9kj7It6WV47N5bAal2UcU8CUNCK8maOY79VW4b5XPBfuHN3rqFPnqyC7NqoFNZEqiQAH0D/jT0f4A5ySjKVrKDQXp23XK9kYpW0agiccBgoW5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DE1xs5A8thrUl5LPVV7c/9fZki/WFGQ1WGIKHjPsX8k=; b=SyHyokeYjFm/qRnw/F4k4VQNgEA10dZ/pcIgsALIyvbC+JxrA1ZUB/0ykFdbB/3N2IUL3HMr/8MoDzEk9DanYtyOPy85tebDLj3lVgOxYnhhb5RPh+J09M6ql10uMzq6wyPA4LSgRkziQS/TF0gpNXSnjKzSRo6gW0jOI2Wz7o9ke13bIvhhTpT8ywea8/HPmBZezYg5XrjyeLwXntRqMgQoalbovz1jgWRZerQccRVsKhxB0xGgAIdNkO3dvl962O2BggPwJIrOsG3Sm0RHbQB84jIxOUsWSP76LmBD9L3Vtiv1S4II9R1FMpEP+jX9h9NlMeP07ucyo8/wl8twzw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DE1xs5A8thrUl5LPVV7c/9fZki/WFGQ1WGIKHjPsX8k=; b=szBAkWC3SXBn/83obxuHE/LdDpmZmij0cXmwVTQUUDDV5Ej97lTY9G+EV8jXzKW1Yfye+pq34vZJI4Zic2rZlahEBtMUIaD1nAdq1j+zzpBZSoqmjG8hbb6iHb2whU6SiWe4fsB8ghowuQbwbzwS+dr0kUfLFUdzsJ6ymoirIL8= Received: from DS7PR03CA0325.namprd03.prod.outlook.com (2603:10b6:8:2b::34) by MW3PR12MB4379.namprd12.prod.outlook.com (2603:10b6:303:5e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.20; Sat, 9 Jul 2022 14:18:02 +0000 Received: from DM6NAM11FT044.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2b:cafe::b0) by DS7PR03CA0325.outlook.office365.com (2603:10b6:8:2b::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Sat, 9 Jul 2022 14:18: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 DM6NAM11FT044.mail.protection.outlook.com (10.13.173.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Sat, 9 Jul 2022 14:18:02 +0000 Received: from pyuan-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 9 Jul 2022 09:17:57 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v2 02/14] cpufreq: amd-pstate: enable AMD Precision Boost mode switch Date: Sat, 9 Jul 2022 10:17:39 -0400 Message-ID: <20220709141739.834950-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a89973b6-52cc-4707-d6fa-08da61b5d544 X-MS-TrafficTypeDiagnostic: MW3PR12MB4379:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gx3N9EWQ0H2jThndz9Dx9AvmSTNoa148G/fxwq3dWDNdDgXFqoyqDdhbVzu54FEOgDS7t2H4PyyM5kwngKIsGUH0qpgmR9Uz5+7ACcF0QfCzR0laEou6Y27NZnPA4Jp20wtEIfE4+nf03v/ffdNVHV5+ZUmT7hPo/2UpOWDyx0CApgtlFQj0GYSRtiM/FSO2jOCnmhm/Q4+5PN4Fnd5gwrMKbVxCe7P5VOB/I11m/XqoXLf0glr0GQvPw7JkE3PWycw3EX8/71APc4/KfMUoiF/V9Qb0oR6SD30kOaJq7rcsk4ubwQAsVeEIeXlYieUvBdKqDjtDBH0XNn6Z+rlo/CN1Xg4Iupb4QINJQ5UJkav4SAA4mitV3S3u9jv1z+4Ism87/imF0oSofPewKZVXV6rpJ2DV5aoqpV5R6iOCem7JeZmbBRDave9oW3983XXFYb30QLdHdouhVmQg1zSgt1x/yJ2lUKQ14CFd7pE6TDhwgn/s8/T2Vc1A9GUo3y3+oU88bEpp0KJm44TIK3iY6QOGLdObXgg2sP3q6Wfp/dva7Z7HvxIV8Jq7LZArY8kR5D8WKYpQejCLVOOMOjiAZMS0OmWmo/LxO9m2UT3tQyasDFd18XAgLrRkWfFyGTZdTDDOldrLQ24GqCSgXCqT0t6oxj0hNFoo3lZYR8PoZq/pSDw961mUji+owZC0a3AbSS5krZh93/17DgTa3QTpTsmBCOfHVVCmYGtqROms4IGts4Xj6F8PqEhaumVEyaLeVbHlhWS+UdwkqdnMOLZJ9xH9DdY9fRxGX9HWUP8O8VJnL4YvBRxXa6i1j330rs3Y8tOQEi4sBiLvPk79dhiXv2mWPlKl1x09A2SDHF09c2bttmOQj/bjE6I9Z+GT/IS+ X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(376002)(136003)(396003)(346002)(39860400002)(36840700001)(40470700004)(46966006)(40480700001)(47076005)(36756003)(40460700003)(36860700001)(26005)(186003)(34020700004)(336012)(426003)(83380400001)(82310400005)(2906002)(70586007)(81166007)(6666004)(8936002)(16526019)(7696005)(86362001)(82740400003)(70206006)(4326008)(5660300002)(8676002)(6636002)(316002)(54906003)(110136005)(356005)(41300700001)(2616005)(1076003)(478600001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2022 14:18:02.0129 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a89973b6-52cc-4707-d6fa-08da61b5d544 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: DM6NAM11FT044.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4379 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 Sat Jul 9 14:18:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 589698 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 48A0AC43334 for ; Sat, 9 Jul 2022 14:18:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229462AbiGIOSZ (ORCPT ); Sat, 9 Jul 2022 10:18:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbiGIOSZ (ORCPT ); Sat, 9 Jul 2022 10:18:25 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2051.outbound.protection.outlook.com [40.107.237.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 480C1CE32; Sat, 9 Jul 2022 07:18:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KZeYtFrYLBj+GG+ivt1Y4xhk/A/kBDMU/jOsMXrqVpyJArsQlpnv384+dxIQEgZC/GjL9TBPJ5cwJJGFhRT+GCZHwiznor1vdubPKx+0lbxSONKwV4KQtEQUk7eCsy+i09GxCXX0vcs3MvMV3TMgik+u1+HeZP4U2qojvs4vnffhhlnwKVOWH74bYCR6evi826Iq+35qxgbptbnRjGGVMAuCmvI/vusw5WeSk5ZBd2dzGQqGzTj+U48l3VBbLUWwSdrZnBvXu5aBmyvaABVH7txu0Qw65rO/lqM39dhckSReToUrbbutm31tQ/uavhnLkEE9rwfBI+BwV3EPa0SlLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uN5+9MjVFTE9bOeD33YGoFoU/Kg+Vigkk4Cy9BhX4dg=; b=HX+pIvxIAnuGZfQ9X5apITCoR3AjtcNkzpJz0v/iIRdQNRppCc6DKKVhoXjmzhuOb3W/NKMCZj4cPRbaYx1Eqfq92v1/KjdkpL9cqVPaUJvWssDdk75hZ1bI4GMPNYLIBuWjeVan7B6IOxyLlS+MCAxwzLEH0rwrZgB/CCdrRZbbtRQbR0Ae4KfXnx9ggnDdQIYTVbHKfA+OJj5T6tTdAL9OzUE2FKp91V1chg+s0McF2XkAPgs52XVhs0JPIlqJPeV3oFYKeV8xZ9t8RXNTJtNSXT5UgPAD4GjaXrfWw0uT4oJZMlZeWJndMvwWm+Kbwcq8DCn8UdXWnGsqGpFTBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uN5+9MjVFTE9bOeD33YGoFoU/Kg+Vigkk4Cy9BhX4dg=; b=jLfKqwVXIPRQq4ZCC3quERbR0NaDyISD4vUMhWdKjiCwxWiFtKSzxl3CxyLiR4KEob4lUZZcQ5eR505WAGVuRh+kUaB1WHZgM6+6mvxRo6W+wBQropGblNxU4tw4sGaIarmXTOcz/pYh2BWluWJ8XPZQiKjIBGKVc8cdTq87Eic= Received: from DS7PR03CA0343.namprd03.prod.outlook.com (2603:10b6:8:55::17) by PH7PR12MB5710.namprd12.prod.outlook.com (2603:10b6:510:1e1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16; Sat, 9 Jul 2022 14:18:21 +0000 Received: from DM6NAM11FT009.eop-nam11.prod.protection.outlook.com (2603:10b6:8:55:cafe::e6) by DS7PR03CA0343.outlook.office365.com (2603:10b6:8:55::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.20 via Frontend Transport; Sat, 9 Jul 2022 14:18: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 DM6NAM11FT009.mail.protection.outlook.com (10.13.173.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Sat, 9 Jul 2022 14:18:20 +0000 Received: from pyuan-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 9 Jul 2022 09:18:14 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v2 03/14] cpufreq: amd-pstate: cleanup the unused and duplicated headers declaration Date: Sat, 9 Jul 2022 10:18:01 -0400 Message-ID: <20220709141801.835177-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4814d927-8e72-4178-8596-08da61b5e066 X-MS-TrafficTypeDiagnostic: PH7PR12MB5710:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iI1F+ef6w4jR/ekk9rFNde/YaP/Do+qhFIo9Z1vSZgIYpr4vkU4au19TDbTtVocIuALXEnI9mehnbY17GPPpoHVgczgYGUQgUXPzHeAjrnEZWEvWgZ+Q5Z82da3jlDZzudtR2b8SRXGVSrz3ML03AiuXjGgsTfJkZ5GvyGuLdNvcLrqmQq+ZikwBw510zCbWc573P26q9SOTlefn0nlw8wgPa8R2CLQA9EjQKgajGSLDYSxTfCKBBPxiwK0XvaBW2SwRoguMQuQzYKmJSOaF7rvYUc3DQM0jb3KedbfY/JSLI4eoP8Vs9vVEkqlVzUxTq8oBK2iuL33uy0eWuaZEUxeSbdL0urJPdT7wgzzo08Z8XZHpKLdpzc/BVNxGo1tLr59Hthxbonru/G6Tlcrv8abd0DMiGgKW7pgTENHdxr5BDDYcHMNOL0Nh2IKvBvZLVa+DWcecrcbNjiLaIihJXxF2PKQfTpa5RAVc06V8Oka150Q0mmCS6e/2gW/7Y6WZKb1+Wrhy2mMHIIoxUC8E8XW+pkNbptaHsDIYlwZIw0Oc5RJyo/Iri1qxPkHr1fJQQsXmM+Q7r+/EhwGdVzVyAA95yteGgoV5fS+5Ao8RyghavAyB30VODXc6c5yxPajsZo+Gp0HsYMzyYgv8iBn061QPyvjJMNeHJYRq6D/wyeTKsvhC5h0Oh9iK8S/vQ07N74fm9nmpeUQYT+moknqFGpGh7D5KevSKTm9ysbjFe8YQQUV3E7Pp+UA5Q/Isy0LC41lGRmHsejErc0arvLP76kVUCpnPn3nMeNAhr3NAQzZudQVk+uyJ9OMTMT+5JCMIlwwiFlB3xUrwPo2njyZZRzUzHqhIlbc7KT9le0FjNua24zMwhuIpZFBoPx7wRm+X 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)(396003)(346002)(376002)(39860400002)(46966006)(40470700004)(36840700001)(70206006)(316002)(70586007)(26005)(8676002)(4326008)(1076003)(8936002)(2616005)(356005)(5660300002)(86362001)(7696005)(478600001)(110136005)(6636002)(426003)(2906002)(34020700004)(83380400001)(81166007)(36860700001)(336012)(40480700001)(41300700001)(36756003)(40460700003)(47076005)(82740400003)(186003)(6666004)(54906003)(16526019)(4744005)(82310400005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2022 14:18:20.7199 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4814d927-8e72-4178-8596-08da61b5e066 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: DM6NAM11FT009.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5710 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Cleanup the headers declaration which are not used actually and some duplicated declaration which is declarated in some other headers already, it will help to simplify the header part. Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 188e055e24a2..43e6df9f67f6 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -31,19 +31,14 @@ #include #include #include -#include #include #include #include #include -#include #include #include -#include -#include -#include #include "amd-pstate-trace.h" #define AMD_PSTATE_TRANSITION_LATENCY 0x20000 From patchwork Sat Jul 9 14:18:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 589125 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 18838C43334 for ; Sat, 9 Jul 2022 14:18:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229746AbiGIOSm (ORCPT ); Sat, 9 Jul 2022 10:18:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229741AbiGIOSk (ORCPT ); Sat, 9 Jul 2022 10:18:40 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2064.outbound.protection.outlook.com [40.107.100.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF53E10FE8; Sat, 9 Jul 2022 07:18:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FkSk2SKuSJdZ2Ko9dbTNRiqQ08R8kvkt9qhaoKaOcJKx2l1wz2EzBsWHTEiZtFmiMZtiHz6VyzAUnsY+999oc+90U/kH64p1GP80EMsewAANx+f+ogr564bf4XS10QMYD+2I/re5J/xSwqDvvTkPeGOD3k4c9XOD42XtCkN3m2HN7eat34IM9/9xtf5XTL60X0mB0IVCj/xvwDaDfiqovYncCbYCZsMFyBCkiGi2LDLIM2JXi1dslfK6EvCn3/UoV4Pf3kfhMP/6rra+pfEyHzbs8PHlXb9JIrjjZtjib9k5Er0LeZ21xPaqVXtOWghUYyLsVDsKFhXTEGWiB7Ekvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=avaRGQ+ve4o1uu4LCzGTIuVJV9ZowH+vjGRU3vPbpQw=; b=lHYO8f/t49BJKr3Cs9KHZ+tCSIEpNTIh7+y62Mwn8tP8G7zBmNifvnXfbwfAUSkZQP3rMefs+CDdZlern67EIJo8xC95Vgwz/2OuEgwSb8d6yiZ20Guojxd9MarmrTYuq7EUh4TxjeLQavk9UAdvYHj3QZKTj9DUHxgwaKP7PB48w0v7j/E633alNiIhcISscyLRXkanJ3pEq3M8LMARkwhvBcSpAEQtYG2TxbtPvg05IcPbXXKnUKfpHn8l9Z00asc2IcqRK96ZGCydRkJg1oaXJ82YDyYM7FglesfLbsDqXUnF97azlgBrBcOb7ekqyPxhbMwbbx4sERtUAW8I/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=avaRGQ+ve4o1uu4LCzGTIuVJV9ZowH+vjGRU3vPbpQw=; b=nz9DYlLtMERF4lxyRe+lLoTOg3Qe3bNbdqDQ25/obQD21MrAApiWDVAWe5uqp15VXOAsQ7AaFtwXbF+St1DYzA7zECiMXStS6YL1Q2g+6heRUjItkh5VulAvDZFbmQkHO+ftaG6zNJkZXqx0HDcY9KFW1zh87rm/3V0AFmCYAN8= Received: from DM5PR06CA0080.namprd06.prod.outlook.com (2603:10b6:3:4::18) by MN2PR12MB4991.namprd12.prod.outlook.com (2603:10b6:208:a4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16; Sat, 9 Jul 2022 14:18:35 +0000 Received: from DM6NAM11FT033.eop-nam11.prod.protection.outlook.com (2603:10b6:3:4:cafe::39) by DM5PR06CA0080.outlook.office365.com (2603:10b6:3:4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Sat, 9 Jul 2022 14:18: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 DM6NAM11FT033.mail.protection.outlook.com (10.13.172.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Sat, 9 Jul 2022 14:18:35 +0000 Received: from pyuan-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 9 Jul 2022 09:18:29 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v2 04/14] cpufreq: amd-pstate: prefetch cppc_req_cached value in amd_pstate_cpu_init() Date: Sat, 9 Jul 2022 10:18:18 -0400 Message-ID: <20220709141818.835366-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c73a1842-232d-4530-ae14-08da61b5e94e X-MS-TrafficTypeDiagnostic: MN2PR12MB4991:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ubd54Sr6cnUYAqgYS94TpvEfYvU/De208ygEp/0kmt4vpnDOghyAVHO+Qbm/SCtlB1a/X5sVCM80eW3AWj32aFK54QeMd3LUJHX7bfMUOkvs8u1HljXwOlze7V/3zHS+A++93yg41+Kj5R+lDU2SYKP+kKf7kfjSpeXNCRTegMrDt8DBLSzXz5ip7S9RPCM9VzTVJ2bXBqWEmLLzj2wl5J34t9rL7FQ2bsDppf2zTUgUNmo2wCWpSxbp2HeCEQGtboGRgHjfURZmPxxbPzwqUlD+wyCj8ZYcKBXoVqRft9siCqMp4tQNLylUsovXbdO1TuRXlFAkvDrK0CwJtHoJxFYzCxqtKNq+Sa2CWK7sD1bl2JvPOpi9STcZu7yKlsrjHwhfaKSfGg7QY0Y549OmEuPqfL+KguLMWrS4tuEALesy6oWl8hjRDr98WUsJVeV1ot2F/HmcSc1GHqTUgfwFTdPdpUClPZJvZunKmYD8LQ36bHGIZatJ93hs3bCP3kAXgqIobMlwj7h0TwX4R7GCVFcv8f83nYVQG7BpU72u35VyZEuBbOvNf3GEWEuOM4aiO+QM1xsetcDYT3tcexImHxc6mXdWcI/ZKLvXcDY50gLE4V+zz6JKaSgcFOrC8zNNgVj88u8STfzh7PFtOUP7oG1rz9BsifrBbpqh71KXcFUfDVI8qo95VzX0M+pcY2T9tsg59N2DTh2sk+YNpVO89h9fXHhgY7Eq1wyPhx4I6r5bMN5elX5Yge3umo6hqg0uyTOIXEnjutANROUdzob3GCCDfBi0J9YZ+dHcknLbgTEvUhVK+lIWv+mBq/jAE2MAYO5riGV5Wm+mn3ttmosSUpVt/pOe+JgyL2ttK5LrKwMu+JgyB6iNCyIavmA3pId/ X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(396003)(39860400002)(376002)(136003)(346002)(46966006)(40470700004)(36840700001)(41300700001)(5660300002)(40460700003)(7696005)(478600001)(54906003)(8936002)(316002)(86362001)(6666004)(2906002)(2616005)(36756003)(34020700004)(336012)(186003)(70206006)(26005)(426003)(81166007)(70586007)(16526019)(82740400003)(1076003)(8676002)(47076005)(356005)(83380400001)(6636002)(4326008)(36860700001)(40480700001)(110136005)(82310400005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2022 14:18:35.6475 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c73a1842-232d-4530-ae14-08da61b5e94e 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: DM6NAM11FT033.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4991 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This cppc_req_cached valued should be prefetched during amd_pstate_cpu_init call period, then the amd_pstate_update() will get correct cached value before updating the perf to change the cpu perf level. Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 43e6df9f67f6..e4904da54541 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -547,12 +547,17 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) cpudata->lowest_nonlinear_freq = lowest_nonlinear_freq; policy->driver_data = cpudata; + if (!shared_mem) { + ret = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_HW_CTL, &value); + if (ret) + return ret; + WRITE_ONCE(cpudata->cppc_hw_conf_cached, value); - ret = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_HW_CTL, &value); - if (ret) - return ret; - WRITE_ONCE(cpudata->cppc_hw_conf_cached, value); - + ret = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, &value); + if (ret) + return ret; + WRITE_ONCE(cpudata->cppc_req_cached, value); + } amd_pstate_boost_init(cpudata); return 0; From patchwork Sat Jul 9 14:18:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 589697 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 2184AC43334 for ; Sat, 9 Jul 2022 14:19:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229745AbiGIOTD (ORCPT ); Sat, 9 Jul 2022 10:19:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229771AbiGIOS5 (ORCPT ); Sat, 9 Jul 2022 10:18:57 -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 3D8331274F; Sat, 9 Jul 2022 07:18:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J5K25IDG68w/J4z7CHjDWocW685p95YGpI3LZ3A+Eu25nQvParBP46/K26kTT4Lra0SEbz0AuME83Gu9amzN93HgfoSG5HJln15uC8isp8AVNqCuvWMMU8vhRU3IVPmYn+NbVUqFIENdmxcwfosb1dVLV5Na5Jr8DZXJvP7HeQw+KSFORPCPnXH9xXlNyeXmeeib2+6f5O6p7W/3OHL6mw4r9uiB6q3YR5Rq6t29ofnAkXHN1RRhMCB9DelqSWMMgodrWxF/2mG8NrQtfAQZafeNWqxOvhFAywkubjX0SHOkE1moSWkEG/xl2OG8iSY+0NhK+tyBmWz3WL4edzKp+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=76f2SBmh7P/rRxfMHYyBcgNGlGwGPtXKjcuhDvE1FVA=; b=OI/R839Q6FTkkbLFbJMe5KSxPjqkS0FzN7woKcUds9uqtk3mMdsIjNTsiWUUzpFCDlFT1GE2knBCt2iLoQ8a3QDuIkPL+e2bNR+a0yi5ee2BKPv6jWCBbmmp44FQhsUW58zY6g6QRYfTzz9cH1UuXE2gEJsUaYBXxSM13sLL+nMmleqnW0HjhoehdJhenO7lCff3xkNV4tuxDhg5ZhybVUkV4PL86a/T1KYVagG1nD0zUXGGb/MzO9PlUQqaFeRRpxEwBz3PSvd91J/tzWl9ddBNR2WnGZ5BPJUSwpNPbmdFObLFJrEDn/yNh/bl7qs5h28ClrJqSObsXt1BQ5+cNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=76f2SBmh7P/rRxfMHYyBcgNGlGwGPtXKjcuhDvE1FVA=; b=HTbS+ulD453lxan+ZdNjouR+sjCGDC/9WGgMQTh/uJf2oo7jmq04T+uGZ1GWtIV81pZSalS3PrIAzNgrgDPicrKgh/eX+5WzwEK2R7LuzqBL01kYp7t8ZhoAhiyxJyGowemuqFF31W55uZ4Mp8WnLR3Gtm70gzXCsOaMAKqd0j8= Received: from DM6PR17CA0022.namprd17.prod.outlook.com (2603:10b6:5:1b3::35) by BYAPR12MB4791.namprd12.prod.outlook.com (2603:10b6:a03:10a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16; Sat, 9 Jul 2022 14:18:48 +0000 Received: from DM6NAM11FT055.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1b3:cafe::3) by DM6PR17CA0022.outlook.office365.com (2603:10b6:5:1b3::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.21 via Frontend Transport; Sat, 9 Jul 2022 14:18:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT055.mail.protection.outlook.com (10.13.173.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Sat, 9 Jul 2022 14:18:47 +0000 Received: from pyuan-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 9 Jul 2022 09:18:43 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v2 05/14] cpufreq: amd-pstate: simplify cpudata pointer assignment Date: Sat, 9 Jul 2022 10:18:33 -0400 Message-ID: <20220709141833.835548-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8f5cb23a-0221-4010-7e73-08da61b5f06b X-MS-TrafficTypeDiagnostic: BYAPR12MB4791:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HmyUerNJnQfHUM+/MrPwSt7VjfY6+y3zvnoETFapoX5r+jvhdqlRbz7RzNJZUVu+Y9aLiQhXzEDuJUhSqBcEpeu0BuFkUOGn/BWWgBtaszt9YgLeFGG80yKCD0roHREME2j3OHglbdq8syz03iq/zBrPRqqmO+FF4IQ3InJUIuXViJXjr5SckUCYE49rFKxfpWimOQbqqqiytD1oFu6DBN7sGRCmbbQGnIqg+GEmmTwXX9QnfCS7a7QR06dG/YuK8DP8PXW64+jME6wMb+MdxRjZ5y0A1BcdxKwTL94wSi91LbHO3ZN0A5hPo3sZenAnPXJu1PnO1xLIDEnYxNnG1RvDU4vc4KjTUQzfdeTB2YRn7cEKDTtrS4MHWWGLjZ4BAcXjMK7W0CHbKFNV/5I9NfNvMoZtRtziCrNYQDewNa3lS8D0coC/t4iRNSoE+8lH93YSeDbnN60ZKjMldm+mn7aU4p8aaTN0qh2pqA7lAA1Sz37fVSJSo5J8nUA0BcaAoqJGl/M0D735LTR+QjYttgCY9lLGct4TtwmgvrxYTcT6un4CfHNYGLVRHLU3vjuBVBkcCLvq1tCvF8Mlk6nbHMgbfSppwNXBN9Y4x7zLgf7w5aZ5Ney1v4Jo5qhs5M5LwBB2IF7tdoAFGvfjHgam6BlpYE9j19oLtn4e6oQPV+TGS0uExPOMeR7Jn56jcycvj5/vWtd3UzFriAX+IIss3YVTpbeG7vXMo8L7j24GP1+uKZXAhVEXH3HJyu0APdSDDJ3q4gLNuZ2Yw/w1yg71g3bNCwvQcunmcd4JaLb8WIHfOP62gyvMFvcVE8Wlsl5Y+4pj5VnvXQ08562QVRgqRarwu50PbRe1wtuHv7SWD2Kf9Msf22EUlYKByDewcW+H 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)(39860400002)(396003)(346002)(136003)(36840700001)(40470700004)(46966006)(356005)(41300700001)(26005)(110136005)(54906003)(70586007)(70206006)(81166007)(36756003)(6666004)(86362001)(47076005)(478600001)(2616005)(426003)(316002)(1076003)(8676002)(16526019)(4326008)(7696005)(336012)(6636002)(186003)(8936002)(34020700004)(5660300002)(82310400005)(2906002)(40480700001)(40460700003)(82740400003)(83380400001)(36860700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2022 14:18:47.5960 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8f5cb23a-0221-4010-7e73-08da61b5f06b 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: DM6NAM11FT055.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB4791 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org move the cpudata assignment to cpudata declaration which will simplify the functions. No functional change intended. Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index e4904da54541..fc0de9fd643b 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -571,9 +571,7 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) static int amd_pstate_cpu_exit(struct cpufreq_policy *policy) { - struct amd_cpudata *cpudata; - - cpudata = policy->driver_data; + struct amd_cpudata *cpudata = policy->driver_data; freq_qos_remove_request(&cpudata->req[1]); freq_qos_remove_request(&cpudata->req[0]); @@ -615,9 +613,7 @@ static ssize_t show_amd_pstate_max_freq(struct cpufreq_policy *policy, char *buf) { int max_freq; - struct amd_cpudata *cpudata; - - cpudata = policy->driver_data; + struct amd_cpudata *cpudata = policy->driver_data; max_freq = amd_get_max_freq(cpudata); if (max_freq < 0) @@ -630,9 +626,7 @@ static ssize_t show_amd_pstate_lowest_nonlinear_freq(struct cpufreq_policy *poli char *buf) { int freq; - struct amd_cpudata *cpudata; - - cpudata = policy->driver_data; + struct amd_cpudata *cpudata = policy->driver_data; freq = amd_get_lowest_nonlinear_freq(cpudata); if (freq < 0) From patchwork Sat Jul 9 14:18:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 589124 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 29AE6C433EF for ; Sat, 9 Jul 2022 14:19:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229606AbiGIOTR (ORCPT ); Sat, 9 Jul 2022 10:19:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229706AbiGIOTO (ORCPT ); Sat, 9 Jul 2022 10:19:14 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2085.outbound.protection.outlook.com [40.107.237.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B76A7BF68; Sat, 9 Jul 2022 07:19:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FMgqNiQldQFdqs9XkBAMpQLdJu1TEQnH12cWmuEYBlQresYo34Jbtmd2WFjEH5Z1crrWk23ETgMyK57CGFYGAY4EFEUX8S4UKyGbP0Ecc6H/SM9aV+uzlimQ0xpiP+qT7a9Qxk9IxhLKI5ov7Fxc+Fe8vFL39iXuPvISqGkQiz3fS2/sOZcBjtflRGA1Jfc9hCqMUAEXnxb+hprRWAetn18u9U3J5q4tHLABfZJrYNWgISbAcKuScnza7OayrdwG8w0G/u533NStJc0glKn+caL/nrLZn8jWsh6EGVyXPqhp0V+yZnwh33hgm70ZIxnwJfM+LquQqH4lh6sOo1qVXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7IF95Ie9bB81+bMsjtP8dBQ0hXdlo4sdYb4W3ShgO7w=; b=fbYFaHJaZysthGnGve62XuokFN8Pls+QHm6lxHEHe4VCmJz5LgK8T4I33olkEi7rZ+tUb++tHC1SJZ4O72Zw7sK8hz0XEKj0KEz7PQZHsWSSwr5XxQLldAiLsWwNmRftFMliBSUqIdjH+BHse+o0vCi01LUmGLJMS21W+uD4gG2etABStRuybg+6fvBrdSSXysU/CiCdpbti3zESs4+4gDsKPU0gEQRnIVdxtwBoSqYo+VgJ2YRm5WKajZmrvzSt+njjs1zvt+zb1Jb/gEhu0kngtQ57m5iiWi/oGRSbcH/PJrbSjfhOpkfoIUBugWHW7NHNXJQhymEOw4KqiZDRtg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7IF95Ie9bB81+bMsjtP8dBQ0hXdlo4sdYb4W3ShgO7w=; b=P+L11+si+QOdvg6N8OloGHH9Fy/xy+M4HENhy17pM01nJ06R71iiQst8BwB+Zd7G7f8lC43EGGWjZjaFmVKNCYUddLB7Wqw+2+V2BUmK/NovbOsfdox1QXLLSSfHsDnEqHsFatiI35vmk9pAB9JdA/wDbsrLqPMHmZ+eUnscMnM= Received: from DM6PR13CA0043.namprd13.prod.outlook.com (2603:10b6:5:134::20) by MW2PR12MB2426.namprd12.prod.outlook.com (2603:10b6:907:10::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16; Sat, 9 Jul 2022 14:19:02 +0000 Received: from DM6NAM11FT020.eop-nam11.prod.protection.outlook.com (2603:10b6:5:134:cafe::fe) by DM6PR13CA0043.outlook.office365.com (2603:10b6:5:134::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.5 via Frontend Transport; Sat, 9 Jul 2022 14:19: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 DM6NAM11FT020.mail.protection.outlook.com (10.13.172.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Sat, 9 Jul 2022 14:19:01 +0000 Received: from pyuan-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 9 Jul 2022 09:18:57 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan , Su Jinzhou Subject: [PATCH v2 06/14] cpufreq: amd_pstate: fix wrong lowest perf fetch Date: Sat, 9 Jul 2022 10:18:47 -0400 Message-ID: <20220709141847.835725-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bb36e906-df8b-4c8b-649f-08da61b5f8e2 X-MS-TrafficTypeDiagnostic: MW2PR12MB2426:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8kXvvLYAmCEfpLH9mDYBWzy+J+y4MbfXjEwWjXVi8yWVw6kz5d8ucmKl0A/EpaHFYLrJU+NjYGMT34ifO5LHpdhpOMHGV8FNhwUE6CLAuVX2YtjkJUgpOwfaUvRPiYVeiphSvfxlIDhUs3svLLb6TDM4Kbv5tjjW3OoHDs5GdMGc5a6hwv9Oi8f2Nzwm9HWEbAyn7HhK8v0IeZGH1P9NnZQ0TtICUc7eqMMqZCXJNi9V3dKN4S4wSzjIaWNSF3bbLZZPik6ecWVeETpTRy1a5MWcz+yhKniB2sICVP2I5l6wgsIgahHcZ9uvx+VzOoDQO5F9mQ17bmyge3vbTByECfd3PPewNdBC6QnY/P4Irtzm42GJF6B7iAq0kEKmsFET+Hj+FSMrhR7bw/2gtHyG51LTe7rNSpH3BoCJx9xuiiqIqqAGhvfjyDHsx5ovB3EBPHApPRWsRbq+on/EXTOpZfXX/uCMvgNJ7yBCFw96VCguuDlZNs3iDvA2UOHYngS7MwXEEtUfiTpgN7oi2WSOKX3XDNdcIq4BFHuXzypPGmdtTc01RASNcWrJOMW3v3F22XqZM0YJdKN3QjegHUGoom5r2abQtma+d2NGWRZgas9nHcXCKO/K09YqLRg1hyMxG37ix3XvheoQqLc9RqZe5VvPYDyVITdVpkB9ASEsIiRily0mHG4L3mqE/HPFfXZ4yj1TNFvELDA0ypD8GjDOwcMczGdhF+BDzkhVZ4HbmWLRdpy4fVVU9pNOfREOy5AdeGfPNzfYv8+p2heEcMrE9AcO/efbGbwPNOkcLZd1+QHuyEP2oRdTQ9wjQPTqaZTfOk7AyUVhyMx6Iz7ngoSjnLlQBHwCqcYLYKRmTsSjdfSdgN8+qQsXYOjeNFU2GUga X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(136003)(346002)(376002)(39860400002)(396003)(40470700004)(36840700001)(46966006)(54906003)(26005)(6636002)(478600001)(4326008)(2616005)(40460700003)(8936002)(5660300002)(8676002)(40480700001)(86362001)(110136005)(316002)(6666004)(4744005)(7696005)(70586007)(16526019)(70206006)(356005)(82310400005)(426003)(83380400001)(34020700004)(336012)(41300700001)(2906002)(81166007)(82740400003)(47076005)(186003)(1076003)(36860700001)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2022 14:19:01.7970 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bb36e906-df8b-4c8b-649f-08da61b5f8e2 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: DM6NAM11FT020.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR12MB2426 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Fix the wrong lowest perf value reading which is used for new des_perf calculation by governor requested, the incorrect min_perf will get incorrect des_perf to be set , that will cause the system frequency changing unexpectedly. Signed-off-by: Perry Yuan Signed-off-by: Su Jinzhou --- drivers/cpufreq/amd-pstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index fc0de9fd643b..7c51f4125263 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -308,7 +308,7 @@ static int amd_pstate_target(struct cpufreq_policy *policy, return -ENODEV; cap_perf = READ_ONCE(cpudata->highest_perf); - min_perf = READ_ONCE(cpudata->lowest_nonlinear_perf); + min_perf = READ_ONCE(cpudata->lowest_perf); max_perf = cap_perf; freqs.old = policy->cur; From patchwork Sat Jul 9 14:19:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 589696 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 04212C433EF for ; Sat, 9 Jul 2022 14:19:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229379AbiGIOTd (ORCPT ); Sat, 9 Jul 2022 10:19:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229758AbiGIOTU (ORCPT ); Sat, 9 Jul 2022 10:19:20 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2080.outbound.protection.outlook.com [40.107.94.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40DD311461; Sat, 9 Jul 2022 07:19:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U3nVk/CezOXIq/LyG1kWFt99394KI0cNVhIw9ilv8IX+/s2D8jH5f87b/4GImliS8576hXs2hkPzAINYsbLOqJOQISVNd7SbvS02sKNRmsUv5JYs5BTUYTuvuEC5IQCg157AH6WLEsCgGvqJ2BmYspLJ8L2w0uHBHIO/n+ZVU/acp+saIQRcoFHpJSj8ToGW6U9rjwSF+8agfsTShVIWDZTJD/ZCPelp7sg2pPXYMkzfUkaHxMmyD3LVzZ1rlLXsSu2tu/WRlgMASulgWm2e43c28zNylskhawZPEKFTjJE2vUOamnVOKcnsPDxNb/PNSm9xlCpqNx6Cppr+BLVOdw== 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=yWK8DtliHR9UBQ1cKClpmd1bDs5vvxvS+N0wtoP2JUY=; b=cmRlWn8yFpVO7tqoKUFIlTsEDedSzUd12+gFhF1Ee6N+A+EyydXbxiYrECBRlQsqMWrPe75lEbDF9S4v7AuDMuW9jjxzTyCwc7+D7a5vxzqobJ7qwzkp91TnldicgUxsCpd0DqMTttOU29e/4hWRqwb8+KOobhr1EueWVVCOq3jzPbVK4d6ab1EjJN33hzrHJQoEBzqdjepafA+bdwA2XEg7tNc1gG8xJo9zayBTjphxHt7Q7hGC/YiCXCFta7lJDrJ+5RE6LUjx4Xaae9AqTVrrrWEu7mSyUYdUcM1VUQYKiBL8nJrBNyBLB5Du2Rc2u5T7aURCp0+JG+lc8Phv4Q== 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=yWK8DtliHR9UBQ1cKClpmd1bDs5vvxvS+N0wtoP2JUY=; b=zQKDofBDAYlfDdNgEn8kGwDD9brsUIIkrYDBcPhx5v/v2mBF7bWgPkmezcBGA63NbAoOOtS4mYbpSpVdPOagFC6qu2JTed+XkHf+FkvldEJ4R2BKyq89e077Hpu3h0JiOeRaCb1TsZLvBHfOFj5PRxJTwAMPihFe+Y8qejWZBrI= Received: from DM6PR11CA0056.namprd11.prod.outlook.com (2603:10b6:5:14c::33) by DM4PR12MB6325.namprd12.prod.outlook.com (2603:10b6:8:a4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.23; Sat, 9 Jul 2022 14:19:14 +0000 Received: from DM6NAM11FT035.eop-nam11.prod.protection.outlook.com (2603:10b6:5:14c:cafe::b2) by DM6PR11CA0056.outlook.office365.com (2603:10b6:5:14c::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.22 via Frontend Transport; Sat, 9 Jul 2022 14:19: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 DM6NAM11FT035.mail.protection.outlook.com (10.13.172.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Sat, 9 Jul 2022 14:19:14 +0000 Received: from pyuan-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 9 Jul 2022 09:19:10 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v2 07/14] cpufreq: amd_pstate: map desired perf into pstate scope for powersave governor Date: Sat, 9 Jul 2022 10:19:01 -0400 Message-ID: <20220709141901.835903-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 438235ca-0842-4b47-70f7-08da61b60097 X-MS-TrafficTypeDiagnostic: DM4PR12MB6325:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kZTlph2myDdMeqYOUvgyXrg/kV/PHM5jUIz5IfEgi22B07Chhcbg9AnOSl2FgYqw4yPz3tdphB3whDHs+Z5DzYQoE3QO981np9hBS2/iUlKEeg15SJYebfs5SMagOJMYXtGvokwXWQR3EaxCXFm1v1DavF8XoJUaIqJ7IyOq7ZfTdulJlWs2xD+vIBCcmaAjuPSlTFMUeNuQdaEsMeT7aqb+GOyqKf2Z+c9D4dHU96tZSi9KylCVgc4hAeqhf+J1gYHKigPlY0FCArkYqU3hdSU14749owD6zRwdDiWOOSZoJX3uDMAynubjBJVvhKsmP6BGfCQ1FQaFA4JGIGlULTTQDLPGQb1YcGUofkLDVyK39BiqkjLtecqn8BQRLhl7aF04d3ocMB49GrHJHzSOHDAD41QjMxwHLt5xHUAQVVSHDf7/mAgeYvvxh0prI72m3OnpkIphyiTi/BC2piYvpRpkIu0mVAepBp8jyFNhafSYOtc9zPsDXyS8OfP6bjnee7uewswhT3E9fq5cbL8QV7NrA8xfV2bmTXo0lMk+IlFtk36daZKYcNWygPlwY8ivj2nmlj4yiUaczW4gwDnESpWKAFTLjI25DA/5at2xtXHWc38DDpYa0Co6NdIoQsPMqrqMUhNpI360IPqTF+vLqafBLSkwekKQtKi8py/6EUhT34ZetezXdnHo0Zt7cBswagmuv+TwzASx3qo4C6kUqg3CZGqgwVC5YAOUNVBFUXndWmwubZdE169i6xI/10WeRc2j5eSzFtKopM4Q6OOKR/e2iLoMeqGOCA6PTurdtopSIe40SA1/iArTNJ5RE+CxKesE5gUFxqKSSxhTuXOMFoCrI29B2hLXhM4E1dZh769c/LqM61E2qXgHJdhWjI98 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)(376002)(346002)(136003)(46966006)(40470700004)(36840700001)(110136005)(54906003)(86362001)(70586007)(316002)(6636002)(82310400005)(70206006)(8676002)(4326008)(26005)(16526019)(186003)(1076003)(426003)(336012)(47076005)(478600001)(82740400003)(356005)(40480700001)(81166007)(7696005)(40460700003)(41300700001)(6666004)(83380400001)(8936002)(5660300002)(36860700001)(34020700004)(4744005)(2906002)(36756003)(2616005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2022 14:19:14.7276 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 438235ca-0842-4b47-70f7-08da61b60097 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: DM6NAM11FT035.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6325 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The patch will fix the invalid desired perf value for powersave governor. This issue is found when testing on one AMD EPYC system, the actual des_perf is smaller than the min_perf value, that is invalid value. because the min_perf is the lowest_perf system can support in idle state. Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 7c51f4125263..8a2b6ad9b8c0 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -265,6 +265,7 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf, u64 prev = READ_ONCE(cpudata->cppc_req_cached); u64 value = prev; + des_perf = clamp_t(unsigned long, des_perf, min_perf, max_perf); value &= ~AMD_CPPC_MIN_PERF(~0L); value |= AMD_CPPC_MIN_PERF(min_perf); From patchwork Sat Jul 9 14:19:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 589123 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 A6A36C433EF for ; Sat, 9 Jul 2022 14:19:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229762AbiGIOTm (ORCPT ); Sat, 9 Jul 2022 10:19:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229772AbiGIOTd (ORCPT ); Sat, 9 Jul 2022 10:19:33 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2088.outbound.protection.outlook.com [40.107.93.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D92BE2AF2; Sat, 9 Jul 2022 07:19:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fZA1QKsJK2EhryGV6jY4cD1p2PT7iBty3+bVnlEjYGZvTlXlMAU5/4sqTAUlrpeZ32mvMBaKVi5jZXT2d0OHk8LYkYthpspD/vQoXovtS7IOu8m91xqGH2qq58zQ2ROi/MQ9a8tuXoWg4yj9gxE1FDSlOSvzlUtpYU91EjsQyQQ7rLYpoVGe68I3hUzrtmowSuZWMcFWAbbxMIbqt2XyoMbGTVHOgUt1uwHl5OC0NFS9/Seu07nm43a4Ci1LfZY8cKZens41QsknSiL6n55QsASRz865KP9kMYaGbeZH+cHbV3j9G/QMVPbJHtmJE506WHyzZmLhRuVUriP7+eZhdQ== 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=D9vuV1oULmeUYLC1kWRx/y2f7jNWisV4B4cSHuN095U=; b=D5Fmi9/dByG/ocMKvTU1dyNkjOY/+hfMhc81wTUcb2eXdP24hIIu5KgeOwMbTZl+kiLwfdJ8SEwMuHj5agOnYsml+cUMl5L+V80nNIoRw5WxhGew/CoAHA6c4QtfcM+SEyNaoKCkSXZ5c2FBPpJLnAwQCZMjcdddke+11saYCNgRtefnsPOLMZ4zqyhdyJiNjQAZYfBuMAOmoaSkmTkxmlDfi//Uu4RInVxFFr8X6VpfCAPVlCAjaUf0Bhw+bo6WQtiGjY68HxTaRAx+cILYv9hmGUVqMq7elrN7rgarGZGFfUCPNkfspxw/hocrNDU1Y6HqMuLpPy8nwnEvloHGwg== 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=D9vuV1oULmeUYLC1kWRx/y2f7jNWisV4B4cSHuN095U=; b=b2WoTqpJK9Q/axiL2xRmP96dvy+EZdG4IaZ+bnYbFa9Jv7nOXusKI+Q1a+jL9Ox6orAgTKTOiVIKScxKcR6Kzg7FUkCgwnVp6T3XeTp5HHzzjXevi6Xaknu6LVirAwhVwLIAJIL1CEiU0Vu8h6YPiSRS+U1afLSnNvVdWGXGJKs= Received: from DM6PR17CA0013.namprd17.prod.outlook.com (2603:10b6:5:1b3::26) by BYAPR12MB2904.namprd12.prod.outlook.com (2603:10b6:a03:137::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15; Sat, 9 Jul 2022 14:19:28 +0000 Received: from DM6NAM11FT055.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1b3:cafe::ea) by DM6PR17CA0013.outlook.office365.com (2603:10b6:5:1b3::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.24 via Frontend Transport; Sat, 9 Jul 2022 14:19: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 DM6NAM11FT055.mail.protection.outlook.com (10.13.173.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Sat, 9 Jul 2022 14:19:27 +0000 Received: from pyuan-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 9 Jul 2022 09:19:23 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v2 08/14] cpufreq: amd-pstate: fix white-space Date: Sat, 9 Jul 2022 10:19:14 -0400 Message-ID: <20220709141914.836074-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c6c060c5-b1b9-46a7-171d-08da61b6084c X-MS-TrafficTypeDiagnostic: BYAPR12MB2904:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hBBFU09kcotqnZRJ2tzQKHV7wFwWPOmJ2o32OuCVkawiX1lbdfmwsc8oJi+1/rCn/4/Reog5WTwXQqEVcLIKP7w1Aru5YeD95Jh0nr5xh+pKj491vymghIaQ6HFIf4i/+PcQHnrbIsz0095ackIQOx8pWfmVk6MMIeDF6QYDZD+9n2clod3Hf70iI4JU23+ZHb2GCKb9dv7W4292gsCnV9/6w/LC7EpHmuzx79Gz8fEluLNCcoBv2g+knKMsyjiJz4Paky+lr7myyw8ubOxcGqWmDKW4Ns/0c/w9OCSgcSc9Hqb46llb4FQhIVM00sZQNdTjLnQ9amqPa8wHBu5IcaBP+2U2klK0BJQ6pOXu0j156j5bhvzppiy/tj6e69z6ZOcKOFk9wV75GH/+fID09kdLP1DVx3pghwNY9nwYxG6AlR3oA8vXPU9rOvUEX/Qm1OyRw2HsUg8TrUMvs9AO0yz9O3MClBcm7KTUk+t8Dl6fXAdUsXapLom97yqzqvWANUuAtvur7VYDObs1icaAUUWcPsOSHqR2JGMOTVmPWnh+f7U8IL7OBAbCxPQZ7J5AI0DcMkLJIjXKLs7HmWAYQqkv6F+FKjqv9q8crxSndFciySKCq/GltESmGI1rCouGJ06jRijc+qSq3pHbQ86aCYer25ucU4m9Ef5oKTmwyt8p2Me6qXjqV7cJjlXv3N+hIx+dln9qxVvlF4fIRDpuYMbDfnV6/4o/s4QHz1xZ4XBTroy8AytO5nw5O+MoyZxWPX1/95n8CqLXZLseqwxN3KzKhXIr7ZCR6bsYX50+X9bJsJZaHKGxA85y/A3KXI39fpVJZPlypgI0nNiZtnpjR6LtZqJs2bK/e+kHaO/1qqdmooc4CEIL98HlH8hBiUJo X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(346002)(376002)(396003)(136003)(46966006)(40470700004)(36840700001)(26005)(1076003)(316002)(81166007)(54906003)(478600001)(8936002)(2616005)(6636002)(110136005)(40480700001)(356005)(82740400003)(82310400005)(36860700001)(70586007)(70206006)(86362001)(336012)(83380400001)(8676002)(41300700001)(36756003)(186003)(2906002)(426003)(4744005)(34020700004)(16526019)(5660300002)(4326008)(40460700003)(6666004)(47076005)(7696005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2022 14:19:27.6555 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c6c060c5-b1b9-46a7-171d-08da61b6084c 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: DM6NAM11FT055.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2904 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Remove the white space and correct mixed-up indentation Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 8a2b6ad9b8c0..da20e17a140e 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -115,7 +115,7 @@ struct amd_cpudata { struct amd_aperf_mperf cur; struct amd_aperf_mperf prev; - u64 freq; + u64 freq; bool boost_supported; u64 cppc_hw_conf_cached; }; @@ -673,7 +673,7 @@ static struct cpufreq_driver amd_pstate_driver = { .resume = amd_pstate_cpu_resume, .set_boost = amd_pstate_set_boost, .name = "amd-pstate", - .attr = amd_pstate_attr, + .attr = amd_pstate_attr, }; static int __init amd_pstate_init(void) From patchwork Sat Jul 9 14:19: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: 589695 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 5A4BFC433EF for ; Sat, 9 Jul 2022 14:19:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229771AbiGIOTt (ORCPT ); Sat, 9 Jul 2022 10:19:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229777AbiGIOTo (ORCPT ); Sat, 9 Jul 2022 10:19:44 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2089.outbound.protection.outlook.com [40.107.95.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 082C011C1A; Sat, 9 Jul 2022 07:19:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZVYQ/adO9fccw7YzMRpAFgctaA+q9yMcNWM506UWe3OOjXxY7+6G0Ep8oegIyMCOxZN6EhsuQpgT5VxN5K7KJpuOgNmeXlE/g2EsPSrg9fyuDxFIkxcp9AjxfFujEm3udU7ZB1b3+LTeOHQq5u6yeAELu07fp/ZSCT+JUK1Zep92MagR/veXwKhPPfL9/zB6eyRAsBEYiMvO72QIKq1LuwaeL+BeLQnR0Spe04pZj45D7OzeHd6qRKlMmrWz1heM2/oHUUiHAXPgVO8JQX5zqWTThawgmeba2NypU/9oxKEtASPT1JyQGrAZWWi42qp/wr2wnLEXB75PwxyGWzKQuw== 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=g85sf/FDa67tvG0ofgjHGoccCDR0ib+49QUF8upED0c=; b=GMN/H8DTZl1WKSara7diyLOMqw8/82m+OYioF6U6SEd6KJwt2h+QXldSiqPAICRzZ4ckACcwNh8LS0obLP4L6vuxdaD3PFbRSFEgxUidtUjjhSF2FCJzgrRYg/cS6TCPjo8+5wxT+EY13zpF7FChwfXPZSr1bmoZpUqDXOEfl1Jt4hJm8xaxSCftgN0zNUvEJAEMZUci7iFkCcvhGVL+ivjas0GvyDsS9NPCaZ6eFFII//dCivfmWVAqr2Y0o/LHzt1mwJ7YfqZ9m7eiWg2sJnXaJetQ+YNByL6KoVgL+REs+YF1G/bqY4C2n4bBq5kYIToEubwZXhW1fdA0nZhG9g== 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=g85sf/FDa67tvG0ofgjHGoccCDR0ib+49QUF8upED0c=; b=Jfh4EoaF6GAQA35GG7xlFb32mj96tLoxzHe6R6yPcn8vUNGrm2z4x6qi/8UtOrRKYaeeQtPkNt3le4qbds3AK7ffpb1AWkIS5Xw+Z0DusWpLpsX8ixxmH+JQqSu/SLDIk6PqckhPd+oXYcpBHzr5I52WWwZGUvf7P2y1wyxu4KU= Received: from BN0PR07CA0017.namprd07.prod.outlook.com (2603:10b6:408:141::31) by BN6PR12MB1843.namprd12.prod.outlook.com (2603:10b6:404:101::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.16; Sat, 9 Jul 2022 14:19:40 +0000 Received: from BN8NAM11FT022.eop-nam11.prod.protection.outlook.com (2603:10b6:408:141:cafe::6f) by BN0PR07CA0017.outlook.office365.com (2603:10b6:408:141::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.15 via Frontend Transport; Sat, 9 Jul 2022 14:19:40 +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.5417.15 via Frontend Transport; Sat, 9 Jul 2022 14:19:40 +0000 Received: from pyuan-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 9 Jul 2022 09:19:36 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v2 09/14] cpufreq: amd-pstate: update pstate frequency transition delay time Date: Sat, 9 Jul 2022 10:19:27 -0400 Message-ID: <20220709141927.836240-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2bc2e4d8-532d-4257-ecc4-08da61b60fd1 X-MS-TrafficTypeDiagnostic: BN6PR12MB1843:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 83QI13092b/1DOdEDjR7l9yvYMPNgXynaBWVnP14lZQ/SDlTWFj2lf/REIbcAA/dXCbJfuBzxGAmgiu0WO5OniJOA6V1i0l7vICK/PhqwNnqGthy1eVPo+Xi/xjwagJZtScTJpjCp/Zb8MPi21M3W3DYYZl/FsvpbBixy4jDMTVFmq19anSgfyN3En0VY3GEWxvmPLXklH7hgsOzsk1q6Isx8L/3aBXTMOsv3wMo/DryRqcJPWSMd/XqgCtQNA3IWrAVT7KDA83/6mTNKxua0JFD/IiRLvjbvgHc+fv8xZBJhwhSvM88X6ZEm9ZH2po35x/rkeGsI0w0peG5Wxtg5xurQl1hHnkuLw8bvNe5MA9C8XpmCKFr9xzA9yDGV6XPErTBXsh8jOrK3zvqotlENAP7AGSWDpw9OqakK8ecUI7dSYYWHIf2jPQQ3wC5pyb+8XVhG5c+JuVeZ4+DmJVK1Ms53Ef9apbW+KHuF9iy6SpyRUD0tV4jj21CYANYA2T/T/7axtEXMKvMfK+BgPx57Q0wiaoy4b9Puq5+wqmFKoBp5r4ZGhNtgDRnTvkd6mdenrBnrOjI9kcKdTzxbR2Nmfumr+E0PeVEgBEnlFK81urZ24OV3t/m0GSqTJAr9JlBTOXMcEnRw9t8uCOQ8CjpBt/kbz7YJNJvxzNhvnzjRKnO371mYtRS3mUU466HuuIeQKDu9+WxvwYpUfDBSZwGTd2gdF1v4j6xz70qOKkYBlLj++Z+D299mWg4JbQpewnZWAAbwgcPWreL+YBTCvVXiTzI5j73+eDDvdhiV53a8h2dvux+dI8KlRroEMeMgW85qJX1z8rYhVMEVCfnre3nZ1Eruw4lT/5PwzfGmX6cGuOgbEsaLZahoJg7rMl2csF7 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)(39860400002)(376002)(40470700004)(46966006)(36840700001)(40460700003)(5660300002)(8936002)(70206006)(81166007)(86362001)(356005)(110136005)(54906003)(6636002)(47076005)(82740400003)(41300700001)(70586007)(316002)(4326008)(8676002)(4744005)(40480700001)(2616005)(36756003)(336012)(186003)(16526019)(6666004)(83380400001)(26005)(82310400005)(426003)(1076003)(2906002)(36860700001)(478600001)(7696005)(34020700004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2022 14:19:40.3079 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2bc2e4d8-532d-4257-ecc4-08da61b60fd1 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: BN6PR12MB1843 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org change the default transition latency to be 20ms that is more reasonable transition delay for AMD processors in non-EPP driver mode. Signed-off-by: Perry Yuan --- 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 da20e17a140e..21037935e869 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 Sat Jul 9 14:19:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 589122 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 1AE13C433EF for ; Sat, 9 Jul 2022 14:20:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229571AbiGIOUG (ORCPT ); Sat, 9 Jul 2022 10:20:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbiGIOT4 (ORCPT ); Sat, 9 Jul 2022 10:19:56 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2050.outbound.protection.outlook.com [40.107.95.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7093511C39; Sat, 9 Jul 2022 07:19:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f1lWwrUoU5AKk7zX0BvZc89CRsFK7nyn3jGv+YvLgySaFjlDBywkpK1HYCvFRxpbxMmnzsXrIyhr2BtJ8a/NmcmG9BTldJR8D+lC/9wQDEkdr+MGLUUb0TsJeg9T2UTtq4YA6Yga0289ezVgVFDEYFP4Gkk4uMUlj5njdmLFiTtbsnY828ocROMiSLjr3Vnb1s5Kt31TH72qVlDTDVSz53XDOwkCIujyrhfYHSKCKEHKvjKi7tic43Yc9VUolv+R1Nc2F4jUwYg23psw1STMas4lyZ/SCD/8wCe9k7y2U1wzlcLm72Q9bU77dshO8XPTr79haWoin8SJGilDV620sg== 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=fG324AAWuhIoRQ8IkoyGEW7b8eSQwCgehffpgyPmtO8=; b=jKknU7fJ00a5YWkvkNphwC1zzzdMkKSpH4u2jwzNuSDvzIGtxF3NxNtMBsFfe8CDkOELgHG6lRoqtxme1uU4AbZSky8N0djSS4CnWWYE49SeU/TRRYWHEaLI843PnJNWSJa77LbvNorRJyKc4DW3ABja4p5n+phsl5/Q2gVGowcaPDD0UMfOVBJdVEm4stHNOjMmmKTNLVsUcREi9C6EUpdD1DdkcK4Z8JBJo3Th+PS6FnKduHaUGquJ9Jv/NukDyUGApo/8zZuXiq9LJPgh93nIXzj33TvGfhz5Zf/9cujE2tsFIeyv3U9kItKEmGTgq7dw1tujObDpEwjsUxJxyA== 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=fG324AAWuhIoRQ8IkoyGEW7b8eSQwCgehffpgyPmtO8=; b=PBU1xDl7/rkOJ+fWVEuA8uKQ9r5gMAcpqFYSMZFFWzO4J0ee0aMgOMTo9MVxWQFLMdQTK7ILKdP6DcrV1hhfLs0tj6krxrRksiRMrk58Vzq2xXSRlkJHJv8Zr3PTIl9pwCy1X8Idh1mK9vFu896G+0EH+C/iwHtoGW0tTLUSazg= Received: from BN0PR04CA0099.namprd04.prod.outlook.com (2603:10b6:408:ec::14) by MW5PR12MB5681.namprd12.prod.outlook.com (2603:10b6:303:19e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.23; Sat, 9 Jul 2022 14:19:53 +0000 Received: from BN8NAM11FT030.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ec:cafe::48) by BN0PR04CA0099.outlook.office365.com (2603:10b6:408:ec::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.20 via Frontend Transport; Sat, 9 Jul 2022 14:19:53 +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 BN8NAM11FT030.mail.protection.outlook.com (10.13.177.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Sat, 9 Jul 2022 14:19:53 +0000 Received: from pyuan-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 9 Jul 2022 09:19:49 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v2 10/14] cpufreq: cpufreq: export cpufreq cpu release and acquire Date: Sat, 9 Jul 2022 10:19:40 -0400 Message-ID: <20220709141940.836412-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 37940160-bddf-4c91-1257-08da61b6176a X-MS-TrafficTypeDiagnostic: MW5PR12MB5681:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3sxHa7heOmo/xDlXPZh0lii5yn371vXL72aMtWCJfAXoIg+8FKewLuXsBZ/KgGoJ+OpsR5ndGLOCGovG05n3Fv8lk6BJKbk2Nxyc33clQjmBgHtg9EXwPalkjAnl8OLlKDlvgavbvJ3iWeraTrXrAC2c+xo3n/VB84lVjv8eQiSMdmyNhkx8iQ4KmhttC41CIMn+DhQE8xIXeEIAw95sYQnQkcfDROqsFU+e1tJdRIXE4eqcMH7IhmYiWgplliGgzEoGkazuofFnqRoRcNccv7VA7WF45FnfM/da/3/OUvQ/eJpmDFgOXPH8GVnpVz/Zru/HyEXXuXyv3wC1tn3lasuK+hbrXe2NWS2QfVH7vKUjNTbV5SGRTuZirr/COKL6zomHHyqKyUXNzr39bgQ975NyjOpyiQw6wBSGvZ9v3n4GtOQ3ku4M7QanA54c+pP0u+TYpOTb7u0qu2dYgye8gXOLqngycLmVZOFyyeFXa7TNae91S66qiD2SiGS1Z5BArTe4v+w+h4cumy9ZGQBFYidUfDkpvk25Z+nk01+bzzFVqCcmsGFaOkRlsccu5lSO6y7KeQ9Ehr817ybwaBERBjOyPvStccjl8j07uyFLkf0VV2k3GRtMNSniMpGk37E2vFkDxfyzJWmm5UByskIUHfjbAF5J+o22bQvH0LGsUcmbi583RFi3RKBf1YpGcaf6AwcrKS8GEYhL+VS7Vzt+VAqPhrf1pgpF2Lz+8frS/EhnoGjM7tdUPBBEnBnJtwG6eK8BfSL4BQ2ZzYvstUckoCFcVBANh7sh5sSltzkjPm0EN8ztGNbV0FLXm58ukXGq1Jkqo49p07zKKqfAeksJmTNPdwWd6kI3NZQv43JAdDxTvvnNGtM3C+rgODSO0AdV 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)(346002)(376002)(136003)(46966006)(40470700004)(36840700001)(81166007)(86362001)(82740400003)(356005)(36860700001)(34020700004)(4326008)(8676002)(82310400005)(40460700003)(70206006)(70586007)(2906002)(4744005)(5660300002)(2616005)(1076003)(26005)(8936002)(40480700001)(16526019)(186003)(426003)(336012)(47076005)(83380400001)(7696005)(54906003)(6636002)(110136005)(316002)(478600001)(41300700001)(6666004)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2022 14:19:53.0178 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 37940160-bddf-4c91-1257-08da61b6176a 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: BN8NAM11FT030.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR12MB5681 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org "cpufreq_cpu_release" and "cpufreq_cpu_acquire" are only used internally by drivers/cpufreq/cpufreq.c currently. Export them so that other drivers such as the AMD P-state driver can use them as well. Signed-off-by: Perry Yuan --- drivers/cpufreq/cpufreq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 73432360e6e9..4d3c83da29b7 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -262,6 +262,7 @@ void cpufreq_cpu_release(struct cpufreq_policy *policy) cpufreq_cpu_put(policy); } +EXPORT_SYMBOL_GPL(cpufreq_cpu_release); /** * cpufreq_cpu_acquire - Find policy for a CPU, mark it as busy and lock it. @@ -291,6 +292,7 @@ struct cpufreq_policy *cpufreq_cpu_acquire(unsigned int cpu) return policy; } +EXPORT_SYMBOL_GPL(cpufreq_cpu_acquire); /********************************************************************* * EXTERNALLY AFFECTING FREQUENCY CHANGES * From patchwork Sat Jul 9 14:19:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 589694 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 9D46DC433EF for ; Sat, 9 Jul 2022 14:20:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229614AbiGIOUX (ORCPT ); Sat, 9 Jul 2022 10:20:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbiGIOUL (ORCPT ); Sat, 9 Jul 2022 10:20:11 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2061.outbound.protection.outlook.com [40.107.212.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92D671581A; Sat, 9 Jul 2022 07:20:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DkhNJSclXluM41Kd3G3GlgBclt4+B9cb9u7atKutpHmlgj6oTvQrYif6yA1RkwbtJaaygO+hO8BZcJJcbIWvemRInNMrB6EzSuZbdsW2Pjy2iPb0bHpmIX6QNoPfy9iSTJLr2mpMf2LG1sryu1jQ/bWHpdEFMzI//5AQDQ7z7tHY06Rbp1cpamdu2JtYRhd1ajZrwEN4Bo+PPTIco8qAeA+a3RuM68j0v9aiCH+CHgxcHhoyzSexlx8khmp4zIVMJ1LdHRfxTdtzzj0g5FboB51GUaFmoMHE76ypwKpo8/uFtRkTtUX5oHs5ei5oECN3t7iN+jwoiDnIhYpttPQADg== 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=oPbCBR/Hipu+K4GFIOUAEHBzfzQfFDWGmqfnqBuvd1M=; b=LDljm48fYEPwfi0zrHU273ZU13AiJjvJEH/QBdHxcw1G0E2rvxspMEvh5hmfii5nzjpw7/vcj94v4Jdh4O6XFA/kIohdVtfdBLB47VFhD0CIhMftGOYGO4k+0lGdi8xA9Cb5zNSrLBPHrYD79QirPU280CJ74XL8K2brm1kh48MPTtAAHmRt2HQHIovSYDCrajfQxKsONKc677WY0OpDRVPUHjMC2EcMrETZjrjTowRDerWVCLbGhDlUjdcpWhvwqq7gXTWq8fCDdxg+DaLe5RDexcdm7us/GlR9+ijVxaWz4uEtitCVNvH/ULZ92VqfEK7oz6pui/3uwZ73H2xTaA== 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=oPbCBR/Hipu+K4GFIOUAEHBzfzQfFDWGmqfnqBuvd1M=; b=oKaNXzFYKpR4HtkWN+q9kroOxc11P9QyQUNRBiHUnfa7wUtx9BkWqkG3fZItmPqb1rTACkdOqbsLGJv2xupu1Ckr1QrJQsTINBIUXmxy+o1qftIZ13chYszsRKfCVkExF1VWo093c3RaWLsthNImGBAuezYrWWBWtv/CgNUpobA= Received: from BN9PR03CA0299.namprd03.prod.outlook.com (2603:10b6:408:f5::34) by BYAPR12MB3224.namprd12.prod.outlook.com (2603:10b6:a03:137::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Sat, 9 Jul 2022 14:20:07 +0000 Received: from BN8NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f5:cafe::5a) by BN9PR03CA0299.outlook.office365.com (2603:10b6:408:f5::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.19 via Frontend Transport; Sat, 9 Jul 2022 14:20: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 BN8NAM11FT015.mail.protection.outlook.com (10.13.176.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Sat, 9 Jul 2022 14:20:06 +0000 Received: from pyuan-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 9 Jul 2022 09:20:02 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v2 11/14] cpufreq: amd-pstate: add ACPI disabled check in acpi_cpc_valid() Date: Sat, 9 Jul 2022 10:19:52 -0400 Message-ID: <20220709141952.836578-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 17ed890e-6425-4b0d-191c-08da61b61f7b X-MS-TrafficTypeDiagnostic: BYAPR12MB3224:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dT2ynngnVgrTPX1FBzZYXNnWwL8I5ooZNTFsuZrU7G0T90rv96leOHDWTFSJKC+rtvZ20cQ5VAkGnxVGUx4orzQIfXjHGT5Gam5f4X7SC0st+P1NPA/VQgbszN/RsM3KfrIOSvkunsfEljQtO4v9W3ZQZWvNWd+W8VQgUKTpUd9Py0PimR5qgEkK9XeOz+zB8F/LVFbPn+0EC44ffJj/1cDXc64QpyL6mSeKCFa606Y0vYFZ2yieTCjjUmlsh4bM6oXfP+xeNSmez+CWT5JTVU5m3p1LgPxYTSCWcKjlXhG/3cTBvjNBe4KnIXQUvAk7NXbx1kSVP0uaqfPRm0nbyGC89xQcLww7n9oUkKgijGfl2G6Dv1mxG6+VQK2gc7YOUt0nF36n1VvqyHn19/XPKl7z62wv8Jz05bvR0yIA+oSMsK3iPh3nXPLKL2SaVK9OQqJg5fuxjpHN04jLEm5I0wsmt+eENrlXK54dpAzRMgfO3BBFgif3LCkT4VpqjoFda7umHX4MuIYJnuDkS2GHY5W5BSZ0zMo+Sn2UtRJeM6/TXYaL5HABb7LA9o4cWegI+sIL2UZenb8oYzXsTn1i+VAi40yXBCPTErzXMBDS6MOkiIeLWqBJO2yb4uuIT8bsZ1MZ/rWpAtrr7GzMmMbylSPQg2gZXQct/hv0B8WLxP65Fw93gT10psjK7OQw5WVAmn3wx8jeW9FBiZK2d2zZe/qbTFpnddYBJTqHRh8iKYxGW5gmz7OXLzHdJXtJYM79SGmGhdB+1+5Ha1RXx7DIbNIOdSn04xMvXDbtOGYGhVTIYrj0/85PkrIxWPHOp3SzsuIEAv0TXCEncBBe6Ey41FwiIiEDN56qkwQvugL64McBgCB6Lgkhsu5qoDD2vF2u 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)(396003)(376002)(40470700004)(36840700001)(46966006)(83380400001)(426003)(4326008)(82310400005)(41300700001)(81166007)(5660300002)(70586007)(8936002)(86362001)(6666004)(70206006)(110136005)(36860700001)(54906003)(2616005)(7696005)(2906002)(34020700004)(82740400003)(316002)(40480700001)(186003)(36756003)(47076005)(40460700003)(26005)(6636002)(16526019)(478600001)(8676002)(356005)(336012)(1076003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2022 14:20:06.5668 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 17ed890e-6425-4b0d-191c-08da61b61f7b 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: BN8NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3224 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 21037935e869..4c600cd7cb5b 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -684,7 +684,7 @@ static int __init amd_pstate_init(void) return -ENODEV; if (!acpi_cpc_valid()) { - pr_debug("the _CPC object is not present in SBIOS\n"); + pr_warn_once("the _CPC object is not present in SBIOS or ACPI disabled\n"); return -ENODEV; } From patchwork Sat Jul 9 14:20:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 589121 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 324FBC43334 for ; Sat, 9 Jul 2022 14:20:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229469AbiGIOUd (ORCPT ); Sat, 9 Jul 2022 10:20:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229812AbiGIOUX (ORCPT ); Sat, 9 Jul 2022 10:20:23 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2051.outbound.protection.outlook.com [40.107.237.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52CCB4BD3B; Sat, 9 Jul 2022 07:20:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VFLnOYQVai4EdEmtJHwM5biCf70AzYFdZQQFSVh4FuBX6rez5cQqlNQUaC6cOMSkgwyHSqvJOdgDk7Ip2vYneTlcGVldiipHoTZILUCBGOOSvZRCVI7qHl5xXjw7M2MXRYgS3f7M6g3gFhtTi0hr/uW+eSf9jzEk5f8pO1pH4Y4I3oSLHQa3cU/RbKahPQxXRi5I5WR3HLxMMfz+k7iH8KUIhZOZgANEMFjIE1+TxjYGSKyRVF2+hL4DbTp1cs4Y8Z8dVOC+44U8rxLubm+Ac2QoA6KBU2xQomWusvucI+BwyxNOjm6VKq0879wJiIJVkK/KtxBUP1TijEyN8rg4ug== 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=dCHSvHPRC6KFdt3ifzaVDrVQ6o5jWOzI99fmre0O6J0=; b=O6Zur6WlIocZxTBnyJR96nn/RzCHDqVNFHaCWbbnI+Wy+p8B3QkL1EbetRbUmNO2hvGk28p6aJ96DP5+hMeV4HNIFsvM3qnZAykGoqnWZh2dazQkXY9UJjF34jZf0/IS+qTXfMaQX8Np+jtn1gmLYAYNwp6JpjC5Q8ACG6n7sxTXZ32YkalvXsmeUD+WS3Si5EcAefuPBRidC5o2ZaqGsMrQ8nULZ1zoSj4Eef9MUsebuxPbnCInOCR6u/aO896U4ZC7B4bC78hSTEpHYosIl8h3Qg7CrRPU6lv+Nq7rb2euchDo94Fn8WhmoF5J2c/bNchkkA+CSwC75f+sm7pvBg== 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=dCHSvHPRC6KFdt3ifzaVDrVQ6o5jWOzI99fmre0O6J0=; b=2zra7z1yCGgtO7bGBQoymbslwM8VaY1DqOEfA5WnpekptasudY4nNnbtL/7mliJ3J5JB6AZ3EIR9bhLdX75kbb8IHsFGcuMyjUeweK/boZhJPxsuOSO7eY1ndC1Jp6QMofb6hh3ml/IzZnfv2hiodHNtAag+iE3cPbR/LXl5pNI= Received: from BN0PR04CA0186.namprd04.prod.outlook.com (2603:10b6:408:e9::11) by SA1PR12MB5615.namprd12.prod.outlook.com (2603:10b6:806:229::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.23; Sat, 9 Jul 2022 14:20:19 +0000 Received: from BN8NAM11FT064.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e9:cafe::96) by BN0PR04CA0186.outlook.office365.com (2603:10b6:408:e9::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.19 via Frontend Transport; Sat, 9 Jul 2022 14:20:19 +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.5417.15 via Frontend Transport; Sat, 9 Jul 2022 14:20:19 +0000 Received: from pyuan-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 9 Jul 2022 09:20:15 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v2 12/14] cpufreq: amd_pstate: update transition delay time to 1ms Date: Sat, 9 Jul 2022 10:20:06 -0400 Message-ID: <20220709142006.836754-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: da8fb208-f139-4f19-46d9-08da61b62700 X-MS-TrafficTypeDiagnostic: SA1PR12MB5615:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NfLCS8WzaEW9Af/Q6072OcXQjhukv8utI6Ei4iLglGokZTjzsiAIHGArpp70VMGP/t2b0VNol195HvymK3ilLLB1Zbbc9FG/n38OZc9Xt97e31/vrw3O1JSe+tG+TpTDNmHVJNiFwSi2olHtk5nwu1jmiXu1NYaEvf/jn9YS4s+OmZZMBmmS6SVa3W5d6LqzpIijZ5bgQK8FrEvHFBmvAa4zF7Fk792bIm6C/R2suAvSXl4+nQCh2FiZyWg41yZgLxoDrRDqrphrd/nZKV//TYZn7B+E5Rr8e98k+a+ClUNXapJqmWHvdJy5id71VD5Z5Iz06cfq0o1rRyqz/CGm9Naze11bUwV+NcgNB1KwtXa3c814lM/RTCX0Pnhqmy8m4mCJjjtVgTmMCU7N5X7MYLg2M+tdVP1986ycAMWsXdS1vo4pPFy5wtcEPrc5P6x4to0Xz9Kx+GHJDM5RAtQ7gF3jH8So61czO9bx0HjM0kr5EPRuv8DZ99LYtIdwj2hy5xXv1y9ycTvaTNTCXAnrYJmDQp2ubAXAIiAtYoo85KLor1ga8ebvWGmcLcSwf/PvpCuYd/TTUqRTPgdw2P8wi6pvWVINlYt7qrj/UEczDxWHjQW+K0ekwAUyp2I5djO2xsauXBnlvJwHG0ZwwcU7pb6ahK9O0hDGuwW7xofIJq17LupGG9I61mtZGE1g3G1651qF8wfGOoxLoLTuyJqmdyfhA97bNvwhnjpwhH5g7Fw7pnyKAJMQZhiz+t477Sd9etxAX/QaQb+l2InVDbtEZzQUD+OER+1JY+a/L7uYbpCbOzeZyJ32gbLjI9WNWYiVfeUdB4s2AOvDGO5MOe5eFJ8BAqWS7uEr3jv1+jMIDWeu/0ETi9A6dsdq12Cc9P2c 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)(39860400002)(136003)(376002)(46966006)(40470700004)(36840700001)(36756003)(86362001)(81166007)(36860700001)(7696005)(34020700004)(16526019)(83380400001)(2616005)(26005)(356005)(82740400003)(426003)(186003)(47076005)(336012)(1076003)(8936002)(41300700001)(316002)(54906003)(110136005)(8676002)(70206006)(478600001)(4326008)(6666004)(70586007)(2906002)(15650500001)(4744005)(6636002)(40480700001)(40460700003)(82310400005)(5660300002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2022 14:20:19.1993 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: da8fb208-f139-4f19-46d9-08da61b62700 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: SA1PR12MB5615 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Update transition delay time to 1ms, in the AMD CPU autonomous mode and non-autonomous mode, CPPC firmware will decide frequency at 1ms timescale based on the workload utilization. Signed-off-by: Perry Yuan Signed-off-by: Su Jinzhou --- 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 4c600cd7cb5b..8ba4b98b7108 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 Sat Jul 9 14:20:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 589693 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 8E474C43334 for ; Sat, 9 Jul 2022 14:20:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229756AbiGIOUq (ORCPT ); Sat, 9 Jul 2022 10:20:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229811AbiGIOUk (ORCPT ); Sat, 9 Jul 2022 10:20:40 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2083.outbound.protection.outlook.com [40.107.93.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2894212AD9; Sat, 9 Jul 2022 07:20:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YXyw98vATkQFV7oM5AcQTauKgFwAfJCxsQwhHzNvknsaEFUQjRvHIioCHUgQWZkout+JokZdk/YMCuIrJb2SExWwjhiCREqNTOuN4AaeiO0Prhc24x8g3GosLAtmD+o4f+qdQlFD61Djnv/lGcUXr68DfdFzWhuxypZlX+/XHphiJ/LdWo+D0PALKbUJrjMQC+p4YlMifQa7NI4w01eNzVKbOvYTxLzlODSClY8mdsRlVVypCsnm3xaqoi3UjIH+zSYbXTCG7C9fIEzEw19nu61DXmO1NwGAxG09FtxdLcXHnU3mdFo+0SHg5JvqkXICStTbzMLRJr8eoRpNmvWvJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4GyzmVDCJcEPYjeURfC5aBvySzwWEqQNpnsQPQDsfQs=; b=E/MsdMIOgQNe40PYp0vMaQyimDJD6M8HKenhdn5/KJgf/tpD+IoVmQRcO5yXe4JwTY+U4ih8CmZAkf8dpxFbzCo35SP/k6x+9A1WUlP20NIG2+VhI/WqvqsGUYHo/+erqSYYDTlQKvxtgLxEPQz4nonfu9hOAohqh5qn4uV6ZMM2dchPF7EhNC56H6CS2vNNQ9ZF1ebjdxo43qL11kcJenTZqGrkG5AYLARshr30UJ6ldxx5jPDcqWs83MlNuAX2CR5GWSdgG1OvfwAJrZFqjuomncLynLIr4BGJqqPHX2QHfBGeWRmsx/pOIO/yssHLHLdiuiXsqXkJ3wHtwzXO8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4GyzmVDCJcEPYjeURfC5aBvySzwWEqQNpnsQPQDsfQs=; b=PPp64PpzBdl2Da9WuGSQru+pe2W0E+eMGUnNB5LJy1FKCCHY/ZVndlirMVTmiYfT7CueKFaWocSnNzGGXij9gzHWfFaK7uq8cXK4QZyoMu+0b/UVHeP0REHzrEMbnhjf+7A6npL6U1LgU8cCg7zNzeE/lna5+YpWKlRH3fDsOBw= Received: from BN9P223CA0016.NAMP223.PROD.OUTLOOK.COM (2603:10b6:408:10b::21) by SA1PR12MB5638.namprd12.prod.outlook.com (2603:10b6:806:229::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.21; Sat, 9 Jul 2022 14:20:33 +0000 Received: from BN8NAM11FT038.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10b:cafe::10) by BN9P223CA0016.outlook.office365.com (2603:10b6:408:10b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.17 via Frontend Transport; Sat, 9 Jul 2022 14:20:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT038.mail.protection.outlook.com (10.13.176.246) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Sat, 9 Jul 2022 14:20:33 +0000 Received: from pyuan-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 9 Jul 2022 09:20:28 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v2 13/14] arch_topology: remove the acpi_disabled check Date: Sat, 9 Jul 2022 10:20:19 -0400 Message-ID: <20220709142019.836919-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1e772275-84cb-4f1a-7965-08da61b62f60 X-MS-TrafficTypeDiagnostic: SA1PR12MB5638:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: p7cVnUCoPmYvzFa2sCoGnH6p+uFpHwiDZ8vjGO578Ws3lpPi6fKvWX/kTL2d2S2Yjjk19RtblAfzBecYxzqGlKw71dspDhgYl7OfqqRhAvXW4HoEUct+8ktFTHfuV6M2YTFk5bpIOdjGvr7IPMopVmK+I1gT3UE6dPuX8Z+iayxQ1GnvT655oR9LxBe6ldloF+dWg/jWT2UKtjRrCNBaL2n4ahBLdnwfF53iLpqSRFpCzMe8Uszh1wd8ihBH5xOEnF5SWiZlY1pCUcLeLnScyPw+NjbcatXp543xBOhrAAB9VJBs7AKvcaDTimBJMjEhxOcNLbTbTx3ewGAt4wdpspcTiwj0XlnBvDWGLWtSbc1cqSVo5WEJ1HQkZySCpfkC9zfCZ38KX79moamcaWkwLrmgH3cZw/nLkOPJ84fD9LkPvedjgPmkMywN1QWpJp07430pMpfBPZxYOkhmDgOJq9VBePiDssU0IQE3OvdwhTP071zOqTA4zWvZVjQPYOSKPOlNDP+LMiqiQUmcoDt9C0/kiJhMDEQOxF7ddibsLRWDhK+v3MBkpot5hS9NoUmDblh+Dxw/PgEOqygMF9Lby3bzHwmm5KDi8hCaQJZa4TZ+si76stBikBb92uNs0/qyx3kfuZzxi4TCJl+ewsdLU4C8SRAFpTNKCw58l+F2xAgGBQrg1a6b6moXklBNiDRNTBgWVzUkNeOfe6uUOBo1OOEIgcDhzW+1NAqphTk6m4+zpcefkiNNZRbuO7z8vtv8ngoiFwgH6Ow2gC9ua0AySyWladAU64rbMdpMSft9SfJIeInVFgiE0+Dwsj8pg63m+RxD5/7cCnQKv5n9AAFoaupMqD6u99tbky6FSxyGOgr3aFBEJDVyG87+Hlb6F+h6 X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(346002)(376002)(136003)(39860400002)(396003)(36840700001)(40470700004)(46966006)(1076003)(2616005)(8936002)(40480700001)(26005)(4744005)(5660300002)(2906002)(41300700001)(6666004)(478600001)(36756003)(16526019)(186003)(426003)(336012)(47076005)(83380400001)(7696005)(316002)(54906003)(110136005)(6636002)(82740400003)(36860700001)(34020700004)(86362001)(81166007)(356005)(40460700003)(70586007)(70206006)(82310400005)(8676002)(4326008)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2022 14:20:33.1734 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1e772275-84cb-4f1a-7965-08da61b62f60 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: SA1PR12MB5638 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org "acpi_cpc_valid" function already includes the acpi_disabled check and we can remove the duplicated check here Signed-off-by: Perry Yuan --- drivers/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 Sat Jul 9 14:20: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: 589120 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 007A2C433EF for ; Sat, 9 Jul 2022 14:21:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229813AbiGIOVB (ORCPT ); Sat, 9 Jul 2022 10:21:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229586AbiGIOUu (ORCPT ); Sat, 9 Jul 2022 10:20:50 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2048.outbound.protection.outlook.com [40.107.223.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06E4C140F4; Sat, 9 Jul 2022 07:20:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ft7czpqRZGTm7GRflr9xaQF3KaSZrW7Fcc9M69JRkVRco80ju392cVt90fUUHuQTTBfe1MBCfeuXInHkUlh1THZ+LeE29r0yqdgk1w0s50O98EKLZWzEGpLyFjgGZrkbw0M4Px4egzE9dPtgZb9jaBwDmU2pgQ8eJyd6237hm1tnqGWxhZQNtkZiSODhBAnQr7iChEQDUMt6hEHBFpYHbIu7+bIZiWGi8GL3lk5QJsFbEXtq/oADVZvRgoHO7V/95CNCfjc2N+OdOUkV85mTyr13Ozeku+aQrIt0uuJ7+RUG3oEoBWwCV+qRV3EewcNZJM4sTbgZ+lkEIl1w/gArAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Pg1W6FnKHehDtSxZjy9OOG/riwVCF9EOOqtUhcHbOHs=; b=S6bLEW2kwKDSqfgOZ9Ilejpsg6tNNi3YkzY8mY6yEzrGrOaXBypdkUyGbFJpTN65/F6uM327Fv4Q8CvxUyPbw9ayERHqhFyOUo+ZtSP+xi6wfP9CmvdOFcz/z6deI5RJYppTCG7LequtdD7ll7RS47VQ6xsBw7QZydqLnyKT944NcPP21/k5LJ5VlJjyW/anwKP5WrBXnt+8iyOQp5DYs8MgHspzasITc0dxDrEHweoq1KnPYAb/AL0WqZT5dORx+mMSWeiyx1m1c9hJ5IzJ4aqcPjLvkxDpu33Iy+EfwitO5K8L8U+v+o1NHDPh3kYbVkvLQX8RBEuGcWROocjcNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Pg1W6FnKHehDtSxZjy9OOG/riwVCF9EOOqtUhcHbOHs=; b=IBJaHt9aos6M2epiF2f2oZw2t1rN9y6Xwd3Y2O7ZAr1SsvjiEsg2LLKI3OcvW/mwNk/F4dYaGH+JlHKcfjjcNODefgGdvSIynCWJyz7qATwYJp+C7iIBVOU2d4yqawT8vvoRmlKbMhweLgBNS6nZSzi7LeZi/Y6/XnijgeTfrBs= Received: from BN9PR03CA0088.namprd03.prod.outlook.com (2603:10b6:408:fc::33) by MN0PR12MB6366.namprd12.prod.outlook.com (2603:10b6:208:3c1::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.21; Sat, 9 Jul 2022 14:20:45 +0000 Received: from BN8NAM11FT047.eop-nam11.prod.protection.outlook.com (2603:10b6:408:fc:cafe::89) by BN9PR03CA0088.outlook.office365.com (2603:10b6:408:fc::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.21 via Frontend Transport; Sat, 9 Jul 2022 14:20:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT047.mail.protection.outlook.com (10.13.177.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5417.15 via Frontend Transport; Sat, 9 Jul 2022 14:20:45 +0000 Received: from pyuan-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Sat, 9 Jul 2022 09:20:41 -0500 From: Perry Yuan To: , , CC: , , , , , , , , , , Perry Yuan Subject: [PATCH v2 14/14] cpufreq: CPPC: remove the acpi_disabled check Date: Sat, 9 Jul 2022 10:20:32 -0400 Message-ID: <20220709142032.837089-1-Perry.Yuan@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 73c98851-8e07-48e9-c901-08da61b6369b X-MS-TrafficTypeDiagnostic: MN0PR12MB6366:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eBZT+oZsVb+epJ591CPxnWJPFFkg59Tsy2bdvf2QzhkA/OrghZAOlmKX4bMcvMt9HLBmhF6g2tV9la0zwHqNpB+nO8kfmir0V8MzKMNcDK5k4rERqQmi2sIQ2IkKVlO1isZKIus8CVq40rUHjrGV/Jsatjk5KPtvZnL9iYQJIA2TTSVzrMTS7XXqSn6JYQninCWv4EruQmrNMXpReSn/FCOQz5QhxRfoSDp0ZUN3gxe6Ccz5IVbnjSTPueSbvTFdDlbEP9RpRozdnwxvNCMCzG/17GTB8X5tZvubalRgT/Qgt40N8fpffEoDMxemgEZh5vk1E0tnM0aQjDSChs5WhsO7bTqO6nBRVLiKbGl7UoV7OiWmWM1BaE5ogBJtLTDSI1sOy4OC5u/UXr4P2BP4ZsiKDCDHi6CjhFzHLmQKEIYTOq/eY06Ckxlf2ZbffEwsSf35xhg2eV0lXViQuKPmZ4e/+dpD+0tZg1uG5kxhZre/tbg2IHqdbRdjMsOMv+BLMnkmwtYd6wbF4pjTgc4RU2ZGLb3vv+KNj4R2ND2BJV2sHsM0x6PiiWFoqKoMnBh4qaSC8HVxCHOABBFww2fA33Niu2zWEW8yqyFmFuaih+bYBjSHZRdQRIHoKXy32/6+cBN8xBFkMI78hl3lV32ImnJ2ErUtfoIXv/BSAHThWe9Uc5N7P+og3pypAD/G6qm2Lmb/oNlkEScZpJlKFYLkGqxijVu5PrOIaxGd2UlN6nxfv/yFVZKDmXo0AVA5fo5LRrVYnYLJK33m1d0aovbmtVSO7hiwOlBwTYm99Ali+iHHws4jMGvYq9TISgRtHznSE+p0S37PB4/C8eEU+cjqHZlgAsys8I0PjCY6zitF7BELEWn7CuNzlCQxmRwavgwB 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)(36840700001)(46966006)(110136005)(316002)(36860700001)(426003)(6636002)(26005)(36756003)(47076005)(186003)(34020700004)(54906003)(16526019)(336012)(83380400001)(82310400005)(478600001)(8936002)(81166007)(40460700003)(2906002)(8676002)(5660300002)(1076003)(86362001)(70586007)(41300700001)(4326008)(4744005)(70206006)(2616005)(82740400003)(40480700001)(6666004)(356005)(7696005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2022 14:20:45.3842 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 73c98851-8e07-48e9-c901-08da61b6369b 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: BN8NAM11FT047.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6366 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org "acpi_cpc_valid" function already includes the acpi_disabled check and we can remove the duplicated check here Signed-off-by: Perry Yuan --- drivers/cpufreq/cppc_cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index 24eaf0ec344d..9adb7612993e 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -947,7 +947,7 @@ static int __init cppc_cpufreq_init(void) { int ret; - if ((acpi_disabled) || !acpi_cpc_valid()) + if (!acpi_cpc_valid()) return -ENODEV; cppc_check_hisi_workaround();