From patchwork Thu Jun 13 07:25:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13696226 X-Patchwork-Delegate: mario.limonciello@amd.com Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2078.outbound.protection.outlook.com [40.107.220.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBF685CDD0; Thu, 13 Jun 2024 07:25:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.78 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263546; cv=fail; b=lFAfd6rwRy6QHYeipELt8WUxW15E8VbRyUo4nzr6uRrtaC6IS5IiwbpHygMhgK9Zy8xpFRMyZdoYKGATnZMJZ+KyrpjpZslsFkALaNsxcxJipw5MLL5lZA8gTDNAKKh4xt04CmWD8b2lxMEBTfpc0H40CkoCOew9SQCYlPtweao= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263546; c=relaxed/simple; bh=PkYLlZjxfECQNAtTpwSLNaDDoS6fj9PfSinZeOrh2Ng=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uKpTlnb75E0xkYQtndPArhW78ighuR056JHtcMKfpflJONx6vIVzLg5bgph41igzY+LFRMsc9TWAZ3f0nkTIteo0VC2pe6De4IUD0vjvFellVMyYf4itqJV7WSB5QrTzXZcLSEGstALmq/nQqN4rUrnybRujugrytJUtCF5SLnY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=tWKj1cXH; arc=fail smtp.client-ip=40.107.220.78 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="tWKj1cXH" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lrrs9SCSE4KcP3HoixoeU+S9ggdZBgjgpKZ7JKTeDTUz9PCo9NTPaPawafm28xQhVgcKJ/ompv4+zLb2GU9/K+OKa2Yk4tWj8+xdEtKdIAn2V53Gtj5/lN/xCrQJnRvSVWPMmurNNzKKLGbT4IU2TzEAIQMNyWBLZhg7dZeLk0Pr+CYqcvPfcMVOQ51qZB+qRQRcB+E+k+qvSRQ1ub9HOzy+uuVM7P7/Kpx128WaWrrqAHwvzzMekVOYXlIGuqJnS9y+MXKh9kg/fzfM9zZKswVwxSVd1r08jsKUgnqHKOyTNYFAQwgAyjvKUK1SmsAYGIUOOObxHzSuq7DDvmF6Tw== 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=RQRULbL83Wq7yBUahvTIeQJ17zPzxLeAflkvrXSzwkM=; b=kLZP69/kStonYgXAHHB/+7nMtdzy9i8PfTEXspTt4cCm5KtnQ28pl+hd1SnucxOVdJCKlsYRwbOdBW/phC5oL7I4AMZiE+E+loGqBJCgtNzBOYhFzcMrQzbUtpddUWN1YT1ijO0fuInYdLXyCGQBcqioism5HDq0Nl3hfi2CfahqbYmxC/cZCNh34CyKxmVPpvo4/5Gyg4B6N04Ug3WTsUD9bko5TU66afUlvxgKACP6NcNO06Ql4R1qirSW6sx0p90BxsZ0K9GlBnBhqcGXaIdORkyQ0e4l3gm12HLENweyKMqsYNJIpF09tXeUxzK1gSpO+Vh8M6mnFp1n4WgNOA== 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 (0) 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=RQRULbL83Wq7yBUahvTIeQJ17zPzxLeAflkvrXSzwkM=; b=tWKj1cXHCL17OEJLTLKFxzFsM3pxsyls5UimJFR79OBc2lzUbGRRvBKvRwv5B5ilT+lK5+AYUQkq3As8qPUr8eQbU3yH1CHnFQpcz53107DGbvpb67TYHDrJRkw4NMBXczHUYkDATIl5ToG6sip8pshhBRpcqCORcdPiW6NIOTM= Received: from BL1PR13CA0072.namprd13.prod.outlook.com (2603:10b6:208:2b8::17) by IA1PR12MB6457.namprd12.prod.outlook.com (2603:10b6:208:3ab::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Thu, 13 Jun 2024 07:25:42 +0000 Received: from MN1PEPF0000ECD9.namprd02.prod.outlook.com (2603:10b6:208:2b8:cafe::1a) by BL1PR13CA0072.outlook.office365.com (2603:10b6:208:2b8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.20 via Frontend Transport; Thu, 13 Jun 2024 07:25:42 +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 MN1PEPF0000ECD9.mail.protection.outlook.com (10.167.242.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Thu, 13 Jun 2024 07:25:42 +0000 Received: from pyuan-Chachani-VN.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.2507.39; Thu, 13 Jun 2024 02:25:38 -0500 From: Perry Yuan To: , , CC: , , , , , , , Subject: [PATCH v11 1/9] cpufreq: acpi: move MSR_K7_HWCR_CPB_DIS_BIT into msr-index.h Date: Thu, 13 Jun 2024 15:25:13 +0800 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD9:EE_|IA1PR12MB6457:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ed3c314-e697-402e-7bf8-08dc8b7a086f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230034|376008|82310400020|1800799018|36860700007; X-Microsoft-Antispam-Message-Info: k1mlgG9UUFGHMKSYPyZrGm3afR8ARntwepK9G540pH/52uoZDev2ho5lwwtUTcJ/Jv8qPzaPPuKEaZ4NKBD7//tp9vhF/GUn/g3n4YyM9IW2UGniWyVjrobSUlMr/TVsBon2yqVhyKvuaAjTK8U6BBpStzw48zD/E0WuZ/zddkEkUPlueNnKB7+HUyAw4mySJhEkUeFF4Uinb+qMPnvVkC7M9FbdDLa5oD8fmjp0w7lzgAg6yoQX9lIzicRrUHw5rcvhvaIc/LlMWIkXmVjh08YLs13P906cbmYyzI1zlJ05AUVuZiCEWFc0gZcCconiqgRuCMNwZLzo58g11BrsrmjCotc3fYAQScKYHGNRMviMCqWDJybRPDh6bthqNBVe/yIbWQBui4PCzMAIcSr/UeahBMo4Hf3nOymRgy/25enPyblJyzav3OmbFOCBXjavJR3NNmXbdjn5ZlxUWl1PU+wQtNENGgiXSNpaGEodfTcUMR7aB1v0+0JS22erYgbV4DsM+DvfPRxpzVhaMpHVphoR1sdA4csAtyYyMihZKF/hUi2FzKyrz9EWYOyLNtbwxBU9Dgh3Opp3gZ2qsWfqQy9WDn3jTAphlMlvWBQKaRTe2QZHFbmGWFZWy9WPSjFt8caSTpckmhLdCnMXihd1Bcf1DdiT+lRGAwwAq4TV7I//W/IZQqwWfWoCYTE7ZioEcN3FHnTg9Ekd9JYxsWzOFTMlLcL6l/23lI47tBwEWpYmf4sIJRzoiM5Qv6t/4rb7d2CGRZkkXPflvneiHgjRkkTFUUYD0jEEjrHb8FRfs8emL05ak9NzIOwxsFllXVgT/5NFUSulRfYoyGaltmkUWN84MWnxf4wK1/xln/lCIzUoS/b1gl88fAo/W+xg0U/wVoqAyJ2no+G1COyHW4ix7NQbIjiy3bimUbYcWWNuzFFvuQXOfUt+SPZ+aL9AZvJl+AQMOjG5YxcgZPqWsIewsUos3Yc7VqD05xAj4tsisKfdB1mQVls9v3q7ft3mgtVdQ4jlRE06loT3YH5occfSzOCju4MaIce0eqkqz6UmzyXJ82goGXnCO4UQqXTD7zUPGJ6+N5Lk0mqMaPF+9Xm5wSz25qLDtKvhW4uPU1Cd7cr6m28geKU3AgaYRkIRUAqJzPtQd7hqUKE52g20+PXjNbHHrdh6aXWxOJlsyWmed3WdH/mtkr/4M2usBcRFhl1zjXmBoDMNIfhgL/7mPp2i8zw5UbknDfyap3vWUfWsfccaqS40kW+YjwZ+0ktIbn3ly1Jb/wtEXQ+WJ6+eBiKtnsUAYi8b7DDEHlImpIvuf9iBtOcRhmuXNY7Rubw4q0SvSO7wTiSrZs0+vS8Ovq/V4H0XhEYpyvKOvDRD5rEAI5tlmU02eqsfwMKUeTtW03n1nvPCxDmk4aV5+vgLKo82Mg== 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:(13230034)(376008)(82310400020)(1800799018)(36860700007);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2024 07:25:42.1062 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7ed3c314-e697-402e-7bf8-08dc8b7a086f 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: MN1PEPF0000ECD9.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6457 There are some other drivers also need to use the MSR_K7_HWCR_CPB_DIS_BIT for CPB control bit, so it makes sense to move the definition to a common header file to allow other driver to use it. No intentional functional impact. Suggested-by: Gautham Ranjal Shenoy Signed-off-by: Perry Yuan Acked-by: Rafael J. Wysocki Acked-by: Huang Rui --- arch/x86/include/asm/msr-index.h | 2 ++ drivers/cpufreq/acpi-cpufreq.c | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index e022e6eb766c..384739d592af 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -781,6 +781,8 @@ #define MSR_K7_HWCR_IRPERF_EN BIT_ULL(MSR_K7_HWCR_IRPERF_EN_BIT) #define MSR_K7_FID_VID_CTL 0xc0010041 #define MSR_K7_FID_VID_STATUS 0xc0010042 +#define MSR_K7_HWCR_CPB_DIS_BIT 25 +#define MSR_K7_HWCR_CPB_DIS BIT_ULL(MSR_K7_HWCR_CPB_DIS_BIT) /* K6 MSRs */ #define MSR_K6_WHCR 0xc0000082 diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 37f1cdf46d29..2fc82831bddd 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -50,8 +50,6 @@ enum { #define AMD_MSR_RANGE (0x7) #define HYGON_MSR_RANGE (0x7) -#define MSR_K7_HWCR_CPB_DIS (1ULL << 25) - struct acpi_cpufreq_data { unsigned int resume; unsigned int cpu_feature; From patchwork Thu Jun 13 07:25:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13696227 X-Patchwork-Delegate: mario.limonciello@amd.com Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2072.outbound.protection.outlook.com [40.107.223.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0CF9913A863; Thu, 13 Jun 2024 07:25:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.72 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263550; cv=fail; b=TS/GpJAXrsd0sCfu8K6a6nyighTLJ47MGTUTklb6+qz0BSB9FDOTrEjnTrbx8KJ87HgJhJrWW+HOZTTfUVqbiHvCM07zYqphiTcW+2VJpNj3eMS9z0KxcZOUtMl2m3f2FkPiW5RP9u702lJOKMDZw1OcSvi84o9bxqmm3VMZz2c= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263550; c=relaxed/simple; bh=vsendM3U+E9e6e+rLkMKQ9YDWjUbu+6LwfwzXrpFbso=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=g0JjBxjgQ1dbEEENLT3eTz0pq6M5uioZkwdnd3Snp342MVOb4s5WbtADqncevHwjA7mrK+b7QgPLB+zx3YXU3FXUrU/iy/kJavCavNlKpKob9VjVTYZJHtlK8kFVW/56qx9mpeo04qIkaCX/aLzM9eX1FGHSjscCWQfXBCJ4ZRg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=Ct8foqGP; arc=fail smtp.client-ip=40.107.223.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Ct8foqGP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iYf7GGt3yAs5PSBWYpz+R+yRLKOz2ALdDT5EgXRFF85wP0llCVW6tZbXHtJeHONzmSN2rwbDjTFoadpMd3Wi3wzAk5tDBAhOpgt87XNQEf6fqDISWVDpMyZWVvxohvq2clLSErILUAeMBuMPvZ+ZQJaG8ioNT9OvrurfMzdYniY1dE7d4qf9Q1HQwN0aIpKqmCVwXJ7UvTWHgnwcqfS+2cQuqkjDESF3U1JIy0QpjzdEVYFI0MvCld8eM/pK/AknZASSNRQANSURFHtFAxgKwei+TNJhUvf2c56KNljNwWO7iwD51tAmOdlukXrWjjvzbCH26zTWwv0BuWyYh3Dphw== 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=EyuolwsbPTaRoS6mFUOMhmMWrDGNHcEtdcu6aMTmL2Y=; b=euU4hg0RFcME+CRUgOfMRan4yqKxN2sYIWuD2EE5LO1n4LYsameMJVY8QU2nfFQcDQT58CYd3SwVx1/5k3CZ1VB2Of8nOk76HydPqKiynGEuKIQ1DhfX9RuBtPRbOMO98CV1oc38E68OLzbHMaOKaFrXgAqNz3b6IwdUsz6uVf2Z0+v8dg1zWyOks6Sb6kzmB1M9bXa1tPi+R1zrLtDnBVmyxiyJJ45//ePn+usY9oJHErq0CSpLEvVZ3TNJ2KZbkc/IrGbVulgCea9l+rNNVG5R1RiGU9hgz46MAHUdiR4k4JLfslNviiop4QFzh/kEPc16SWE+lKPLQkgMsX/gyQ== 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 (0) 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=EyuolwsbPTaRoS6mFUOMhmMWrDGNHcEtdcu6aMTmL2Y=; b=Ct8foqGP9gX6zvJld+24miPNbh8FzUJnLPaZANUyqqLHfJjoLJD1mffdlZPwj4LRCm4oAOOUyXt5slfOuQPisd8okIwhWd/F1MLMmRaU5SuLU4hqlr9EwKP9TJN37cJCofRORqFs9Xxn8BhruGL0fol1HuSQ0D0WCDJNSy5gSSo= Received: from BL1PR13CA0090.namprd13.prod.outlook.com (2603:10b6:208:2b8::35) by CY5PR12MB6621.namprd12.prod.outlook.com (2603:10b6:930:43::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.23; Thu, 13 Jun 2024 07:25:45 +0000 Received: from MN1PEPF0000ECD9.namprd02.prod.outlook.com (2603:10b6:208:2b8:cafe::f7) by BL1PR13CA0090.outlook.office365.com (2603:10b6:208:2b8::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.19 via Frontend Transport; Thu, 13 Jun 2024 07:25: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 MN1PEPF0000ECD9.mail.protection.outlook.com (10.167.242.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Thu, 13 Jun 2024 07:25:45 +0000 Received: from pyuan-Chachani-VN.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.2507.39; Thu, 13 Jun 2024 02:25:41 -0500 From: Perry Yuan To: , , CC: , , , , , , , Subject: [PATCH v11 2/9] cpufreq: simplify boolean parsing with kstrtobool in store function Date: Thu, 13 Jun 2024 15:25:14 +0800 Message-ID: <490341a4cec543fb95aad76b257a2bee525c515c.1718262992.git.perry.yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD9:EE_|CY5PR12MB6621:EE_ X-MS-Office365-Filtering-Correlation-Id: d5bd9d00-06c9-4b8b-3f44-08dc8b7a0a39 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230034|82310400020|376008|36860700007|1800799018; X-Microsoft-Antispam-Message-Info: zBJNfwWoQ/Sld+9hSxt9xe9QxJfVgezQl3E1LHkJ87jA7ed0sb2aErBCoi/DbFKgtNlzgnXMwvD/pg72GhKKS9Nv/BTtavtdPwEHa4n+EvB/BkRqiY5azjsqJ5iT/aZykf9yjw4m8pS7cyfEmModKmIXPm3k5XCIcGXfHYDMJXl1YL5TYwGeS8QtmgCE/CeeYGHAEqqr+AsaDvZIPR3e0/PmLl1yztlpUuGTN9i8mEBQ/DqFbb8SpCKDH7Utg9pYPxTK3BMIxRKR9Xve2/dNZCCtadUBvjw+ENwHG7GNX6t4tOq0dUsq4vFgHr/0iQt/oJS6x5CdpQKvEDYdPBTSZPXI8nv+upl1QLAR3u/LZa/6y3Ox3b6R8UKX4OrIUn4rECbsfIH0dlWPMjimxkmMXpUbzYKzHrfb8E7klLTnlr1bWw8okiKnFt6dknEAIQKpMTW+wwHXW+BddE4Crzm4KobSlGs/HqEKrMaPfRtAV97DWSQZYMt6Aqx4lBOzObjaXPzhTEAKgx4Nawkam8YQGXiZFL97OWdAVYKkhTiNLyFmHhIPN62y5+WzvOttvWe8csdPJ7RqmVkKB0TgSFfrLpsaKCu+Y+f6WjTw8bthCtXEfQeI4nr8pGEJwCHox/SsrP90I0sHt+EluKqbVYCxawiVrxiYeMMLasXNonkynKZZ9oxpd2R6eAE3zBBjJtqV/bn0isLJSj4T0GpXQo8MNrjxcmZqrYD4AVIyCkQL6pFCfHJU3UWMOganx3lWf9yqb99l9N++zVf5rLkWbeX795Q7aByfOaHiiDaLctYROueRacIMDfDWH5MxUVKA7PvM/M0iTmJn4fxSVzojIdBEWlDuWLHC3RfXpnp4nb7dYIGlTiM9fy1lX/5uaqo+/Gol7ivYz5LlJw3rQWLB3AuYWyx5ZXGteWzsExbdR8olBBAzcgCyWj+/2HiZa/FTxL4majLY3f4IUWtYpruMUDRaPwTisTUAGrZnFWrgSmKHMhLgSidaGzCfDXc8kVVxMpfaGzRn7GyLpJrr0FvplgHemHS/J38evYDkfkq1x7OtOvC0GVqaM2xMUdgq6QOgdMq4HNpoYhCtmOJ5Akk4k2H0HCaC5ki7sRnzMl0hA+Vl4q8wptf1Dh7WUb62Zsp2dVJYnDFCCy0LJkm4RQ2ng3mUIraRxp38jclMGvGh/L51EhYIHLYXIPqF8g5S1UVGJpXrDphrMnC8wV1kcYXZv4ePBxnKJ9ZdX/yMDkLDURLgaK5jlgzo74pHwDvJOvoHlkAOnbXU1P6GSkin+WpbOaU8BX7MF1Vijs60dBrUEHjQDN+X6gFMcFXcFS4+3FDVIiyXVxavg9O42NSlzQaTr/SCtRV38MuENj9We68sjjdg6o7uwxhFGOa7Koh2E9xHOMkL8eYDggIp1dbCZ7Y3NoVm3A== 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:(13230034)(82310400020)(376008)(36860700007)(1800799018);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2024 07:25:45.1062 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d5bd9d00-06c9-4b8b-3f44-08dc8b7a0a39 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: MN1PEPF0000ECD9.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6621 Update the cpufreq store function to use kstrtobool for parsing boolean values. This simplifies the code and improves readability by using a standard kernel function for boolean string conversion. Signed-off-by: Perry Yuan Reviewed-by: Mario Limonciello --- drivers/cpufreq/cpufreq.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index a45aac17c20f..1fdabb660231 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -614,10 +614,9 @@ static ssize_t show_boost(struct kobject *kobj, static ssize_t store_boost(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) { - int ret, enable; + bool enable; - ret = sscanf(buf, "%d", &enable); - if (ret != 1 || enable < 0 || enable > 1) + if (kstrtobool(buf, &enable)) return -EINVAL; if (cpufreq_boost_trigger_state(enable)) { @@ -641,10 +640,10 @@ static ssize_t show_local_boost(struct cpufreq_policy *policy, char *buf) static ssize_t store_local_boost(struct cpufreq_policy *policy, const char *buf, size_t count) { - int ret, enable; + int ret; + bool enable; - ret = kstrtoint(buf, 10, &enable); - if (ret || enable < 0 || enable > 1) + if (kstrtobool(buf, &enable)) return -EINVAL; if (!cpufreq_driver->boost_enabled) From patchwork Thu Jun 13 07:25:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13696229 X-Patchwork-Delegate: mario.limonciello@amd.com Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2079.outbound.protection.outlook.com [40.107.94.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5C6513B588; Thu, 13 Jun 2024 07:25:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263554; cv=fail; b=XfkBdtCXE4ccOqytviac+b75qlvkB2FnbWJdMT4ww4m0Tn0Z27sd0LHsBZHpVTCD5QiZvWUeUxkIf1fdOfoxakSMnZhRMLxuSF7zvauFs1dKyIfoSaWurN7mgIKZpFdUf5l5gV9b8ikcWc9WSlAvM5PYxI6C8PmWwJ1I7toKdw4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263554; c=relaxed/simple; bh=jjFQc90GHno+HdVLSHzRJBiHljwU9rcmXZ5lPHIRUZs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=S0OcCWTeA9uzACA6KFWGB8vuUD/1KkXeGmAgcTH1BRZVcYUtlqPmO11x9O+VOrdjYKF9TJkEUss/Q3GshWpI56j5n79z9C9tMP54c5/6ZUei+cOU2qqaC39po0Bw2ssuDjWYBdtA+mmxWLJl5dZZoFziwGDYTB/tEJY1e0wFpxg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=Y1L19VD7; arc=fail smtp.client-ip=40.107.94.79 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Y1L19VD7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EvNPOV1eMs73Yrgnd0nA+JV79JwXTxl62smq9NOb5Ei7z788pmh2hFxtUr7C8vpEPtwd1zbmgItUMVtaAPewP8V0VTA9RdzkHxVlyvfLoey8b2tOaKrpFdqvn1/T+zU5kcbTjDJ2JYxEbTOP23UdvarEg595Sbr14PDdPw8cqfW7sQvO2xBrgc3TPWujOffpxcvwrnRqpuF6jJAYWhZgGiB+nXP7hoYWGh7ju5Os0ZqsC3oBx3W61kGwlC+SMnYAPsOih+y6fUdCJQ1sf0cqIXo3TKFV6xfzlsKcFWUPYspoyerJK3WWxyevB9upy6I562XtYrWdRYpQjFPTw3mQZg== 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=vpzsXCzz+HmVthFkBZD+Z7pbeE9121Wka5BbkKC/KpI=; b=km6FNYdTW7nUtAQuIiD8ILm+9bKGV1eolm4LeM3twU+W9zDCyZnFonOqc6zx7ZNQMQ+4eKZlvCurx0nvg95LEiorntCYnTlRwLOd6BvNrF8Q7HaCvy/CcmyRHqp1lOd80Z2RTu6TZfOMIL0LwHp0W94Te6B3hwnARXNboo9AZVU72dk/rgx+quQLFTerrVnI8C7kKBy8KOX9vAUUDhEj3mb+W4pBzinrv5GVsxLHAxyDU/etZNxNfRCQnP7Wk23DG8EdV8GlaCb2N9SuEC/HAi2kJgu+MtwKOn3iTFNuWXH8YYDGN/ESW501tpaPzLw4ydV2nhG3V9L1BrHsf1hepg== 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 (0) 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=vpzsXCzz+HmVthFkBZD+Z7pbeE9121Wka5BbkKC/KpI=; b=Y1L19VD7N4dl4BEZuDZz6UrpV4rKICxLlWxUI+HW6Bc4eD001cnXrknX+bRkthh6DB2DX4D64PJLe27/Sd2jf105NiCkU4snqTSaxmh4slYR1BLKaLbkY9kDg6Fv4K+/LS46z0w3tYStJf1SM+oRj7gcskAXbhXJoLVZ8jQDvi0= Received: from BL1PR13CA0070.namprd13.prod.outlook.com (2603:10b6:208:2b8::15) by CY8PR12MB8215.namprd12.prod.outlook.com (2603:10b6:930:77::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.20; Thu, 13 Jun 2024 07:25:51 +0000 Received: from MN1PEPF0000ECD9.namprd02.prod.outlook.com (2603:10b6:208:2b8:cafe::1f) by BL1PR13CA0070.outlook.office365.com (2603:10b6:208:2b8::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.20 via Frontend Transport; Thu, 13 Jun 2024 07:25:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by MN1PEPF0000ECD9.mail.protection.outlook.com (10.167.242.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Thu, 13 Jun 2024 07:25:50 +0000 Received: from pyuan-Chachani-VN.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.2507.39; Thu, 13 Jun 2024 02:25:44 -0500 From: Perry Yuan To: , , CC: , , , , , , , Subject: [PATCH v11 3/9] cpufreq: introduce init_boost callback to initialize boost state for pstate drivers Date: Thu, 13 Jun 2024 15:25:15 +0800 Message-ID: <688d8e1ce875655c344ac3b29876da5dc0456739.1718262992.git.perry.yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD9:EE_|CY8PR12MB8215:EE_ X-MS-Office365-Filtering-Correlation-Id: 62bee58b-5e16-4026-b996-08dc8b7a0d3d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230034|376008|82310400020|1800799018|36860700007; X-Microsoft-Antispam-Message-Info: sAoJqk6ut58RXlDrwiDo7cgBOMrcybB4Svpg19kT0w5luVLreFwLcU3tuwxXbAWzMCdIaEZ2eb41R2zJZOc9Rg1hM3dnAslBeN8XEdegPplWEUt0ffYseXUQJOf+xNsa5E9ainlHMKJHroPXjlWk8kpvRoVrDrx1/z5G6tfjBWuViMh9FOVIyZgSr4bk2hwvmXb4XC41iCXEdK5EzhktCQVgSupt9FosO+yGBYWswkEJrCLzGQnyJI/yra3s+v64572Ywg5qUQO3t0jsYUoE6ww5/B7PBluGOohK1RZ0IjTh3YDgEBi9JI5Czskgmoa+BV0HZ10tE3V/sJhXHy6dTcx0WW5OQRQZZSSZ0NzK2ybMyWcUE2fenZcxhq2SaTLvI5nulp2sNOzuLQQ8v+ZTL22SgsKLPqzPEJjz0R9M22SWL71zlRZf/GhtozDbna6OCr3tWafXqH+dV+YAbH6/bMjNmdHB1+aBmg7SjgOZZt0lfIHvn2X9JOxoragIKI9+6lTHxaTcVwqvWDrNYDLgusNiKAjQovVYx2nHVFT1DcS5olRuX/VNL4SCpiCsjZjN5scYkCI5du7iUbuX4pqw6iP7DRfME3H+yVtGnjC8c1tNHx/vM175hRvguCsC5dNIbPpfOCqfzuwGAaAFGnlAydMsQDBHeZDtY049Rj2mChqzwGD5BjFI/Cd0sS0TioHKWFbHL0zLINzywiiNJVkHiGXnb3oyfnRO1F+7h1cbFUGDG6U0lHWjeXQR4pmFgJ2K1sWQVxYUEUoyxCkN4yOB37xH0wgmlqaKbwc8KSsqjAqhGMSfnIfw8GPQ99NEPMcvIjLEGgVIRs03rZFiukjg/lUATCcaLJGH3C4Gd8ikT/SJoTp8FqI20BHr85Khof4hKVJK3Ur6ujfw1+Hl2TyqxkH0FW8+SsMIHxCJhuIqhEMW6DTC53e4rkADVoiLCi/4N+JYSq+zkHOH4pAsE6O7vFjzqPVnzsKINHsJ1fv7MCGgV5e57Zn0pBg48M/ecib1WzH1GUxYqcP4Ad24wrJ6hGSHnp6cBPESZhYq+zcM+zMzLGD6P70W7OhRuPR5me/Mnf8yR8S/9dYDdLEzQi3PO0vKmUTBDlKp4JK5H2pPAMWqGt7HgOUAPx207WS7lUMQPbAtPBkjFLJ0Gx8LX/BMO3Vj1cqNzZBBzv4V/e/NpoAzmQqyLV+kqYiij7SswGf9tVk/HAvmOVtDWW8RHoIfLJjGVYMHZRh0WOl0jb8g80aZ8NqKq7glp1NTBmKiBpygxzCI5xjdv4ZrwXpjPjApeiuVQ1xnfAQQMIc0J7R+twK8PDsVBueJyGfYgJfaelPVB6DndsXjdVuSB+/5icXE+pI+gMNNg22yVnYB8nPgw6w+YdsaL130dSDKFKGAmrZGMHr33gkWCv2vxWiReiNLzA== 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:(13230034)(376008)(82310400020)(1800799018)(36860700007);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2024 07:25:50.1844 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 62bee58b-5e16-4026-b996-08dc8b7a0d3d 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: MN1PEPF0000ECD9.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8215 Introduce a new init_boost callback in cpufreq to initialize the boost state for specific pstate drivers. This initialization is required before calling the set_boost interface for each CPU. The init_boost callback will set up and synchronize each CPU's current boost state before invoking the set_boost function. Without this step, the boost state may be inconsistent across CPUs. Signed-off-by: Perry Yuan --- drivers/cpufreq/cpufreq.c | 12 ++++++++++-- include/linux/cpufreq.h | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 1fdabb660231..e1a4730f4f8c 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1429,8 +1429,16 @@ static int cpufreq_online(unsigned int cpu) goto out_free_policy; } - /* Let the per-policy boost flag mirror the cpufreq_driver boost during init */ - policy->boost_enabled = cpufreq_boost_enabled() && policy_has_boost_freq(policy); + /* init boost state to prepare set_boost callback for each CPU */ + if (cpufreq_driver->init_boost) { + ret = cpufreq_driver->init_boost(policy); + if (ret) + pr_debug("%s: %d: initialization boost failed\n", __func__, + __LINE__); + } else { + /* Let the per-policy boost flag mirror the cpufreq_driver boost during init */ + policy->boost_enabled = cpufreq_boost_enabled() && policy_has_boost_freq(policy); + } /* * The initialization has succeeded and the policy is online. diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 20f7e98ee8af..0698c0292d8f 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -409,6 +409,8 @@ struct cpufreq_driver { bool boost_enabled; int (*set_boost)(struct cpufreq_policy *policy, int state); + /* initialize boost state to be consistent before calling set_boost */ + int (*init_boost)(struct cpufreq_policy *policy); /* * Set by drivers that want to register with the energy model after the * policy is properly initialized, but before the governor is started. From patchwork Thu Jun 13 07:25:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13696230 X-Patchwork-Delegate: mario.limonciello@amd.com Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2062.outbound.protection.outlook.com [40.107.93.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3C4913B7AE; Thu, 13 Jun 2024 07:25:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263558; cv=fail; b=KSDRHEMmcQ/gA8oau7iHiP3WMr87RmeBB7Szd2nx12UjrTRyzOgXc8Yfc4DZ6y2CSjEaY6YYZkecBLi2gXqoSXpato1jZBSlWgxSa60yDYr9Y83rEQs8jFFiFJC1vuynAGKNWgVuy+jGsDtwz9UBmx/Fig9BWV//WQEuj7xuqSI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263558; c=relaxed/simple; bh=nr5wynFq+liy8ngfVfVoNT5ybdINz7sxTUrWnZiB/bU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ULI4dPAxfyv14k+vIvfbYxmdMcsjtcnzJ3cDCr/N5w460XoF93HN0sKQOHuouYtdmR0sNdAnmW7jkjnUvPnzlOgYCItWETRMQA0CZcDCM139XUnPmWz5ONdk+6ZJB4z6ZXy+4k8ZrWfpR6aoEjod4w3r6UL6y6ikA1QIoHxI5BQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=Sz6wZTSG; arc=fail smtp.client-ip=40.107.93.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Sz6wZTSG" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nrGLZ0hRg+FhQTLy1+9vd5cq8qG6XItex6ey0NZRT7u+mXGgLxyCDBNnGq+BkcbaZw9osJT3Cw4FaccpO1P/EQK79nZ4+KRoEy26zNqlF17BNgBtsCsut/q5ZA5gavHMF1j7OQzCR5a7myeIt2AmAUmLfay4nfZcd2Bk9O7BGqSxnk8V/HZmam+ShphC3+ysMUALp/ots2Q7BCvl7Dvq8lOqMVQ3XScq1numjTXo8IKBWxQzKkS82lRJZaqjBrqBz6Fl5IUVGIzTbI0ze5hLc38sHOvDG7QqKn4gRzGZoUmLQN0XG1MdWIOwVAP9SOHbmDXV22YH2bmgKFlWtG8Lnw== 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=9eCh20QlPpy5up+Jj5cqWd8yzvHFCHXYpaxzehSXorc=; b=K6XS6izgCOZu3kejnLWyyzAhvP0AwGwmfmR/NAuxH/EA5N0x2S7U7Ljogvup0hEfBC5G4Ji/4ZN27IxTRY/dHBda5OWjajcCVFRFiiDaw6lU3TguKGz7hvTx+uaSIAYCjriM8f9HJrGBvzgKEFU+BRNi0B05kPddRqStBlMYQ6L4PdZsyf+6VZzBrVd2tl0pc4zyEkdk+UtzqOnfyoGrHM+gZXoVr4VbByx4uLACU3bPVkNe5kJsbxqD8QcZSnbdj0cyHlPgB1vUvwybHA4/fvK3utaAW1FphQEW7J6JXPHlf2mRfQ9+Fsuzsy+UZ+vMegz+l+VoLpoKc1QSZgOdWw== 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 (0) 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=9eCh20QlPpy5up+Jj5cqWd8yzvHFCHXYpaxzehSXorc=; b=Sz6wZTSGU3kAHvdX0lnl7ue0JSvJSU1rizGvcLqLIpOF0bqzj7vYelvDnKMxr7D0fgKPTDnqWS0jhOPhIup7aPdsoMapNaGbrIRbI6/G4zmGittqHPUCiW1JpuxA4zf6+GTR/E6EPHk6s2UZomGQGZaF2/hsChFWiKpWfXTaQfA= Received: from MN2PR16CA0026.namprd16.prod.outlook.com (2603:10b6:208:134::39) by MN6PR12MB8566.namprd12.prod.outlook.com (2603:10b6:208:47c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.21; Thu, 13 Jun 2024 07:25:53 +0000 Received: from MN1PEPF0000ECD6.namprd02.prod.outlook.com (2603:10b6:208:134:cafe::6b) by MN2PR16CA0026.outlook.office365.com (2603:10b6:208:134::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.24 via Frontend Transport; Thu, 13 Jun 2024 07:25: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 MN1PEPF0000ECD6.mail.protection.outlook.com (10.167.242.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Thu, 13 Jun 2024 07:25:53 +0000 Received: from pyuan-Chachani-VN.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.2507.39; Thu, 13 Jun 2024 02:25:49 -0500 From: Perry Yuan To: , , CC: , , , , , , , Subject: [PATCH v11 4/9] cpufreq: amd-pstate: initialize new core precision boost state Date: Thu, 13 Jun 2024 15:25:16 +0800 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD6:EE_|MN6PR12MB8566:EE_ X-MS-Office365-Filtering-Correlation-Id: 1282a955-f243-4c11-1d36-08dc8b7a0f2b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230034|376008|82310400020|1800799018|36860700007; X-Microsoft-Antispam-Message-Info: j0VtqspJE8LZ3tD4lgXC90SSr6UOEeE0XT86i1OLNKhYCET9QmXGiPUZx7a02C1ZuJsdyEAAgS6cwQldcOSwTq/ZEFOd6jfT+jlUF4j2Pi50+EJnCNbzFmENFck1oo52LwtiYXQj251AhV2X/6zPSVlcnEllyiqh2WHf/pMwuTPY9R1t5XhoZAKZC1fOeJwfQcXls3P4AIWwv0MVEU5nXwAygXVjLBqJU4J3SbNozuDSwXFda7fTIlTaPx+aGg7vywHBzVRVRXfVSc6zXNsucKkT98KmXv7GxfaBd+lSmnfVN1kS+V02qC76ZVGF/syGYCtDy6fzufE22/3WtDem/NUQNfNWF2dtUiq+gGQWK/KumK1SRaUEp+YiyoAEs97GZj8sVOuIrg+Haoy3whzoxyn708+Rd2X0QLtmD8UaUEPSGwS6S/k5Et48N7XUWuLcTU12W+ykBH9N60Au79oDrecScds5PqDjzwzGVPFJmYGy/P3VUG+1ndzOWsYrOnT5KsgH83+w2SygStx7oJPFworta3fEIcpOfiPxUOZBO+fcAGRk8mxxdCB3CCs/aoeiG4mAgzuRW2wRdQGYY26xCsxDUx0XLr/4Y+q7wfDlax1991ZPqc1B4p5YpNxOfz3ccjWK76bionVE00TtSy+0RNpdaQ7vYfIFGNrEosStVGWdGwwABnNhwlsmWlkKeOQoOa5RRs/1o12rqP6+RNU92BHV4HrNbIHL7cXj+PoF4GYIWAE+JybCRN31BXVI8G9FlbMbbSjuT3KRpp5BgZN77LkV7TOezZYx+4CffnrumrKpgqYIXDEo7FTb5KUghcVh7MaM6UPupeLT2ANa+vMxY1UASBBkUxy2XdgtUEyp9PwsbV45U5wzr6C+Zs0YGSoq3zFfKteFHHCMC1OQSR1It7d8cysRyF8xZCbePowXmKb4rFoJy5lw+g9LNddLAGkCbnvvF3jI3LFnJsb45oI8xUAkNrG0OhYfiYlwwDUn+Fd+V8cPAsH6RkZT8LrAL/urWVrDBVflmWe4sTn1uYq0KHXuJx+g9e1VHIAkhCjQlnK5m93Vo7vVHEV41c/gQ09ktklbqPcnAS3xFH1lqolkokX7u9mP1cwIbv6M1wsNbqAW+XUOwlNG5Nw9JDBAX1cTGh8kaWz6XuOW1i4zTb56WqyKvQ1w35/5UUi63CwpABWHBkO76xzvS/1b7atNQYrGOUosd7PLgy/GamlsBewbTrRixdun5c8Nn3MYbJKX+/FSzjlGllC7cHIPtDBeZXdKY6rRLBoll8U3u80suTE4OgCJDpZW1oeVKoVCXRKbjemPJhFdtnuXr6pfYvmqz4vNTJbDppechVIJ0NCIixtbgoGZhaQBt88tam2+Bsl/XlE= 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:(13230034)(376008)(82310400020)(1800799018)(36860700007);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2024 07:25:53.4178 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1282a955-f243-4c11-1d36-08dc8b7a0f2b 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: MN1PEPF0000ECD6.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR12MB8566 From: Perry Yuan Add one global `global_params` to represent CPU Performance Boost(cpb) state for cpu frequency scaling, both active and passive modes all can support CPU cores frequency boosting control which is based on the BIOS setting, while BIOS turn on the "Core Performance Boost", it will allow OS control each core highest perf limitation from OS side. The active, guided and passive modes of the amd-pstate driver can support frequency boost control when the "Core Performance Boost" (CPB) feature is enabled in the BIOS. When enabled in BIOS, the user has an option at runtime to allow/disallow the cores from operating in the boost frequency range. Add an amd_pstate_global_params object to record whether CPB is enabled in BIOS, and if it has been activated by the user Reported-by: Artem S. Tashkinov" Cc: Oleksandr Natalenko Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217931 Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 59 +++++++++++++++++++++++++++++------- drivers/cpufreq/amd-pstate.h | 13 ++++++++ 2 files changed, 61 insertions(+), 11 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index fda8f86c90e0..9f42524074a9 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -102,6 +102,8 @@ static int cppc_state = AMD_PSTATE_UNDEFINED; static bool cppc_enabled; static bool amd_pstate_prefcore = true; static struct quirk_entry *quirks; +struct amd_pstate_global_params amd_pstate_global_params; +EXPORT_SYMBOL_GPL(amd_pstate_global_params); /* * AMD Energy Preference Performance (EPP) @@ -696,7 +698,7 @@ static int amd_pstate_set_boost(struct cpufreq_policy *policy, int state) if (!cpudata->boost_supported) { pr_err("Boost mode is not supported by this processor or SBIOS\n"); - return -EINVAL; + return -ENOTSUPP; } if (state) @@ -714,18 +716,38 @@ static int amd_pstate_set_boost(struct cpufreq_policy *policy, int state) return 0; } -static void amd_pstate_boost_init(struct amd_cpudata *cpudata) +static int amd_pstate_boost_set(struct amd_cpudata *cpudata) { - u32 highest_perf, nominal_perf; + u64 boost_val; + int ret = -1; - highest_perf = READ_ONCE(cpudata->highest_perf); - nominal_perf = READ_ONCE(cpudata->nominal_perf); + if (!cpu_feature_enabled(X86_FEATURE_CPB)) { + pr_debug_once("Boost CPB capabilities not present in the processor\n"); + ret = -EOPNOTSUPP; + goto exit_err; + } - if (highest_perf <= nominal_perf) - return; + ret = rdmsrl_on_cpu(cpudata->cpu, MSR_K7_HWCR, &boost_val); + if (ret) { + pr_err_once("failed to read initial CPU boost state!\n"); + ret = -EIO; + goto exit_err; + } + + amd_pstate_global_params.cpb_supported = !(boost_val & MSR_K7_HWCR_CPB_DIS); + if (amd_pstate_global_params.cpb_supported) { + current_pstate_driver->boost_enabled = true; + WRITE_ONCE(cpudata->boost_supported, true); + } - cpudata->boost_supported = true; - current_pstate_driver->boost_enabled = true; + amd_pstate_global_params.cpb_boost = amd_pstate_global_params.cpb_supported; + return 0; + +exit_err: + WRITE_ONCE(cpudata->boost_supported, false); + current_pstate_driver->boost_enabled = false; + amd_pstate_global_params.cpb_boost = false; + return ret; } static void amd_perf_ctl_reset(unsigned int cpu) @@ -1007,7 +1029,6 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) policy->driver_data = cpudata; - amd_pstate_boost_init(cpudata); if (!current_pstate_driver->adjust_perf) current_pstate_driver->adjust_perf = amd_pstate_adjust_perf; @@ -1389,6 +1410,21 @@ static bool amd_pstate_acpi_pm_profile_undefined(void) return false; } +static int amd_pstate_init_boost(struct cpufreq_policy *policy) +{ + struct amd_cpudata *cpudata = policy->driver_data; + int ret; + + /* initialize cpu cores boot state */ + ret = amd_pstate_boost_set(cpudata); + if (ret) + return ret; + + policy->boost_enabled = READ_ONCE(cpudata->boost_supported); + + return 0; +} + static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) { int min_freq, max_freq, nominal_freq, ret; @@ -1467,7 +1503,6 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) return ret; WRITE_ONCE(cpudata->cppc_cap1_cached, value); } - amd_pstate_boost_init(cpudata); return 0; @@ -1706,6 +1741,7 @@ static struct cpufreq_driver amd_pstate_driver = { .exit = amd_pstate_cpu_exit, .suspend = amd_pstate_cpu_suspend, .resume = amd_pstate_cpu_resume, + .init_boost = amd_pstate_init_boost, .set_boost = amd_pstate_set_boost, .update_limits = amd_pstate_update_limits, .name = "amd-pstate", @@ -1723,6 +1759,7 @@ static struct cpufreq_driver amd_pstate_epp_driver = { .suspend = amd_pstate_epp_suspend, .resume = amd_pstate_epp_resume, .update_limits = amd_pstate_update_limits, + .init_boost = amd_pstate_init_boost, .name = "amd-pstate-epp", .attr = amd_pstate_epp_attr, }; diff --git a/drivers/cpufreq/amd-pstate.h b/drivers/cpufreq/amd-pstate.h index e6a28e7f4dbf..0b75a6267fca 100644 --- a/drivers/cpufreq/amd-pstate.h +++ b/drivers/cpufreq/amd-pstate.h @@ -101,4 +101,17 @@ struct amd_cpudata { bool suspended; }; +/** + * struct amd_pstate_global_params - Global parameters, mostly tunable via sysfs. + * @cpb_boost: Whether or not to use boost CPU P-states. + * @cpb_supported: Whether or not CPU boost P-states are available + * based on the MSR_K7_HWCR bit[25] state + */ +struct amd_pstate_global_params { + bool cpb_boost; + bool cpb_supported; +}; + +extern struct amd_pstate_global_params amd_pstate_global_params; + #endif /* _LINUX_AMD_PSTATE_H */ From patchwork Thu Jun 13 07:25:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13696231 X-Patchwork-Delegate: mario.limonciello@amd.com Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2049.outbound.protection.outlook.com [40.107.243.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47E0B13BC25; Thu, 13 Jun 2024 07:26:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.49 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263563; cv=fail; b=cI+Wsl8i5fpro9czCdwzkLdXQEkjJGyCUced1RvTu3alCKhhszuJJbFxz7ZUq9DahgD2TyA8AWnAH2PdLOEbkTeDLp4rp9BXMNS7KTzwf3u7nZ+7pk4kyAdIuhvuH/QeJrB1cR+eal7BjwpQ5IljWVnpIhUb+9vK5BctZwAhRYk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263563; c=relaxed/simple; bh=umVTnb12KRIzSMwZQK8hmJr0bNdQgfV8qTVfrcctagM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=le5sK3iczPk/+GjiASVImaJHe7NY1TX4pRxIRph3NY4ZCoV+EXMZ7uEwz7En7ldPokt5qn+REPtWYy81PV2laZJwKGcqdKUys2UuFTSrkOI2dAbCJq8xA04pvYqxSSG7MS7lxTjHN26Q8aidP8RhtNH2V1fVuT2A943H1dW66B4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=ZxvG7OCz; arc=fail smtp.client-ip=40.107.243.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="ZxvG7OCz" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d/bwws5awGWNTI9LhsP4WDSIQCql+jbLKfZCerAx4MIIMPs4jtVfhfdNyE2HuGqLdljb33jIyOKaAp3r0ynY5Ohc6g7zXlQSfwniBHrB77dzHvEa5m9NckRExgTmAxmHM0x/RL9FHkUPIhzjIncfzRYycB5ivRXuNWOpaym4izK8Js1T47TZHDlWA3+3pWYQ6aOrEluOKkvCuLXCGdP/+5BFSIQ1lyboEiyZH0JgHNyIv+xDdSv/x2ZJ5gQED1q5DXfcMhkgDDJ2Kh6QKs/VOR7T6Dl1DMKy7VMXXj1alhxpCqkJprZCJkGNFQOsp8W/eMav76RGkhbymhADA2b5sw== 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=VErKH78LLs+udTzZEcOyfXdi75haNVhISzG/wdXsPD8=; b=Y/F2HyJ7jYumJskE/lYuH64J1kK9xFcmI8UtLH/e0M4EezD1HX0chQAEU/G9zyBD0eed2GRCu817ZjeM/au0K2mquTiSXsNxz8joIJUWSmXAntKOErA7sZvYMNpwWq69kgfSOIuHS0tdKNET5LPe93O66v2odAChbVBmQ8ZYU/nIetPkTHGxe+O6ubtvqrBP/18VAx0+clkUo6VGtmu81jE+L9LRU2uXR0j+8yRtJMGPRRUKnZnYunSCH+vI6EBNOgggAigxCbENDrUyBuw5vSqT7jdb1/r0sY+t4fcx+zYw6cjz2YgxIu+gMxmfgp3CiIotQAQvIJ+PaLK/JXNwew== 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 (0) 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=VErKH78LLs+udTzZEcOyfXdi75haNVhISzG/wdXsPD8=; b=ZxvG7OCzXl9q1f/cvKKwQD9nkINX8lm+9GJjMOyBNgPHWbZAt9IpgFyx5qyUvWfqQQFLQazF+oDErvlMw9GfcxN71BHDte7ZleMR2YIHmdFObpY0S5EAkqPoccGqEvVzlIzGKS24xqgco3eBeAN8JMV5s2lrw3NyfeI0ZIjew8Y= Received: from MN2PR07CA0012.namprd07.prod.outlook.com (2603:10b6:208:1a0::22) by CH0PR12MB8530.namprd12.prod.outlook.com (2603:10b6:610:188::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.24; Thu, 13 Jun 2024 07:25:57 +0000 Received: from MN1PEPF0000ECD8.namprd02.prod.outlook.com (2603:10b6:208:1a0:cafe::e0) by MN2PR07CA0012.outlook.office365.com (2603:10b6:208:1a0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.24 via Frontend Transport; Thu, 13 Jun 2024 07:25:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by MN1PEPF0000ECD8.mail.protection.outlook.com (10.167.242.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Thu, 13 Jun 2024 07:25:57 +0000 Received: from pyuan-Chachani-VN.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.2507.39; Thu, 13 Jun 2024 02:25:52 -0500 From: Perry Yuan To: , , CC: , , , , , , , Subject: [PATCH v11 5/9] cpufreq: amd-pstate: implement cpb_boost sysfs entry for boost control Date: Thu, 13 Jun 2024 15:25:17 +0800 Message-ID: <35464456ab468f389ff3816829647db77924a6b5.1718262992.git.perry.yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD8:EE_|CH0PR12MB8530:EE_ X-MS-Office365-Filtering-Correlation-Id: 209a348a-8595-40cf-f18e-08dc8b7a1158 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230034|36860700007|1800799018|82310400020|376008; X-Microsoft-Antispam-Message-Info: +jImwwiz6uWbT5biX/x/hPWuV8kp49JBecsDZGYQcx26X/tx0DkOZSQ6vRd4G4cqT0fu8QqV7nvfAPGSxDwDNTmX1G4Mi2hS1s8bpcLclrZOJfDoHAakcxuSnXAWVUXp8q2QSNOErLVUhqGU9Wnpesvk2X7PczxQxJlhhDZ5HhgNT9/Aj75eYdK4+WvRNALKfVLcEaAeH+l/dTNfvDjJDLq5igiFGhSqDxaz1Re7F4V0sgkrGlb5k2i+igruvmtNeFggKK8k6skUq6eQl2Tmi/RDmRAPf3WwPh0NWYFMvIkm2QWVZfTJKkCmfD7/we2U3QBPLZFL+kX4Jt3qvLfW9x2EYteFiKmX3Lwm6AvCqI7g0szxq91qgM4IVJLEn9iELKgxc6xrwfvddgmcC4KhntDqw51hiGPidxfx9MFUFh5Oek+GeICfANmVACkYWJ67nM6jBJAry62GmdkeIVSRUROAtaHbPROyE/s9xHP9IomhL18CAlfOV3RzO7U3RbZszFNUJ6l7iVXJFd4sKvCHS4kkh+5tE7kcemYxoL2MQtiz/P9nJ5/HATRnH3Wib3aS5/Ei+3cupWem7P8lxkETuC2DeoarcgydYmzLOefEaxjgjG0Semckl/op6x48bDcVm175m1Qghpt9gJ7t0x2Tl6OzwvLYdXkjT7CG3o0Cvx90v3DoHXmLDQIPzkNQxG4kg2W08BYrdN9zZobCnpqSGsjDYUTCbsSOzmJUmnPAXxeiUKZOxxOezSeUiq1yGac+ZQ1v31RQhOCRMZooeW+9e9TihfwLhxj+ZhAXsGVQJbjhd7iZE5sFMhaZ/CBhesk2StJiA1WQNLBCu7zSQRE2gz7/Joaoa0uNWJni1afaitZJU7iX/PDbQW4q2xpQwlLJ/yzvk+RiFC4v3hiIs59K/twRHXmmQPk9w0Rmax0muZE1W/QTXCzCxipsySlcVzJEbFVHDN4m8nQcqLVUacW74+/cAIgV2rOsXmWc43ioNcv8hJemgKS3czFP6zyr1A251zgHpF2wrhcJmkoQI5fSnOVuQWy5A0kSiibQDyn/j/VCWuSrIyiBSWgQn1wvLKUyRNowJNwV3b8Ufq7sxjBPUil5Z12Mv8+QbIHSxt+g7wE18z95EGrENBx95LAFBblbvCDJv2o3RohIzXgFuso/CxRAbG5xsUH3oXzksTjJwHWQNrxH24zEs0DymTQRBaMqPrdxa1bbbIC5ZAnaB0MU0tl4ggm9egWROkK/vjOi2n7XJn6sc5obdRO+iLARnpA6tdD/9E7/oHGdUP5ZoV2tNznGpTZPNmuprf33DkEa8t6aRpWfNsJGcvsx4XW++B6CXOt8/PdDRXji9Bwi92cFSTjacYbKc8KminEc1gIv2YM= 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:(13230034)(36860700007)(1800799018)(82310400020)(376008);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2024 07:25:57.0580 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 209a348a-8595-40cf-f18e-08dc8b7a1158 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: MN1PEPF0000ECD8.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB8530 From: Perry Yuan With this new sysfs entry `cpb_boost`created, user can change CPU boost state dynamically under `active`, `guided` and `passive` modes. And the highest perf and frequency will also be updated as the boost state changing. 0): check current boost state cat /sys/devices/system/cpu/amd_pstate/cpb_boost 1): disable CPU boost sudo bash -c "echo 0 > /sys/devices/system/cpu/amd_pstate/cpb_boost" 2): enable CPU boost sudo bash -c "echo 1 > /sys/devices/system/cpu/amd_pstate/cpb_boost" Link: https://bugzilla.kernel.org/show_bug.cgi?id=217931 Link: https://bugzilla.kernel.org/show_bug.cgi?id=217618 Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate-ut.c | 2 +- drivers/cpufreq/amd-pstate.c | 117 +++++++++++++++++++++++++++++++- drivers/cpufreq/amd-pstate.h | 1 + 3 files changed, 118 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/amd-pstate-ut.c b/drivers/cpufreq/amd-pstate-ut.c index fc275d41d51e..b528f198f4c3 100644 --- a/drivers/cpufreq/amd-pstate-ut.c +++ b/drivers/cpufreq/amd-pstate-ut.c @@ -227,7 +227,7 @@ static void amd_pstate_ut_check_freq(u32 index) goto skip_test; } - if (cpudata->boost_supported) { + if (amd_pstate_global_params.cpb_boost) { if ((policy->max == cpudata->max_freq) || (policy->max == cpudata->nominal_freq)) amd_pstate_ut_cases[index].result = AMD_PSTATE_UT_RESULT_PASS; diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 9f42524074a9..fe7c9d3562c5 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -104,6 +104,7 @@ static bool amd_pstate_prefcore = true; static struct quirk_entry *quirks; struct amd_pstate_global_params amd_pstate_global_params; EXPORT_SYMBOL_GPL(amd_pstate_global_params); +static int amd_pstate_cpu_boost(int cpu, bool state); /* * AMD Energy Preference Performance (EPP) @@ -738,6 +739,7 @@ static int amd_pstate_boost_set(struct amd_cpudata *cpudata) if (amd_pstate_global_params.cpb_supported) { current_pstate_driver->boost_enabled = true; WRITE_ONCE(cpudata->boost_supported, true); + WRITE_ONCE(cpudata->boost_state, true); } amd_pstate_global_params.cpb_boost = amd_pstate_global_params.cpb_supported; @@ -745,6 +747,7 @@ static int amd_pstate_boost_set(struct amd_cpudata *cpudata) exit_err: WRITE_ONCE(cpudata->boost_supported, false); + WRITE_ONCE(cpudata->boost_state, false); current_pstate_driver->boost_enabled = false; amd_pstate_global_params.cpb_boost = false; return ret; @@ -1348,6 +1351,116 @@ static ssize_t prefcore_show(struct device *dev, return sysfs_emit(buf, "%s\n", str_enabled_disabled(amd_pstate_prefcore)); } +static int amd_pstate_cpu_boost_update(struct cpufreq_policy *policy, bool on) +{ + struct amd_cpudata *cpudata = policy->driver_data; + struct cppc_perf_ctrls perf_ctrls; + u32 highest_perf, nominal_perf, nominal_freq, max_freq; + int ret; + + if (!policy) { + pr_err("policy is null\n"); + return -ENODATA; + } + + highest_perf = READ_ONCE(cpudata->highest_perf); + nominal_perf = READ_ONCE(cpudata->nominal_perf); + nominal_freq = READ_ONCE(cpudata->nominal_freq); + max_freq = READ_ONCE(cpudata->max_freq); + + if (boot_cpu_has(X86_FEATURE_CPPC)) { + u64 value = READ_ONCE(cpudata->cppc_req_cached); + + value &= ~GENMASK_ULL(7, 0); + value |= on ? highest_perf : nominal_perf; + WRITE_ONCE(cpudata->cppc_req_cached, value); + + wrmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, value); + } else { + perf_ctrls.max_perf = on ? highest_perf : nominal_perf; + ret = cppc_set_epp_perf(cpudata->cpu, &perf_ctrls, 1); + if (ret) { + cpufreq_cpu_release(policy); + pr_debug("failed to set energy perf value (%d)\n", ret); + return ret; + } + } + + if (on) + policy->cpuinfo.max_freq = max_freq; + else + policy->cpuinfo.max_freq = nominal_freq * 1000; + + policy->max = policy->cpuinfo.max_freq; + + if (cppc_state == AMD_PSTATE_PASSIVE) { + ret = freq_qos_update_request(&cpudata->req[1], policy->cpuinfo.max_freq); + if (ret < 0) + pr_debug("Failed to update freq constraint: CPU%d\n", cpudata->cpu); + } + + return ret < 0 ? ret : 0; +} + +static int amd_pstate_cpu_boost(int cpu, bool state) +{ + int ret; + struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); + struct amd_cpudata *cpudata = policy->driver_data; + + if (!policy) { + pr_err("policy is NULL\n"); + ret = -ENODATA; + goto err_exit; + } + + ret = amd_pstate_cpu_boost_update(policy, state); + refresh_frequency_limits(policy); + WRITE_ONCE(cpudata->boost_state, state); + policy->boost_enabled = state; + +err_exit: + cpufreq_cpu_put(policy); + return ret < 0 ? ret : 0; +} + +static ssize_t cpb_boost_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + return sysfs_emit(buf, "%u\n", amd_pstate_global_params.cpb_boost); +} + +static ssize_t cpb_boost_store(struct device *dev, struct device_attribute *b, + const char *buf, size_t count) +{ + bool new_state; + ssize_t ret; + int cpu; + + if (!amd_pstate_global_params.cpb_supported) { + pr_err("Boost mode is not supported by this processor or SBIOS\n"); + return -EINVAL; + } + + ret = kstrtobool(buf, &new_state); + if (ret) + return ret; + + mutex_lock(&amd_pstate_driver_lock); + for_each_present_cpu(cpu) { + ret = amd_pstate_cpu_boost(cpu, new_state); + if (ret < 0) { + pr_warn("failed to update cpu boost for CPU%d (%zd)\n", cpu, ret); + goto err_exit; + } + } + amd_pstate_global_params.cpb_boost = !!new_state; + +err_exit: + mutex_unlock(&amd_pstate_driver_lock); + return ret < 0 ? ret : count; +} + cpufreq_freq_attr_ro(amd_pstate_max_freq); cpufreq_freq_attr_ro(amd_pstate_lowest_nonlinear_freq); @@ -1358,6 +1471,7 @@ cpufreq_freq_attr_rw(energy_performance_preference); cpufreq_freq_attr_ro(energy_performance_available_preferences); static DEVICE_ATTR_RW(status); static DEVICE_ATTR_RO(prefcore); +static DEVICE_ATTR_RW(cpb_boost); static struct freq_attr *amd_pstate_attr[] = { &amd_pstate_max_freq, @@ -1382,6 +1496,7 @@ static struct freq_attr *amd_pstate_epp_attr[] = { static struct attribute *pstate_global_attributes[] = { &dev_attr_status.attr, &dev_attr_prefcore.attr, + &dev_attr_cpb_boost.attr, NULL }; @@ -1420,7 +1535,7 @@ static int amd_pstate_init_boost(struct cpufreq_policy *policy) if (ret) return ret; - policy->boost_enabled = READ_ONCE(cpudata->boost_supported); + policy->boost_enabled = READ_ONCE(cpudata->boost_state); return 0; } diff --git a/drivers/cpufreq/amd-pstate.h b/drivers/cpufreq/amd-pstate.h index 0b75a6267fca..9eba854ab7d3 100644 --- a/drivers/cpufreq/amd-pstate.h +++ b/drivers/cpufreq/amd-pstate.h @@ -99,6 +99,7 @@ struct amd_cpudata { u32 policy; u64 cppc_cap1_cached; bool suspended; + bool boost_state; }; /** From patchwork Thu Jun 13 07:25:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13696232 X-Patchwork-Delegate: mario.limonciello@amd.com Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2062.outbound.protection.outlook.com [40.107.237.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 055EF13C66A; Thu, 13 Jun 2024 07:26:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263567; cv=fail; b=W6ECJtLxhbg4/AFOS+EmJhHXdaKYCHc+jGR9Qv73OaDVoYu62Rj3quCdESB2P2ap7weXJNlY/cmnU6EMws26EIvoETMpHJwPZfYznZ/+nLhgsKUyd5xSDYAaC68D1mEwL5IatkHO5f3HL0ywjFo95bW26P/VPVnsarbo+o4lz84= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263567; c=relaxed/simple; bh=Xd7yYN6Eg/Yx+TvQiH0gNJGgpDV7LIhEVrOPkcdFcqc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=o6ATNojYuh1a7/hPa/mEpPr11GCao/o5R6TY3cat9LjZ6smYUwY5DkmxkgQ7F09O+Xu7deeEPtfdt2mqHq2ncWGhuisd8fzAvFBd4/729KzeXqPNlG6lN4fS7pSdZcn9HrpYQyZmgb+l4oFdR1JGiguAXyplXVqCvIiHin3A+V8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=hlDGVmhF; arc=fail smtp.client-ip=40.107.237.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="hlDGVmhF" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NeP83COv12bXvUoWMhJXSG694sjDzqjO3A/8/j5KnMM6WphonLMneNzqEYwBBFd2z3apJ4VJ/xpusuiP0+BiP9IMwWycOCpc5UWlG2T2x08PsWqRqYaaBOUCfWJvMhQtjbpl63UJzQi1VAKqCnJhFqqhpUZ5TNmff4uk7g0DoMCx4FpMZPatg0/Blk8PdAiaaRk4ACH/KuP1fIIxiUgtUs2atcPjHcroo0C9Pxsfjn9TgRkXvYEf1buIB3I3PqCd8VUX2DtrAek3K74QcHG5k3rSwnexyK4vDQCNB3hE8objhR1WCHLf+RWFiAgkvruxPqhptBbjeVYKM67TLx+EtA== 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=Aae0L8ILzTshpplInxDjSkfRm901kluJXUlcE39Znw4=; b=U1h7VAJv0BCa8ujO2dJBtNXl4e69biNL5JpZNwV348lKYvwjpgNaw0mjWurHkuo3U3FlML5hkerdXcnGKSIhHwSUEuxVyoVCMok9DnyFQ1lgbKhSJUDP3v0H8Ql2dc9yIwAxYSaECtECLxO76781jbY721gM1dRwRzV7ttDoUhFYq4pAWdOVqfd+A7xdH5b1VRy+kYr3X/CSrjOsUnlfv0rna9me2zQwG2K5np4AFNdP4tKSIHt90xe86xp073xg8McWNkzugxN6/T+uaTaPrKi0BDjogyDuh/PBDtOvOPd+inX+gf74WmyHTMDjaqJRUozI+89wf2CMNnZf9Uc3bA== 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 (0) 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=Aae0L8ILzTshpplInxDjSkfRm901kluJXUlcE39Znw4=; b=hlDGVmhFShnLa6EUCpR11jPUrnmXfoRHocGicIR4AO2JCR9zHvzlLAkNg9t20eB/aa3dPAfgN3yVF4UBfm4j54RbTJztQ4Iw29IiqKjazW6MFvWRjvqpc8k7eeoQQDpz3l48oYY63/HbsNXMIEcVw/wozRyh6Pl4V3Xfu+W3hv4= Received: from MN2PR13CA0002.namprd13.prod.outlook.com (2603:10b6:208:160::15) by PH7PR12MB7985.namprd12.prod.outlook.com (2603:10b6:510:27b::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.35; Thu, 13 Jun 2024 07:26:00 +0000 Received: from MN1PEPF0000ECD4.namprd02.prod.outlook.com (2603:10b6:208:160:cafe::a7) by MN2PR13CA0002.outlook.office365.com (2603:10b6:208:160::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.20 via Frontend Transport; Thu, 13 Jun 2024 07:26:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by MN1PEPF0000ECD4.mail.protection.outlook.com (10.167.242.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Thu, 13 Jun 2024 07:26:00 +0000 Received: from pyuan-Chachani-VN.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.2507.39; Thu, 13 Jun 2024 02:25:56 -0500 From: Perry Yuan To: , , CC: , , , , , , , Subject: [PATCH v11 6/9] cpufreq: amd-pstate: Add set_boost callback for active mode Date: Thu, 13 Jun 2024 15:25:18 +0800 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD4:EE_|PH7PR12MB7985:EE_ X-MS-Office365-Filtering-Correlation-Id: ad030fc1-0e6a-4e3f-a24f-08dc8b7a1312 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230034|376008|36860700007|1800799018|82310400020; X-Microsoft-Antispam-Message-Info: dtuLZ4XkK8fsSXAhqQdiSERbSvtBZtkWAxAJAyH18p59O1ovThn5rsHjlbx7PryxoPlT0z1K/XNVC/e0Lg1Y6Puv9F1+mgXWJOHVXoz7r4iIFYJSI5etOqRtnwwykW0hrOtNq0pXAOieMBXnWWybLttX4moAZNFepaXf+pTDWwK//apvMjQPyzcgmuawXq/8ILHfERQB5jlm6WQK2S/7QsW1p9aAT5RM1hXDK8ssA/l7bxdE1kjv+m4PcnCTypQSobFySAnnot3htV19Xir5NIHMxnvJ9+m+mreA3/K3i7DwOAjIJlhX5CbJicSqx/DOjG30K38DXTTgmIuQqWT0oOptzc6Q4AhXcqf68hl/L9XmhGirRgjf8jZM+i2MqCCc8hITCuu+V2XGAg4TATmrEKkO4nyQaL9rTly8i7JsjwlD1jziRnrWI+iR3BbvkZEk/m0cKjU4+Htx9xYq71WGGcwmJoGcaujWgpTdNFICEPF/7gQY/T4aOjta9836gltP6y0T1QZpSvkZX5OVSjlPDr+ww99LKfGMD0Z58nSXiuCyILmPalkkk6DHJNGex2MAcJvxbrzXNuCT8AoQ55Uyy4lpkJgNwflqnCSWXp6NTsQBVairHeoF1v8kdlx462OkZJyMgX4FIdqBC5PrAN3lCktGnGN/jKUvpNnsvGXc5O9+Fr8+n8UOoSnfipCWly4mdXxOjl1JYb2LZOP2WivKF2OdSTRK0rFYug0+/GnFg6t2lm6mwgHhRN56rGZ/Ud/O4vff5+azxhFyZUEtq1cGsTR9X+T2SQC4xkVJzGwYgKvpk7eBmRHrjMaE+1yEXc1OhYidAXGuRsYSCrRHFl6VfXyvSHoEj2zSPIRJP3KkoqNuwGQykHzPekInVNnc4RhiG2PL6Ypa4eZ2DXXsEVY5d7s5GgVVF9xmeRZM1WrJ3EARyPRVunLn7NAm4RFMqSZF5SHGDltU3G2BEf12EUzQttBYKNManM0QaWGzqVowubAZCNj3CmnfNnyn74Gfu/YYSRsecO6dSPABqlZwRqzcFoG7gJoKCapHHzr72CtB22sQCQ/q+HLehPQCjFInM4WgsN3LtaIUMh+MTcfB/YE0xkA6u3eAqFpv7pFXOoE9O7OEFYXpkpSb3ozmxk5NQc4TtOJ3tfqKZvUasxhV2ae2Kvec4L70G5opjdQLsrU7pe5jsEu+RgLVx16vSN/4NYRZOuGmWoJiYe8eaSlONUZbBWf7JAHu8w7oQplM6lCHNwF8Po0hYatDZmC4QikWJnyJ5DQ2dRHo69RBwdKLlDh9gi6OcbQQ45R/3DmcUXoA+jYOcfHN1vgUOFnuL/XvRQvYD5tElqIUe52rC17SCkDmL5gVXa12JsU4g4kV7/EKFA7f5MX8QaYJQPwfHRQafWKLKap3/+gQsI1hWfhkW52Lpw== 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:(13230034)(376008)(36860700007)(1800799018)(82310400020);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2024 07:26:00.0152 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ad030fc1-0e6a-4e3f-a24f-08dc8b7a1312 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: MN1PEPF0000ECD4.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7985 Add support for the set_boost callback in the active mode driver to enable boost control via the cpufreq core. This ensures a consistent boost control interface across all pstate modes, including passive mode, guided mode, and active mode. With this addition, all three pstate modes can support the same boost control interface with unique interface and global CPB control. Each CPU also supports individual boost control, allowing global CPB to change all cores' boost states simultaneously. Specific CPUs can update their boost states separately, ensuring all cores' boost states are synchronized. Signed-off-by: Perry Yuan --- drivers/cpufreq/amd-pstate.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index fe7c9d3562c5..d07f09dd7eab 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -701,20 +701,11 @@ static int amd_pstate_set_boost(struct cpufreq_policy *policy, int state) pr_err("Boost mode is not supported by this processor or SBIOS\n"); return -ENOTSUPP; } + mutex_lock(&amd_pstate_driver_lock); + ret = amd_pstate_cpu_boost(policy->cpu, state); + mutex_unlock(&amd_pstate_driver_lock); - if (state) - policy->cpuinfo.max_freq = cpudata->max_freq; - else - policy->cpuinfo.max_freq = cpudata->nominal_freq * 1000; - - policy->max = policy->cpuinfo.max_freq; - - ret = freq_qos_update_request(&cpudata->req[1], - policy->cpuinfo.max_freq); - if (ret < 0) - return ret; - - return 0; + return ret < 0 ? ret : 0; } static int amd_pstate_boost_set(struct amd_cpudata *cpudata) @@ -1875,6 +1866,7 @@ static struct cpufreq_driver amd_pstate_epp_driver = { .resume = amd_pstate_epp_resume, .update_limits = amd_pstate_update_limits, .init_boost = amd_pstate_init_boost, + .set_boost = amd_pstate_set_boost, .name = "amd-pstate-epp", .attr = amd_pstate_epp_attr, }; From patchwork Thu Jun 13 07:25:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13696233 X-Patchwork-Delegate: mario.limonciello@amd.com Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2070.outbound.protection.outlook.com [40.107.102.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2358C13AA3B; Thu, 13 Jun 2024 07:26:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.102.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263568; cv=fail; b=eUHqmPFx+9iPDWuzhhW9vPL13y99oPCavJJ1VG3+tH4ylprBcNaaCteIRZI/GHqTDPcgAP+9/EjUv6QEAy0QxYXKGsYBUglEnw02YpAgYcQN+H0xsFa8M1mC73EA3fGY0s+vjMDEYhp0v+Wj8Ve8YUS4R7ldhCfSVlZH4GB2I98= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263568; c=relaxed/simple; bh=mE2nn+CwCqTiTW9TXl7X26Svxj6+Zic3iSTrKZqLNog=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FJ/1Xhv3JKbcGqj7suKQ/7Xs4I8TB5FOCJSLOZCg/jzPfUNLYMV0pcbx+k0j7qRT2hjs6Y6ZEQgpD5vOgSn0f0iULOokFENzYNnFmj8YvtQvLPPguvw8yayo7iL5bfOZJol0lTNekq2GO7YJS3cKAPWM2efouKvR6/Agxuy7lBU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=yK3tmYxP; arc=fail smtp.client-ip=40.107.102.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="yK3tmYxP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VMJfqBHi2NK/OdNNDlFy/US0JToOjcS+bHit4G1dPwWIZutCpHbzOkbne9dbWCQVIlfypFYjKhLAgc8MfDLgJU153Em1n8DTo5CrrNeorGjGg1r44WBHQDNcs8gY4VBuQxLIIo3Y4n2/47oRnpxZWMnB4oQ3GgeaS7cWrheVPrCjL6VYY1WQ5lDq+TmxQYdp0sMfX3EbwkfMQQrKFrb8KXvKTSsxApAfqb97TgEEbRFKnzy8XYMY+jl11k8H4THaSpBL3dcOLG8sNkhwxqSuW6mnofiNq9YzeNLHN8+2r2ndBMlxPTyQDZD4C3qjG90NqIQP4lvhxnL9WJAir+fgwg== 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=db1QgOx0bNleruxZYc1Y6Jv84+lko8S/bOMVSMvZW9Q=; b=oNAxKJ1QbR8Y+zxj7cQUT/2zx9bIsLcubzbvqSMx/N/+iUTv5MC/ZzaZJWUAxQqRNjkrlS3rdDJ1C2/zTPz7huyQiFaYfHPd3xKuZeNDcSvjqYMHbWwM856NytAZP3hLiK/Upn3bDzrnfC/ICl+LhE+pkNSZ1Z90g6hHn+jd+dXwddlXezkdLe09XE6I1vFC0v64oVLvJfyEEArafbzvnfMkqikGCHIKauSm/hJVnvfN3wEI+u/YIDUiyBeojXR5P3C/WRPDtAudDvsePIj6YT0sr2eJuXLtExa0kdl7wAlnQp/Ml1y8+8BZmXBgfvbdTNG4Ti4f6Mb5y7aFzOZlIA== 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 (0) 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=db1QgOx0bNleruxZYc1Y6Jv84+lko8S/bOMVSMvZW9Q=; b=yK3tmYxPRgVF25KprfgINFYF8Ef7Ur7LJQcx0uIRR0UfCDha0YgDxFpIbMIm0KlLZvAOjcnqXCy+KHxKee+C6jjWWTtzPZJM2zOdRl+9He2CdgPoxISOVcNIKNWNc6YTuaWY6LZ+Ay8+n+sB5Xo3GzlHyJsWImhjYg6yC7EwAk0= Received: from MN2PR02CA0006.namprd02.prod.outlook.com (2603:10b6:208:fc::19) by SA1PR12MB7224.namprd12.prod.outlook.com (2603:10b6:806:2bb::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.37; Thu, 13 Jun 2024 07:26:03 +0000 Received: from MN1PEPF0000ECDB.namprd02.prod.outlook.com (2603:10b6:208:fc:cafe::8b) by MN2PR02CA0006.outlook.office365.com (2603:10b6:208:fc::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.24 via Frontend Transport; Thu, 13 Jun 2024 07:26:03 +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 MN1PEPF0000ECDB.mail.protection.outlook.com (10.167.242.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Thu, 13 Jun 2024 07:26:03 +0000 Received: from pyuan-Chachani-VN.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.2507.39; Thu, 13 Jun 2024 02:25:59 -0500 From: Perry Yuan To: , , CC: , , , , , , , Subject: [PATCH v11 7/9] cpufreq: amd-pstate: fix the MSR highest perf will be reset issue while cpb boost off Date: Thu, 13 Jun 2024 15:25:19 +0800 Message-ID: <6adc6408cafd36af9cd9eca063a3a061fde48fa8.1718262992.git.perry.yuan@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECDB:EE_|SA1PR12MB7224:EE_ X-MS-Office365-Filtering-Correlation-Id: ff0fe608-9bcc-4be5-dc5e-08dc8b7a14f8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230034|376008|82310400020|1800799018|36860700007; X-Microsoft-Antispam-Message-Info: zDAmk5nnwt6KaaKjZWLCnh7IEU7ZqBxRQvGK9Q7S18KVXx+MmGXdpq+0NYePpxqzXLrt9LpYOZqhxIMCRrkZdoX8yugFphIQqJ3TswCvuVTJf3BBmWaMGthiBM0+BwxTwTSwxg+7LnC5zu6PJak1f3vSYr+HbsfLrfNFhNEu082JjBdKCvAic0EMhkM/gixdcBw5njX2rbI1TjJWS8ybbj6ArsJLxyYlxojWazjbQKfNVpepy+VpBxQRJKug0LGt0fFgvPnVocKwZ+/6647D9kVKLAiPAPp0W8VDoUotp/fXsCfSaFXhwsp6pUIkmU4IfiFfZb1nSPF3jH4pKRpfPSuoQhRy0ZCms4dB/EPJ6jqED4++dhPcpJm8i0aUa/p+S3i96YKBhx6hbCwIRhMnjh5qTOtMqstPcsePClV/0Q7kEHijL8qxOJ8H6PUkF1IDfIe165ipTHFhyp+qV9Z4x+vKQB8UUtygpKhB4x6zL6P1metBlw+wBSVZm+mwGSsP+6NrGruikEvbdpBxfTmZ98zZAYZ9+jNaxbGm1kzBL5B3c2BxmwntR1yk1maAlP07Gy40xjl/OyAkOmH5hOAkd14qyiGP+5EgLSY9Ty0bfFeL4Rt8RRORhKrW33E8j5YTnPNhoFwnOWlGCGS2cbprr27s+MoBL/gHedWIpBjTTTaS460V1lqNkWzb9XWD+aQ0AWVUhybkWHv3rIIzir+RuvIi8J6vaT1jGqiQ8famYsENN+zPbFmTvXsqcLBREayMxdw2lR9U+aBOR2FpJ3qSD/47GoHjdMMSN6f7iO9a3Q405h6MymAXiWzwv1IDCWaQSYLLmBfdT7y2EO3/5pCZL9xd8E4e4W1Ed8hZOEhXmccueh/tQvFPyC0pNNXG42eqy90Qj8W0wiR41Ij/oeO9Ouqp3/Dkhja4P6MpcFGst2LfPje8vAphpE7VlheR3j47+hLhDYPokt6CUSu8wFz9S9bJtvi0rgNZDOU1F6f22AZUBuy08RdUtOtd4uvLmeqpZ4gONu054VDo5NGDPY5PXNDQ86G0wcFKwrMfNe31BpWxqVllizFPo5UZTcOq+UiR9uXTvbY7Y6iM4aBt2ybdJaQsV+AKi48BLmClyZepXlRMxl6IhxzPVCh1wzq/CvzCAkJBy0InOEqu+VZ+3+RkKSjeVd3Cr+l0c+VLNKbxQNSCldQptT5G6Nf1RPQgS89aK3BILeI1LdcxZ5cX6bHNQU3mSyjwfDPiUGQIs+kjpVrVo0fSI3S4hvoIWU/mte82i8njPqrwPhTNOKzOjxZvpJobdeo7G709k2UFTE/DYizpiofi0xBbVqJp4uoP0NMxzTuLrlFlxRLyqJo1AbOjVg+Vso3GSnoY7xRbLiqXxXkMQ0tnks4BSOmOQ+uH9Mk/ylhjATZELe0+PrAdUeU1ug== 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:(13230034)(376008)(82310400020)(1800799018)(36860700007);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2024 07:26:03.1392 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ff0fe608-9bcc-4be5-dc5e-08dc8b7a14f8 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: MN1PEPF0000ECDB.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7224 From: Perry Yuan Select the min perf to fix the highest perf value while update pstate CPPC request MSR register, here it needs to limit the max perf value when CPU boost is disabled in case of that highest perf value in the MSR will be reset to original highest perf value which cause the BOOST control failed. Signed-off-by: Perry Yuan Acked-by: Huang Rui Reviewed-by: Mario Limonciello --- drivers/cpufreq/amd-pstate.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index d07f09dd7eab..03e4cf177a5b 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -526,6 +526,7 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf, u32 des_perf, u32 max_perf, bool fast_switch, int gov_flags) { u64 prev = READ_ONCE(cpudata->cppc_req_cached); + u32 nominal_perf = READ_ONCE(cpudata->nominal_perf); u64 value = prev; min_perf = clamp_t(unsigned long, min_perf, cpudata->min_limit_perf, @@ -545,6 +546,10 @@ static void amd_pstate_update(struct amd_cpudata *cpudata, u32 min_perf, value &= ~AMD_CPPC_DES_PERF(~0L); value |= AMD_CPPC_DES_PERF(des_perf); + /* limit the max perf when core performance boost feature is disabled */ + if (!amd_pstate_global_params.cpb_boost) + max_perf = min_t(unsigned long, nominal_perf, max_perf); + value &= ~AMD_CPPC_MAX_PERF(~0L); value |= AMD_CPPC_MAX_PERF(max_perf); From patchwork Thu Jun 13 07:25:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13696234 X-Patchwork-Delegate: mario.limonciello@amd.com Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2053.outbound.protection.outlook.com [40.107.94.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DEE5E13C9AE; Thu, 13 Jun 2024 07:26:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263571; cv=fail; b=EgetVs9EY8USrDRu8VkNnDzTZG63yeHJOaBq0CDTTL8F/x9sUgG5fhgcjtUiq/IMEAPXMptZteRBPjXiSBq7OzvkUMdO1b0haseE43afyDTKNW27Jhysqs4b4vb7tUOL0Tvm4YJO4S/NgbyswtjpbDDCkFQ8nIUMu36WHNZwUPg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263571; c=relaxed/simple; bh=C4p2sKZdGRylYCgyqAJR+AyPOjBO2/pXljtXbG+zUuE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ORu84qpn6yVGyfr7C7CyC9FhHZ70UPAEKLj79/BrVekgtT9K1/FoA6YCOjjn81AD57Z8H3dy8BjkJS1+NgmeyMJNndCipMJS8Y+GEy7PHMibnmWLr7pEIchMniXozGoyilZnmVv5QCXTjcfAJGL4rO+S78aduH/IumbgST89Lns= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=l4FWJb1h; arc=fail smtp.client-ip=40.107.94.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="l4FWJb1h" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A5JudhQsbp/LguyJp65u3vhcuf66dXUU4n849Noas3+iwyec0+mNTZCdVhL8KkFytb1yY5E7/T9nENsS0ZoKVsOufxg8yhMrd3h88xuu3jdGynCoruul4BKdmmvPG7P+iZNfgmBiGp4HIC0dzYuwk44haerY8owG1vTB0fQXLQk/xCmNMuCur/dY/JvsDE62nDzEGSiTujelRra8sT3IWP+QN6YGialmQv1QjZpkvrUNC6jd9TyReZcBxOaAJ99+dEg+G/H0oAC9146H9qJ5QnycBBTinNXRNcIChDcvXoQCs22jI+5P0zWW3sQT41Hx++etQQxwmSfozyx2nKTt9w== 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=XqzLW2F6MFLyBn7JQVf8j5zr1FG2UBh8bVqCrKBuyes=; b=lrEUofuSoyDn9VPjWOp9yR9+5R7CwS+MecPvhWojHL1jsbFHhZF9NjMLz61RxYiqbKhu9jqfVCm9c81/AuLbZqul4Okq2VRbUlnWMWn1DrgzPlqjJu2UeZnWaPLLYznjcfIPHWBT7UpwnGyoCa39qv97am8vt878T15l5KBY/QSREO6GyBBTiGZ34YgjsQc7vGAm8mtXxCQJNdXVCWz/nN7j4ULMewPsBQFIA8rOj3ZY5IVrsrvzdo5m+ru135v9dVp/wzfGUgVK5GKX4N8VzPeOhEtBy+24kvjrqlmIXUDj2ffL67O1yJeIY9VmNU+F7LoEjQVcHMDIvn5EaeUc6w== 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 (0) 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=XqzLW2F6MFLyBn7JQVf8j5zr1FG2UBh8bVqCrKBuyes=; b=l4FWJb1h7mHrRN+3vjqCoUaS2Z/IG2BOQsbYG2SevIi1BetaXa5ZYqZlZmrMstC+ika35bNcRVxUndYfBybwksDVrhuL9yvmKI6YwnrICF250dzyCzxc9zz9JdsuFeyf7wJMPkKBGrgDETU2k4JD+FXjje9mXInL2U0/I3m1+4U= Received: from BL1PR13CA0085.namprd13.prod.outlook.com (2603:10b6:208:2b8::30) by CYYPR12MB8701.namprd12.prod.outlook.com (2603:10b6:930:bf::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.21; Thu, 13 Jun 2024 07:26:07 +0000 Received: from MN1PEPF0000ECD9.namprd02.prod.outlook.com (2603:10b6:208:2b8:cafe::e2) by BL1PR13CA0085.outlook.office365.com (2603:10b6:208:2b8::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.20 via Frontend Transport; Thu, 13 Jun 2024 07:26: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 MN1PEPF0000ECD9.mail.protection.outlook.com (10.167.242.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Thu, 13 Jun 2024 07:26:06 +0000 Received: from pyuan-Chachani-VN.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.2507.39; Thu, 13 Jun 2024 02:26:02 -0500 From: Perry Yuan To: , , CC: , , , , , , , Subject: [PATCH v11 8/9] Documentation: cpufreq: amd-pstate: introduce the new cpu boost control method Date: Thu, 13 Jun 2024 15:25:20 +0800 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD9:EE_|CYYPR12MB8701:EE_ X-MS-Office365-Filtering-Correlation-Id: 96e8edc4-b44f-4771-4787-08dc8b7a16ed X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230034|376008|82310400020|1800799018|36860700007; X-Microsoft-Antispam-Message-Info: RX6y4z2BTBJrTB2Sch135OXStdyMc7CQZAv/IKsnjAqyS85sc8dPNN/hUG044FGCsf/CRqyn+CWunh1N9q23Cj1TLW+ZXAQ7jAP9TCK3NL74Wr4h+F2IPWtP3kpAz14zffBQxJvOqrrewLj4/KSwp9GVuTszJaFylpDh00LnqOoTs/erH6IuX50tpwaiznfPKBI66H2MHbODlPlcvhIpDnV9Y/WPI+6kRmqeKHI6y1Szg97asRTQxRpPD5c1rtWCRLAswE8xKwZUblOvvcngMIS/MsvnR4GyqJroWDuohOsHPOnATeKFVOm7mL7cG6amY2Ml9iGBRM3ULgNhCtiIZAY2m8uEL/fJcsCJIc3+QM59Oi/B3nxECRLPYJrTh+cRHx6vHEijdcon4M7FP+qeg72jm5gMNahAe8ieHPGDhuLaI8EzxgjJ3kiG6M26QUVNeRCP3o5eJkYGxF8DskY4EtLIH0rhWHYxK/pMgPS7QXHqhE3f4vEgHBztkZpOJgO3ydnHJc/54q3uuzlkS3Q1He3QPfnBtnOKSffbU9B8JbwZiLPzyCJG2x6XcYJ44svA/D9g7neduYPk1fHMtpZFOVQoXk/bDZY20nd7Kh9L1O/f2BuOQym9wRPn9db4KX7BlU/bWITq1YUfzn8UqM8OAqHYF9bb1TszoxCVq/lcTE02tfdpO0wD1oXH7SAADve9evN/cU3sZckvppAtsYHLDWcVVSSeOZSeKagVtmBJPEIUwWWyHorW8hH8jJrL/2PWBBPZcIfx4NN+yGskTCCCipqST8Xhc64FxcJQLvmc1ewFjEZBzgBVFo1lMyG++eEbemT3A6BjRDywVkcBtfTefNcZXx4jPz6HLdmnt2C7h0HHwiANgjNaZNrtx1nqFSH1H1Pemqy6lxap8+i04mz0OloWg9qAoVulwmt+3be2edbs+zq3gfkLIo3Fcneb9gkaQxjrnI4gsW8asMumXxEFeMfuO8LGD5YLeVMm3JsIo8LEnPvEbP4i5cdvvqitIASJMtI0fuq9ulnaGmnRHI80svaYo7UqlMkcsjGT2TKl9LU1lEUuR2XWXVWi2RwxfgUlBuYPXG8HLoWd2FoocFQA2AIAZC3zpXvmcqynVG2vVZspDuBNAJFwsv4PV+FoIK31UBOGHhNihFpN+jKdXD+fvUXsphqzfmazoF9JjlTfk67vUsWaBapnVq5oG70uAe6ISPkwVT9OFcHf/TTys6cKtFH6w/J9gxSpGggKxySEO4p7D7lmrar7d/+Vj0/6PtC1qJqiYRo7gRGQ37D9imbitigYHAoKXngGTC0DKTj58LdPRI1t9O0aGS06JubDn7Ho3B85MczpySKH6v8+aMgWOO6rFyX5+Kitxa5ieUjH18PY8MBNWuYmBD9/qSEVGr4oSQyJJfxpInhmFERMuSFFpg== 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:(13230034)(376008)(82310400020)(1800799018)(36860700007);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2024 07:26:06.4187 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 96e8edc4-b44f-4771-4787-08dc8b7a16ed 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: MN1PEPF0000ECD9.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB8701 From: Perry Yuan Introduce AMD CPU frequency boosting control sysfs entry which used for switching boost on and boost off. If core performance boost is disabled while a core is in a boosted P-state, the core automatically transitions to the highest performance non-boosted P-state The highest perf and frequency will be limited by the setting value. Signed-off-by: Perry Yuan Reviewed-by: Mario Limonciello --- Documentation/admin-guide/pm/amd-pstate.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst index 1e0d101b020a..bcc0d9404c18 100644 --- a/Documentation/admin-guide/pm/amd-pstate.rst +++ b/Documentation/admin-guide/pm/amd-pstate.rst @@ -440,6 +440,16 @@ control its functionality at the system level. They are located in the This attribute is read-only to check the state of preferred core set by the kernel parameter. +``cpb_boost`` + Specifies whether core performance boost is requested to be enabled or disabled + If core performance boost is disabled while a core is in a boosted P-state, the + core automatically transitions to the highest performance non-boosted P-state. + AMD Core Performance Boost(CPB) is controlled by this attribute file which allows + user to change all cores frequency boosting state. It supports all amd-pstate modes. + + "0" Disable Core Performance Boosting + "1" Enable Core Performance Boosting + ``cpupower`` tool support for ``amd-pstate`` =============================================== From patchwork Thu Jun 13 07:25:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 13696235 X-Patchwork-Delegate: mario.limonciello@amd.com Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2041.outbound.protection.outlook.com [40.107.223.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C07E13CFA3; Thu, 13 Jun 2024 07:26:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263575; cv=fail; b=Cm12zmwKx59WHz9Re4POz0rTc57tb6yTXsI3FRpT8yZ6HhNWFwss4rWhRwcfJH4mgsZsh6K8p34Ni3HPkNXYyKNGyIMgECQzQMSWB6XVTOeTP9UX+5oI3/1NRnVxkDiV0yb0H80U6WNOTPH1BCvMXaKW/KN/GtrB+vK2gbgrOfw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263575; c=relaxed/simple; bh=591R1c5qWNY+ywR8H9LuF3YeddORv0F+tC41BSUsTms=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WpdAuaayRG04bNxZfgqQGRLOMQBg1FmxZ5TXpZeJ0d+qfgngvims8IUpW8SuVWnPJNvPmaPTMSzfH8/0+D+B2vwBS1FQ5uEvE7+eUjmeMUig8P/0DmahyOsW5R2Q8so8MvQtlBbsOxKtQ8Qt0TiCPvwXNF4lxEYkwrizA2qz5lU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=1/fdTwwp; arc=fail smtp.client-ip=40.107.223.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="1/fdTwwp" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EZNeiKe6Pr0YWHRBThmpqvzIFcyJaQT5dLyjx2/rU7F9mFpprzdFhozCpcNlFL61h422vtdzPYR4c8Wq3QlvnJcWXuxhn1V+IS6F0d71bx41kyQSbrjyat1qx4tRWAhSjSxJn79YBQXgphiwVgliAPuilXZtTzUsF9Qr5ZsTRDdFaCekHHMw1+/2rlA1r7zydqmV3RKIezAogMR6yj6bEqQGHdi/YwVqt4YpTrb+HjMs+bAOCkoeX7cQS8Sso2Mh/o0k+ne9TXONWzCZYmQpAB9tMEZu7wjEC94UP/XT+k5ABQqJHGV5CoWOufc36lg/a92Gqf7HI39msXdVMXiJuQ== 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=94xdj5VxKlsKg7KcTOXiwELEZ8njjN5NlNAXdX4qank=; b=TXbUkGt+hUjAiBstmTpVo1USp8meDi1D7iCGMFF3hfJei2NpBmtbEzeMLhZ+M9z82YbAjtH718PTm+s6krUYBVSfATzT7w3vufooQD/nFtn8kfS4S98r0N15vu4wxIpWh2EFejGH9ob6dE6mmi/4h0nglrQqqRspZ0uJau4LsheICbnyVqTCBi+w/lw1pffkVjQj2xpLoFrzg7iTd4I9KeRQk9GciyoRYC2FfyfxZssEUKT2SXUWH+ZZaOiPdoLo2cANO2jXdngaR7H2xfp6mEYfOZg2VdtO52/O/hz66aMNUY6iyf1rAQX3WxvWHmHO1l2C5ngS03NdX5x0QJlhbA== 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 (0) 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=94xdj5VxKlsKg7KcTOXiwELEZ8njjN5NlNAXdX4qank=; b=1/fdTwwpIobBInIuI1uhkGu5JgvXWrtScS4EMxdiq9zSS2PeJN0ofYblpnAzMSr2NAw9tgaZZZKLPVH8ahhShUynqtFMtPbxfXf67R6G+ZsFvvOXRmwJFUS9tROFGRePN4orlSu6JrncpyO+q3g8lL53FDn8LSAWLJLLVS/QtyQ= Received: from MN2PR01CA0030.prod.exchangelabs.com (2603:10b6:208:10c::43) by DS7PR12MB8291.namprd12.prod.outlook.com (2603:10b6:8:e6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.37; Thu, 13 Jun 2024 07:26:09 +0000 Received: from MN1PEPF0000ECDA.namprd02.prod.outlook.com (2603:10b6:208:10c:cafe::c9) by MN2PR01CA0030.outlook.office365.com (2603:10b6:208:10c::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.20 via Frontend Transport; Thu, 13 Jun 2024 07:26:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by MN1PEPF0000ECDA.mail.protection.outlook.com (10.167.242.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Thu, 13 Jun 2024 07:26:09 +0000 Received: from pyuan-Chachani-VN.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.2507.39; Thu, 13 Jun 2024 02:26:05 -0500 From: Perry Yuan To: , , CC: , , , , , , , Subject: [PATCH v11 9/9] Documentation: cpufreq: amd-pstate: update doc for Per CPU boost control method Date: Thu, 13 Jun 2024 15:25:21 +0800 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECDA:EE_|DS7PR12MB8291:EE_ X-MS-Office365-Filtering-Correlation-Id: b498a994-0267-4b10-5543-08dc8b7a18c2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230034|376008|82310400020|1800799018|36860700007; X-Microsoft-Antispam-Message-Info: rdUMl9VwhXtF+UEslQBmjXzH0iXhffCtnOa3BU31N60OFqGiZK+3SsOvY0Uf0KPw31NBCr08rF19ROw5MVgJqQcRC74zLdsWTqLsNXwSHLK02gFJ6bSsVjOebA8n84e750NxEpUs/J/Pu/328EAY99/1rNyMHloxlsjK/zPWvyKVGgxzp15G2DT02Ts5cBhKKKa9ipFy2mdRuAXOQjGNGDqwUrm/KQGSXl0xwq1PZBQjvysPcuvtAlr/xTxeVQcG95n++rt1aL626qxuMDDZCPmK/DYhLwmOp70xkkDWl1MjHOLS7fpOhrpIjOO7bAgALbVdVWl8pOHN8ElfMOIa86fTdhMkKt625b8JnoVELJK9PjUEkR+DmwLFyh02H4GssP9adg/edkq+YFjImJiweRCxPgrV3qlTtt37bLGEd4cTKW9Nv72erIYTre4mmQ9tvHad6EkoilyXfdv8MdkGLXpIDHoGQsdAE2bzAlXPM+FwIh5nGK6p7FH3n/ntG8fDnwARq85rnasmjF1VqusWqK8e9D9qNiluTaOwwR9W5Ex2pZUAByyUvPgmFUF3hMrutpkxiP+OTORhe2qza6zSjHEZWWhODcXsl0mrmYRC4WgjqFGLRJhigOqsU6Dt9CQDMst3RWaSoipRvut6VJ3PieUFAlngu3UhOi3MOZNax04ytQWPTFcRVMeHv+4MHRTy98Szz15e8D6YzQme8fdRPJn3K4h2fBufuBh92XNvD5PSNqfoKNNgifdNyvX/p4DLm/G1UhGOS30roKB50GwGsHZuLsjxsbxgWpjOgDDll0W6FZOe5q5OFP+nHvOMwDc6duDD4V/5xDrP8QN71EWVhuQnbG4QHqCUEY4O99bCTHjId+cPFqGPtOY1s2qmB4K1gMjnnmIpO4E/cLhefYxGCgblR32SpgR9BCFvyirmQt5TjhQ/aire6H2UpVS10NQP3x5aUjXui7WsGldwEam9NZW/FQR11tlwTSPwKDrKmw2wGi3r8kIkJrBdpivXgZ/8k6t2mZTBN+vJWEL3qa3T3Zl10VAdEr3K8W9QaijNxLmogePwi+XOcx6SL5Tk4txyGoR1wWH02H9J+ciuAEAx5W+PYLaSmamjE0WyvJeQuWz0Hbf/9Fc8SXvfYDUWhM1SULlHvNNi+ohsSwPZA8jjNix48DGCkDns85E8//5GL/acY0+nvNZkIxHwCvClwCdqIjJyyGZV9GrbJIUXr5ZRiOLpDnUvYsen+6SWzj/evDljSqbjmNdH+qn82Msy9i22ibIY0bxDW6qpIoElg5CyIXjmDs8mN60f9lFXTCp8e8aLLZkE/O25/ffEqSrm68qCnqrqw0GFHFVxv1c9h3y/plHCEKOQu1ryawRxf/5OOb31Ur0MAep8PtseX8eejVIttXnTCGsTAVKFsCG0/gaI8Q== 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:(13230034)(376008)(82310400020)(1800799018)(36860700007);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2024 07:26:09.4771 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b498a994-0267-4b10-5543-08dc8b7a18c2 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: MN1PEPF0000ECDA.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB8291 Updates the documentation in `amd-pstate.rst` to include information about the per CPU boost control feature. Users can now enable or disable the Core Performance Boost (CPB) feature on individual CPUs using the `boost` sysfs attribute. Signed-off-by: Perry Yuan Reviewed-by: Mario Limonciello --- Documentation/admin-guide/pm/amd-pstate.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst index bcc0d9404c18..98e43c53c387 100644 --- a/Documentation/admin-guide/pm/amd-pstate.rst +++ b/Documentation/admin-guide/pm/amd-pstate.rst @@ -281,6 +281,26 @@ integer values defined between 0 to 255 when EPP feature is enabled by platform firmware, if EPP feature is disabled, driver will ignore the written value This attribute is read-write. +``boost`` +The `boost` sysfs attribute provides control over the CPU core +performance boost, allowing users to manage the maximum frequency limitation +of the CPU. This attribute can be used to enable or disable the boost feature +on individual CPUs. + +When the boost feature is enabled, the CPU can dynamically increase its frequency +beyond the base frequency, providing enhanced performance for demanding workloads. +On the other hand, disabling the boost feature restricts the CPU to operate at the +base frequency, which may be desirable in certain scenarios to prioritize power +efficiency or manage temperature. + +To manipulate the `boost` attribute, users can write a value of `0` to disable the +boost or `1` to enable it, for the respective CPU using the sysfs path +`/sys/devices/system/cpu/cpuX/cpufreq/boost`, where `X` represents the CPU number. + +It is important to note that modifying the global variable +`amd_pstate_global_params.cpb_boost` will override the individual CPU settings. + + Other performance and frequency values can be read back from ``/sys/devices/system/cpu/cpuX/acpi_cppc/``, see :ref:`cppc_sysfs`.