From patchwork Mon Jun 17 06:59:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 805148 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2058.outbound.protection.outlook.com [40.107.236.58]) (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 13D79188CB6; Mon, 17 Jun 2024 07:00:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718607625; cv=fail; b=awd5cXo2dX2JB7XEYXzyR2+WZ1moRibxe33s7lZLilSQtojZU9dRGc9z7TiZMFjxAJVYhbjtbh6Zb7Ed73mVOyAH3M29EsyC4k87Hb29VezTsal6Fq2tHRz1qBO+YLWrQrQJhfjFotCG6UMnm48JO5myN8ypsjL4C9oOkdjpdBg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718607625; c=relaxed/simple; bh=nzTg83Tp2KVTOlE7x+0Ug5wzeWbrkQurFgj/6Vnnpfo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DfDCh73pro4mV5pN+mV/1UOiWa4ZtOAnwLlHiEb+wv7LHEToMsDvxI+P1RunvOEZ3nM8CindcZ53wiyDBnvWfxXVtKx/eJaYfHCS8R/0mPvFPA/JyxIezfZyGmCJEqu/aEd8k0u3sR0ORXAgrdWZ88q1O3XDb3vu1T2bKBMFANc= 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=HXzaaYse; arc=fail smtp.client-ip=40.107.236.58 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="HXzaaYse" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WTFHcX6xp5Wg8kB8YItUhTbYE4SEpTOIiIlGB5iYJOGF12NvwtRxtla52wTb6AR0lj3mwxQl8GW9PSEOFyKhyhXg6dYGpsj0ZZfiCBWZiuDQVw4DaMgQ3CBtiUp8KCBz+jKCo2XX6nDq1MgkN2e6Fo/BHoMLN3vGAghuK2NlZFS5fPFdmuYm2tfafmoyJwU9VDNt7Zy68VCj4yWVuGsmJcgDJbqZQT2nNqpJOMrATaEcKhbu+1tABzkhuaZEmBIyLIF9PeWG+674Rx2PNtDIbSL5H+QbPWY1f0R8qtyULZ5G/z6CmXHuQHIlXkjh78LweGVQyMwySHp49pawDbsPUA== 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=8sK5KXlwKPkdIGyjDy5laceL9Hg4OojtpPlfVYO0BjM=; b=gD2iHSbXePywNm+rE8MGHzS/713mPHXdcYDKPryqgs2WiZO+TgfYOpbiJ6SvSSiJNAfe45TBnGdN05A/GgI6o5ChvgGuuFyCfhtm0AkRWritXnTY8HHZ6kX0zpOw3z9RTO5bGcJ8TGYw5jBT9VTFiLOrB5HA3+QUBgRw3AT5nb/2diir7XEjc3iPZFRCyZ9PnLLo/oYZKqxi00pg4eA8CBv6dhvHdnvXATx1jTi+j0lD5LCU4NWomlDeOiwUcE62nSl6xSMfg3alowQiC0+JGPe0wV6kORjq4vJNdzzi3zLgVQlZ0mjV9CZ2dbHqX+FTZmjvM9k/TVWU/Y1ipK2A7w== 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=8sK5KXlwKPkdIGyjDy5laceL9Hg4OojtpPlfVYO0BjM=; b=HXzaaYseeT6fJyhUwF7yKOO9xPgN8KpGiCFicvjiHdqJ2JfAgMacioRTCQu5M2EKQ7EDYui1X1YvhxrpT/QBMnKmMcHf4b38hzRD3Hhn2hAtOyBScUzuLV5QQvD7wC3VxUpFlm+E7peb8EdoJCrns/Yqh4xUNo3JR9IXJH6HdsA= Received: from DS7PR03CA0303.namprd03.prod.outlook.com (2603:10b6:8:2b::19) by DM6PR12MB4403.namprd12.prod.outlook.com (2603:10b6:5:2ab::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Mon, 17 Jun 2024 07:00:21 +0000 Received: from DS2PEPF0000343E.namprd02.prod.outlook.com (2603:10b6:8:2b:cafe::4) by DS7PR03CA0303.outlook.office365.com (2603:10b6:8:2b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30 via Frontend Transport; Mon, 17 Jun 2024 07:00:21 +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 DS2PEPF0000343E.mail.protection.outlook.com (10.167.18.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Mon, 17 Jun 2024 07:00:21 +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; Mon, 17 Jun 2024 02:00:17 -0500 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v4 02/11] cpufreq: amd-pstate: remove unused variable nominal_freq Date: Mon, 17 Jun 2024 14:59:04 +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: DS2PEPF0000343E:EE_|DM6PR12MB4403:EE_ X-MS-Office365-Filtering-Correlation-Id: b16d65a1-f0ef-4674-eb5d-08dc8e9b277d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|36860700010|376011|82310400023|1800799021; X-Microsoft-Antispam-Message-Info: QExYB642lfv1qppoZtRgTOC5A+W/2Nledp7kDh9dzHGhSADNxHqZT2sBKOx4fm4Sxumg7tU9LkObnnuJSJMJrVJSJHUg0yYknaco7LD5+28d6U1lbK1Xp7ISnevmVDJ37GTl5gRJF0vrBCV9M27l3TrdUh/pQZkeQ5dG5hCu0VVQwSZiy+p4mh8ZTMe3ioJkmtkL//B+wo2ctRONXFWlNA6K3kP7Oji/PZsN8xYrJB9VqAVPcIm4e9OSinDOvmLW2lGmB6EraKOqLrGNw90svzP7Q98flvbwp1hvcQEgc6O0dEgsl52hyJsKXYj0rc6xYvMAfNYZqw95j4lWvPuDE0EXRBZihkJualqIUn3g8yxzJYnrMaaHEkIS6gUPKNYIbG68X+z4Nae5PSdEGwmd7ksg14oa1AtL9l7vkkKxTz/yzTqHqESkgymJtG2Ny89n7dp3KoK4Y3bTpVpDIoyc4oi2GUtM97T764rKet3ZxToE4+qFvSdDyUTtbv5YYeezplHD0fvw2blXseY36tdPk/SmaTJyO4lEaY5E/Z1YEXMJokfQiViM2Vvv+z3z54MJvj7m/gFfNe6+9KY7xeF2IamASIamuZM+YVbGyAQ+PbuB+aWjVaaRue42Nu9Z1IWZ6YqjtXxERV+Ojmd4DLvRAAtuJwapIHoXfdHI9Xp/ShZak07xzpGWpjeia4mLyVcUW7iEbEajlNTgRmygsMskCIzhvpghxV/+2X2vMX3hbwBPVF1ft7+JYqVgaxNzbCES2cwqLoP6fClagxhr7GLjGQUEw0b35HQ7msVZAa4gpCgJMH373kOZb7YK99/8fYptCwwIYEUKtflMgj3wB4mu+qjZlTUtSCzOOeCPiHadOOYzvBsq3JikG5xu0vMCLSN6GwotbNB94VFmAuglTALAAKzs5kz5b+f9mzQ2u/V+SZAUH4kdEVfe3ZnYa7jKf4N3ZWmby7hEF+IDXN89qxyBLGAgWmXs1lvkrVO3nj1qlGdZq4aAL+R5KEkp8mf5ITUZjSnDHLm2sPkVG14NHJ4J34IS9YugHp0u+d3Z/+mDvWYa17qcLDJCm9o2A4rzdaNhgFXf2Xb0eWc54mNGeQBQQvwFbbgE2cCLCdfJLXO+mkU051lSGYLhGu2JdH4RYoNN4T2mowXj+8aXh1H5C7kZvmEV5ftRQCKq38kXz3xMXF4wzVZTUN6aucw8svuPDKPAOJyGYdbvNvETUuhMkVl2ImsKae3FmbrxNQfCTPijb87i7vvMnmO72sCeOj9IRu2lhQDU7tnAp+hzR4DXYeoM8KKpJ7UKh51rr0u7UylI5PhW3OIgur9LewOEp0ZB1shy2Pl3ODr0fGeOp8+oLc7094+H2gTJB3qOG1sOl7aoXRg= 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:(13230037)(36860700010)(376011)(82310400023)(1800799021); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2024 07:00:21.2312 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b16d65a1-f0ef-4674-eb5d-08dc8e9b277d 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: DS2PEPF0000343E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4403 removed the unused variable `nominal_freq` for build warning. This variable was defined and assigned a value in the previous code, but it was not used in the subsequent code. Closes: https://lore.kernel.org/oe-kbuild-all/202405080431.BPU6Yg9s-lkp@intel.com/ Reported-by: kernel test robot Signed-off-by: Perry Yuan Reviewed-by: Gautham R. Shenoy Acked-by: Mario Limonciello --- drivers/cpufreq/amd-pstate.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index d4d7b7cdc4eb..1ce063a22214 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -947,7 +947,7 @@ static int amd_pstate_init_freq(struct amd_cpudata *cpudata) static int amd_pstate_cpu_init(struct cpufreq_policy *policy) { - int min_freq, max_freq, nominal_freq, ret; + int min_freq, max_freq, ret; struct device *dev; struct amd_cpudata *cpudata; @@ -978,7 +978,6 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) min_freq = READ_ONCE(cpudata->min_freq); max_freq = READ_ONCE(cpudata->max_freq); - nominal_freq = READ_ONCE(cpudata->nominal_freq); policy->cpuinfo.transition_latency = amd_pstate_get_transition_latency(policy->cpu); policy->transition_delay_us = amd_pstate_get_transition_delay_us(policy->cpu); @@ -1398,7 +1397,7 @@ static bool amd_pstate_acpi_pm_profile_undefined(void) static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) { - int min_freq, max_freq, nominal_freq, ret; + int min_freq, max_freq, ret; struct amd_cpudata *cpudata; struct device *dev; u64 value; @@ -1431,7 +1430,6 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) min_freq = READ_ONCE(cpudata->min_freq); max_freq = READ_ONCE(cpudata->max_freq); - nominal_freq = READ_ONCE(cpudata->nominal_freq); policy->cpuinfo.min_freq = min_freq; policy->cpuinfo.max_freq = max_freq; From patchwork Mon Jun 17 06:59:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 805147 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2079.outbound.protection.outlook.com [40.107.101.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 3B05118F2F1; Mon, 17 Jun 2024 07:00:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.101.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718607635; cv=fail; b=I/79eymizBDvYoMsOCCCahLskTU59RBY8s3NXPxf5wpvKQuiA2Zw03mR4sCGU8hv8lwpAgB7VwA1xoaH1id50c9IVMZYnIswwk/fuRgZHEXtbgltN4Sy6mtn2fw7+8jkr6xJfBv3lDxes+ZJnqMylUUCFJ0LwcnJbZlSbxHxnMo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718607635; c=relaxed/simple; bh=EctfehHDJedEbtZjxHIa4xGb6TD1KwnMHqOe1jj80cY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pU2VyzN94WFpyorhgB5Aiy1PJfC85l+2ujAAH9GbwATG/4cX5JvExIxJM6Wduyhz6z7Z1+z4fvXGwfzeq5myO2265OwisjTIgSlgE/gYjMQ9beny0MKy/ehHZdWEc/vFQQeen7tvZQnWPxS4gtgE2pJs43Nv+0iXo35IhpYzc7g= 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=TBJN2Fdp; arc=fail smtp.client-ip=40.107.101.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="TBJN2Fdp" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NrSpd7oqSpatN+/zSUyNew/K9efdDoZOsk1qm1OAukc7/NABPi0tvrmVBvjcu8xf0V412EByqrNCSZvh7kgHlDG1RaGIy9i6lcfaQ8geiPmJSKqeatYUqtgseKc4HbMts43eijZ2hF0S16xSBWMZGAh4R0F17TIiZwVeQMHUpvZuMwJrrOf0dhcUDSEToqmFJQu36kWKLMFneDjquZLvuyhoZHwCrO40+CTJFC9SrFxS4hgOwiXlew0unJnoKA7o67EMjSb5z0ut6XSsQVSMZ3wSRO7uveyy2gssZ0AYl2BDkrH3kBZuH5hvypZOip1PWuqVfGSD077OLptgGtzLqQ== 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=gDjUagZXRuibwtXVkk706LAeXHLwjoS9T2WCRChvabs=; b=AEX44KayuRJGerlkk2TWWnuyEVMMmMtS4rjBEVAwX5LvBN95GJGVhCHBiquyEbOWT12FRDpZ+XclkRBgzG+MBXPFqGHqMfKtUqn4Cx+7UoD1jsYoIECqHMqnSNGsa8sbg6RF184aOvR0fQrLc0hMHQCgFYFQVStU4lHN+1O2x0qE0cjsBF4JF7s++h18SNSs7/iECyrjJwRkV0yBNU/3mIBe3mFjlGuOhCvpJiF5HSFgt1L3XeDIqdA8ECGsVrvCeRHAmuSqtzNA6EVLufV6kjRNVAAvQTUqnferGuL+dU5JtkQ6zyeD/9mhLdBSYaaQ3VrJfNvn5sTEnDCXqC2Lvg== 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=gDjUagZXRuibwtXVkk706LAeXHLwjoS9T2WCRChvabs=; b=TBJN2FdpvbORaE0UhzMUWv64Vqdd54GS2cwUjKVQE74mbYS5w68ch0pgtJdIFMBD+zlG5cB+ht9pCgllGVTnuLXsSl0TqF78tP5M4Pk+OEVsXEyhAQ1SrUX0ZGjfMJmSACmNFqEqSafR1M02mVxIZItnqi6gpQcQBoH2D3PMGg0= Received: from DM6PR08CA0002.namprd08.prod.outlook.com (2603:10b6:5:80::15) by IA1PR12MB8309.namprd12.prod.outlook.com (2603:10b6:208:3fe::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Mon, 17 Jun 2024 07:00:28 +0000 Received: from DS2PEPF0000343F.namprd02.prod.outlook.com (2603:10b6:5:80:cafe::f) by DM6PR08CA0002.outlook.office365.com (2603:10b6:5:80::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30 via Frontend Transport; Mon, 17 Jun 2024 07:00:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS2PEPF0000343F.mail.protection.outlook.com (10.167.18.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Mon, 17 Jun 2024 07:00:28 +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; Mon, 17 Jun 2024 02:00:24 -0500 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v4 04/11] cpufreq: amd-pstate: add debug message while CPPC is supported and disabled by SBIOS Date: Mon, 17 Jun 2024 14:59:06 +0800 Message-ID: <2f5dc55e0537b089e1f4d31914c0b5c5c12792ac.1718606975.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: DS2PEPF0000343F:EE_|IA1PR12MB8309:EE_ X-MS-Office365-Filtering-Correlation-Id: 3604f03a-38d4-4639-a1ff-08dc8e9b2ba4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|36860700010|376011|82310400023|1800799021; X-Microsoft-Antispam-Message-Info: wk1vxIxHSm6S9f5QEj4lFpDv9+3S1D2gUR3FRO5dZRJCbWG4z4D54iH5U3lvlunoj6Cf59WRPYgXTG1ZYre13phX2RJNSJ2fz2S1TIOSpZWf23SivBqf3WULah2NueFVdgaMN55cNqj854+7HoVF1ICU0VvKt/se2AiC/RmFQ07wMBA3Q5FZZEZ7deB/w7UKl1cDHp5vmweTlYI+s+ff5QPbWaUqC2dgEZANygGh+1IqSe3riMTeu1dLilO6WFYdAg2UaooEhZj/Y3rFm1X911cpnhlPyiRn5A+b/EQ0NVYCw9Py5JSa9mGKVo0IUD2iYaZjpinDCA8J8gqV4wjDiWU0IHExBWlk9b9YcJWxZZu2oqNkEriV7SVcM5l6LWqZ+CdeX9wirQCbDq5+2CwnsOdnrn5astmPcVqWVE74GvcpwhXoMzQ4p/6lXYyKbJQHAApoKEHhZm+iSAwr7vxIQ0kkeOqGIPIt7WpTZm7gBb1DH0XYWGBcKJjp/skywB7csQwg+0pIwYAhR/au70TVVm4Gd5QRo9opJzwu9yNJozQkrzMOaU+6Qe1wrXkQ4VR+LMkqW4eT4mmWnTuek7Le3G1x5kpmu8Ta1UIM8OkWgoT77HHNhrsTpn6MpCu5PtpQP5nZqgVt5u9wDB8aPuYC6bmQkJX9wzdINebaG49177QlQCD/kE69vsUCizND3hINccpY4+eJkoLMLzbtNhYH6sS5cJnxtppZVMTqf+sMnqW0LctBdmVuN2znBDxqdaPp0bnVDqN/ADEajD09QHUIGyvZzB8R37FfJi67jppV9uq5nxkIXlE1Z8AkFMpn7hsKDhSLTh4svC25En+7r3TXcoGZ4ZgatXdHsn5NdKQEesEsfBZwZ8q0zVlhKvMHuYJFKk5NVAwEu4fvRha0IaSi+XEYctuVycR/ZLYCkqIZydDZKxgmTXWfBON5M9Mkgg/YmZuixIBZW8D9z2659wRbn8yRvYU6M+Lds6Y1LSM4tIdsZKP4Nz8lRnvfNZ5KXuaN1RRdB7XsqZ6yQs3KkufWWvDUoSbyqteDaOorIxuJU0TX1Ss0+HNJUGUPiYbpUCf0qCIrhpPO9vcTvDqbDC5cTK7TYXSJoSPqEiA8ld4ydwqV/I0LKmVZeuyxk4+SwQaBWXTb3MH/egboZqf+Zkm3jdbI5R6m8dzKQUepPtIRG7rSlu15YCB1o+XDDWTNKGO0ZV2dq/xn4ZRTudeBx/2E/8d7+zVESz8bI3Qc+j+ZFZ3fLznHiRRahxJvvVKUsV+lwicSBMZjQoYzNjC8MpVRlRhMOFEsnl9krIYggP8Au8BTNRmItb29ugAEhS+leag0CrAYejUZdRwZegiHm1wEFES5VS8JooqVZKzmZx1C3aE= 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:(13230037)(36860700010)(376011)(82310400023)(1800799021); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2024 07:00:28.1958 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3604f03a-38d4-4639-a1ff-08dc8e9b2ba4 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: DS2PEPF0000343F.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8309 If CPPC feature is supported by the CPU however the CPUID flag bit is not set by SBIOS, the `amd_pstate` will be failed to load while system booting. So adding one more debug message to inform user to check the SBIOS setting, The change also can help maintainers to debug why amd_pstate driver failed to be loaded at system booting if the processor support CPPC. Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218686 Signed-off-by: Perry Yuan Reviewed-by: Gautham R. Shenoy Acked-by: Mario Limonciello --- drivers/cpufreq/amd-pstate.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 76419762c04f..9aa220a0e3fe 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -1749,11 +1749,37 @@ static int __init amd_pstate_set_driver(int mode_idx) */ static bool amd_cppc_supported(void) { + struct cpuinfo_x86 *c = &cpu_data(0); + bool warn = false; + if ((boot_cpu_data.x86 == 0x17) && (boot_cpu_data.x86_model < 0x30)) { pr_debug_once("CPPC feature is not supported by the processor\n"); return false; } + /* + * If the CPPC feature is disabled in the BIOS for processors that support MSR-based CPPC, + * the AMD Pstate driver may not function correctly. + * Check the CPPC flag and display a warning message if the platform supports CPPC. + * Note: below checking code will not abort the driver registeration process because of + * the code is added for debugging purposes. + */ + if (!cpu_feature_enabled(X86_FEATURE_CPPC)) { + if (cpu_feature_enabled(X86_FEATURE_ZEN1) || cpu_feature_enabled(X86_FEATURE_ZEN2)) { + if (c->x86_model > 0x60 && c->x86_model < 0xaf) + warn = true; + } else if (cpu_feature_enabled(X86_FEATURE_ZEN3) || cpu_feature_enabled(X86_FEATURE_ZEN4)) { + if ((c->x86_model > 0x10 && c->x86_model < 0x1F) || + (c->x86_model > 0x40 && c->x86_model < 0xaf)) + warn = true; + } else if (cpu_feature_enabled(X86_FEATURE_ZEN5)) { + warn = true; + } + } + + if (warn) + pr_warn_once("The CPPC feature is supported but currently disabled by the BIOS.\n" + "Please enable it if your BIOS has the CPPC option.\n"); return true; } From patchwork Mon Jun 17 06:59:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 805146 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2058.outbound.protection.outlook.com [40.107.236.58]) (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 31F2E18FDCD; Mon, 17 Jun 2024 07:00:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718607642; cv=fail; b=AuR2Ce7/tMQLyOIukM7DSLgpeHCv+XV99W623B+xkj3U4PolhOUU6xSpzGVGV06d8s4iOsMF36iMDd9p1i32MmrsPyDP+lfJsIUVZ82D9KFfTGoE1s/J33EwaUFTHg5ISWpuVtEauP0ZuNxMY0BHK4jNKLAnZjWLwpaUiq9Cb+w= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718607642; c=relaxed/simple; bh=mt4v0XGv4Ex7oJevbf6wJNio6PTDlabbM6HbpkGLkz0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TYBSR1F549QGsTuP7wcgfCD6vXFZkMlGu5ltE7GLxN74QkzPzkrOJORWdRf+r7j127+I+a2q1+fR1NdlqgfOzF3BXapushyJFIoWGOAaPfbF9kHShMtrtdRfciOcx+HagwdIf4iZ+aMPXfIMo1JvOLARXnEXS1WU/z+9FR28eHY= 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=Vt6LIxYV; arc=fail smtp.client-ip=40.107.236.58 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="Vt6LIxYV" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F0QjZtgw0Q0TGzPD3emVEcd80cx85OxJyAY2wb8G88aGup4WaqfEqmL6M0GJlsBFRHNYJc2RkwVTJtvebdiEjFY4x/c+NORwGxt2MMJBExYVWZoWqiOJtPxIL32K7v7lajvltxrAl4lHdZsH1LuAqjybR2fwY/TViCIZwx158bbhQbAySqSC+cAAnqYPZlmT2OiaPYW9GaDFiNGdWVZXZBVjkjZZ9XdBecHGZLDmFFZoh/wtLCga9Q9aEUHjGjXGkqvhMSJGArJ2StQiJCWRcHAmYCQwQ7rteEpvJuk4dnGkwGRIGlTb5iSWOUnbZ/d+nO9HH3Uq29SzSdJAKoosrQ== 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=hy9L/qcUirO3oZnP6+bFhiSq9MAQyttMUJbSdfiRTB8=; b=fhbhpHlBO34Gc0W3/DlW3X0xgc9DAiSBGUqwwsR9L+yjYJ6H81Z583l6QgjXjeAVN8satDuVAgDOfvDhDL6Hie8Ns5MMRFILScVVR9v9HarGDqlP1hP+xi4QluDd0B2wHkKmK/0IiaqvRhML8fbMjQiZEJGTq/TH2ipNs6RyXypoUyxmu+mVaUOEv3UvnkMcop+Ev8k0h2swJMVk3QotHbDuNF4oOKbSPoAzWz49QZaR9CXjMBmoIHABWuYt0wdTq4O4U3SA85O6TzfSHb1OFf1Chb45gwqitxPY30KcgEb9hgtALe5J49Ph7NehOLrfJsH07vJNZ6Q50icsXDI9Kg== 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=hy9L/qcUirO3oZnP6+bFhiSq9MAQyttMUJbSdfiRTB8=; b=Vt6LIxYV/L+GxC6mSWOZ34skJvvSp2fYUxg9WaU7I+AToIN4i8zsQJwGCN1PiDsCzvoLdFuW98+MbRWeeaRA/d4ranrUnI0Dgi5CCzK3mGyF8QNf+15CKBdb8iwXshnQhtaFvNNq5Po9OizMI21Aiq50jC2Y/7iH0gE3ZaudkBg= Received: from CH2PR19CA0018.namprd19.prod.outlook.com (2603:10b6:610:4d::28) by PH7PR12MB8426.namprd12.prod.outlook.com (2603:10b6:510:241::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.27; Mon, 17 Jun 2024 07:00:35 +0000 Received: from DS2PEPF0000343D.namprd02.prod.outlook.com (2603:10b6:610:4d:cafe::5f) by CH2PR19CA0018.outlook.office365.com (2603:10b6:610:4d::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30 via Frontend Transport; Mon, 17 Jun 2024 07:00:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS2PEPF0000343D.mail.protection.outlook.com (10.167.18.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Mon, 17 Jun 2024 07:00:34 +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; Mon, 17 Jun 2024 02:00:31 -0500 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v4 06/11] Documentation: PM: amd-pstate: add guided mode to the Operation mode Date: Mon, 17 Jun 2024 14:59:08 +0800 Message-ID: <24cdc45b7b167387d3abba116633a5ca2a169658.1718606975.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: DS2PEPF0000343D:EE_|PH7PR12MB8426:EE_ X-MS-Office365-Filtering-Correlation-Id: 841fee8e-33d7-4d74-8dfe-08dc8e9b2f7f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|36860700010|376011|1800799021|82310400023; X-Microsoft-Antispam-Message-Info: 99eUzOyUFybRfc99j7vrQSbAJhZrYhCPAaaSDRg3ph3cc2eAkAoObjbGibPKsyqIFaRc8N1aGEgrWv6CYScjpRa+poWhJPY7HOB4SdMcLDSx3Rnr3TY4WRZuuCrLhzUYT6NdQYVi3H6GScvNd0j7bVdHkoUxK9fpKCQQXWHyd39nhR/iliG3EXpqhXHZYKwAbWsSe3TdiSbpjJHPwwuTCeo5onzEOlpspqsb9U16gas0mkm/ge3J1/WNV8EEiJvqzs1mRxsAuXPE2kCPomgH/8aJWY0HU2VmnZjFV1NcpqAXjcEBVnbkckM38zd3j5RZXRAmXJ1NrzVRyk71dc7FdMr2rs2fJsAWkRXk5Dp/VcM2DfHPqhHlrwiLRN/2ikPEQSRl+KFIGWUHqSArqgsEG/Mr6BWzgE0unhY6mM9ThQuQp2WejjGV6SUB6PErPimoG8bwBEh0pjD/Un3szQFGD9zZbYIYsE4hv+PvlieOhMPSuuAGDPDr55SJd/D3pL1g/ggTOs+sy6rrWpGPdfgcwZiwhJ8TzYWp1Nk68XrjDYDX9eNSRfoevH9uySGMbrygTaVeldGKGGjHiG1R6nUUzdTwihJt/w5ia4sbzh6FTq92qwkkl3aUUs5HWkP0+UwKnGsCilclKSDX0IhSM74L5BqK4yLd5AWF+3t3xf0RZ3YEaicPSdjnD0FOR2zuGbbl9Wr/bhtMZK0AbTPGfQO5MX4N3+ZY7bnqzkeMM3Tf6QPbuIIc3Tsywg1fw3njtJPc7aQVDu1sOH6PVNCljSrdd6bFTXOMYgNyE2JV1CiUI+TbB6qrQ3VS+AS9wrgbSfFLkNMyY4Ygb7OzvcvU8txL1t6x5lx2P2rjr7wyf/8D87h0Qa2UF9jrbA9G6o4o9ILk1nxvr9UCK0N0U4qWV7NwWzfX/wxaKTXGAVbACX0LQgqH8jr3TF6ufIziYRkz+3OQQBiLFCORcxPA1D/E+26zd75XrEVHe3c8z7vFNiRIiLRN19Y4bOKPQbpUNLEVy7duqpINDYpR+Ugm2AszgEqwi0sSyrt+WrDLA0+ashPPy5iCGBSQo1FckTrqjM67UOcBnipXhrmEIs9NX8pF5H3zbVhq2slG3Pt5gGt49475z22W0vyOdiFxrxcpmWzhT0lksUz+FRK4VHgGMoKQf4dSkcdKzg8WacH/Iwrhk4Z/UHy6Wmb+11gJHAwxqKeHicpJfmI75l07knozkt5zdfJ0xvxByT062h2HEZ44T6+CZ8dcaW4TIq3n5DFDfAdWdgMrC25PZFKXstwoyhP8bRaF1fav9LVUj6QcW+auOGPwI3Xb9sniexyHDWHVX4Zi9yJYY8i2xnHeQT2ZDup3O706nP8XDaE5VSlvuWYScJPWMxd37tOjqEVQ+3N/Fk5ekcsZgCeHHL2uNx4eifs0z6Dj1A== 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:(13230037)(36860700010)(376011)(1800799021)(82310400023); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2024 07:00:34.6950 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 841fee8e-33d7-4d74-8dfe-08dc8e9b2f7f 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: DS2PEPF0000343D.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8426 the guided mode is also supported, so the operation mode should include that mode as well. Reviewed-by: Mario Limonciello Signed-off-by: Perry Yuan Reviewed-by: Gautham R. Shenoy --- Documentation/admin-guide/pm/amd-pstate.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst index ceeb073c9ada..3e2d085a6999 100644 --- a/Documentation/admin-guide/pm/amd-pstate.rst +++ b/Documentation/admin-guide/pm/amd-pstate.rst @@ -406,7 +406,7 @@ control its functionality at the system level. They are located in the ``/sys/devices/system/cpu/amd_pstate/`` directory and affect all CPUs. ``status`` - Operation mode of the driver: "active", "passive" or "disable". + Operation mode of the driver: "active", "passive", "guided" or "disable". "active" The driver is functional and in the ``active mode`` From patchwork Mon Jun 17 06:59:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 805145 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2081.outbound.protection.outlook.com [40.107.243.81]) (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 10AF91862B5; Mon, 17 Jun 2024 07:00:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.81 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718607647; cv=fail; b=Y9YR5E2LRehYQr8hCk/MRP32cHCi0jyjwbS2mjQrd+bYlB6Ob1ag7nxxCbadw8M2AMrH8il1+1lK+cE3tQckNUr7bnPlzD3RIlVMjU3tbmxnXlDbPipGMQROstx58/sLASDfg1EwMJrpI0xK3jxcY96E+qO9vDfogSY7gSoAYSg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718607647; c=relaxed/simple; bh=Rseb8GYai4ODUDEtVJwjYIKduE9m3tmWJkJEFgZ+wfA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OinXj6IApj74i4UWwZuLpWfYiwSYjaVV0aOBew0GJkPnRBgqlU2EXwPaQDQdYJlaPYx5JYIpy8Hv/nQI62VvhWoHs7A3hGmTI6bKVttuXCLHzqFQ62zU97hgoWDAGfLhqpJfZ5DD8jDPdtDHawhEj/uh7SVSl0geEn25TTSYX2E= 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=wqRUmrUk; arc=fail smtp.client-ip=40.107.243.81 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="wqRUmrUk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ep0xfVaXASA1j7HN4jfCAtvqyxodGnEg6twwgWPR2VGYxzz4J8wE/HFijO/p6qVchBNK8q2PI9nHe1Y4I52aFZt5h7J96aSwda0znB5O6cvXDZe8wJX/Yw0W23XCP8wBBK1zvH155eX2/9hK2nsBfonUGxbEVhWP34qre8n25QeZAOZ99VIF9BlpoX8OeySFkg/B9P61t4jjNLTfoG+8yrstzjTxa6p9F7Ul+36uMm3Rb9l6zB+HMpQOWmHAkR/fPfN0B1JZc4Aetx9ERnI2wTH8MeFUVy1cZp7JeMtk1zyueL4Wx/68z0tPRcj0BztMgqh6+f1Gebuav3HKm/OefA== 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=HDGZpNJLvaiS3TV1L3UWY/2S1xGvN3MI56ottJqXuKY=; b=CNniUFuLiPsEvKNfL6SvsGXBXP1rhu17jLzytvh++teGjwWTJemgMDvO7rEjdQWXzw/yj6JlnzCZZ5hTU9Im08zAl9YvD0xy7fN9HwcLkB0TbI5SacHgwEOSojKEzIbJGALCmqwv1eDzZC/wx5Abn11z4oOOTMJ/LbxM9p9nNFkiY2i7Hbojj9eEm6xAzYDesp7yyP2dM0JzH4FP2Bcb2GYrv6alsFq+czMJrZLZv8qEFHgHbbO+1R2djio+y1XwYH8ZnaGe2zQgkpFQPrja0lHYZ0bn0PQHAngaIUv7O9Jz56OLW/a6PRUfmkMpE2lrEw77k2HTZtsopHVxEc/DQw== 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=HDGZpNJLvaiS3TV1L3UWY/2S1xGvN3MI56ottJqXuKY=; b=wqRUmrUkrI1vHQSV63oGgGGFE6AwjDPqUNLP/8cMCb15UKfZub6PwL7JEJZsODfYqnyn5hJ6DJMSZxkDups33jSErHEUlL0/mGATBaTcI7tXF5CQbli4HoSTrd625WnVfEdrlerQ2wmZViOTLwiGh3jwNda3aJ6angPilFy2gBs= Received: from DS7PR06CA0002.namprd06.prod.outlook.com (2603:10b6:8:2a::16) by DS7PR12MB5813.namprd12.prod.outlook.com (2603:10b6:8:75::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Mon, 17 Jun 2024 07:00:41 +0000 Received: from DS2PEPF0000343C.namprd02.prod.outlook.com (2603:10b6:8:2a:cafe::28) by DS7PR06CA0002.outlook.office365.com (2603:10b6:8:2a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30 via Frontend Transport; Mon, 17 Jun 2024 07:00:41 +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 DS2PEPF0000343C.mail.protection.outlook.com (10.167.18.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Mon, 17 Jun 2024 07:00:41 +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; Mon, 17 Jun 2024 02:00:37 -0500 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v4 08/11] x86/cpufeatures: Add feature bits for AMD heterogeneous processor Date: Mon, 17 Jun 2024 14:59:10 +0800 Message-ID: <4416ff72ea5a33173b69561803f1578073baccae.1718606975.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: DS2PEPF0000343C:EE_|DS7PR12MB5813:EE_ X-MS-Office365-Filtering-Correlation-Id: b4a6d22f-252d-4bc4-6737-08dc8e9b3389 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|36860700010|376011|1800799021|82310400023; X-Microsoft-Antispam-Message-Info: oCl6j6DBs2fGr+o320JkI7/BCy50t93gxRrw2PmAAsceiVffNcTRJQqDczSxds4pXJ8He1JbGGkUGWQH+P8d8V85lfdeJfjZGNZMYYd9wj9IvMvfAI1Zy7sWXd9gfK3JYZrUgRFWDOPIDMigXolKAHiAFskj4r5Pvj9k/5z/ZrCJ5OGFNp+hkEFHxj0TvcJOi7GCVnB8COtVody1zjCbye/9f6HA29QlbbudgrYFEkh/gV86nzrsX1IqJNtmCzb/X+q11lGiZYsxNHBDX78be2tBtMQ4ShJsNujC/pJv/R4Au4zBZEaP/BvgBQfoBeDQPt5PwuDR1PUcCPwzjr2gU9/XBmMji93aU4A9DIqpEoReIWcGnIWvHaKrX0B+8lFOTJ7jSMkZt9hLD13pjlj+ICilGNEX/bec+bbpDTO91HceawHkYi1Gf9XntLC6T2r2G3acs49KNZLZAs0nMZ82foYvcJNUqoaSMNYrHh16wqmN5Aka50voxS4hV8wULurA+wvT8l102/7VGS/wC2CxHfS7+CxEzX25xqPoonJBsq+CNOvrTgiU8a7tA0XObiG/BzjEBo+ExhZqSueiKlW4jhu/qwDn7Y8Xr9ZInIk3LftLsSBx7z5sE9KGs/04FENs3ttlsK3sKJKuvSjAdzq1iYpb1FqnS+lVrM3kNQcjRfgVFXxPz2NhqccY2gGI2gK8rmkj7o1Dx6bp/uQ8I8FxMWyp3RcPNmV2szS5gr+SJt32xmxrkAWW/UKB0AN/S9lNCmd6h25+YgKHHaBSvbRH7Hbu64enPOrNoEyEt76/PEjc6nid5ntrUjsa9wotThGVKwjd1d9w/S4vuRw2am1RRLMhshU1InhWU0UNHh1Ewm7s3+1HerrCbM5Bj/P97e4nSinA4q/w1a0prsJ3SwIvjfYhCjlYGca/9iBYq2f9PVE0/bdpx76Jti2DDhCIXOYokxvOzZbFmpN0kVy9eJhghMUf6JFkzt0nuFlgZKEjiJSP9GUTNc91s7SJrWt4cbS1DEPAXChxTqteEQR+kqO4aOiP4ct1rm4c2x6Nz57Qw6bWsZp//zzdW5YEQR3HS/a7XDNzN7a9z/YQhmR3UXkGb2g1lKqBvAw5jE8Eh/pJ5NePCnVp5LKWs6i9pKoWwV+33j3av9wBfNF3mqJ5FabDAgsLqsW8Mb/v0vJsKG0B3BrEKoE/zzDygSqvdjbzbrssZ2b+FHYGGx6qVMF0c4a9jDvvI5hbUtM8rGlnHWkUji/oB4pqmhXNPU8xZwJzsYtcyJZXfGRN+DYblkX1mIm0F/YEIoHF8hhuCZEZqwhPg4SIQztp96W6I3o6iEXnQiBZoTMVsCGQ53a8QSQDNr/nbutuHUxQhh0AhvNnYHdm9d/PUgbrwSgAKVbeeTC/yz3gyQANyYUYuc5ZSAMNZhonLg== 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:(13230037)(36860700010)(376011)(1800799021)(82310400023); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2024 07:00:41.4392 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b4a6d22f-252d-4bc4-6737-08dc8e9b3389 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: DS2PEPF0000343C.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5813 CPUID leaf 0x80000026 advertises core types with different efficiency rankings Bit 30 indicates the heterogeneous core topology feature, if the bit set, it means not all instances at the current hierarchical level have the same core topology. For better utilization of feature words and help to identify core type, X86_FEATURE_HETERO_CORE_TOPOLOGY is added as a few scattered feature bits. Reference: See the page 119 of PPR for AMD Family 19h Model 61h B1, docID 56713 Signed-off-by: Perry Yuan --- arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/kernel/cpu/scattered.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index 6c128d463a14..eceaa0df0137 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -471,6 +471,7 @@ #define X86_FEATURE_CLEAR_BHB_HW (21*32+ 3) /* "" BHI_DIS_S HW control enabled */ #define X86_FEATURE_CLEAR_BHB_LOOP_ON_VMEXIT (21*32+ 4) /* "" Clear branch history at vmexit using SW loop */ #define X86_FEATURE_FAST_CPPC (21*32 + 5) /* "" AMD Fast CPPC */ +#define X86_FEATURE_HETERO_CORE_TOPOLOGY (21*32+ 6) /* "" Heterogeneous Core Topology */ /* * BUG word(s) diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c index c84c30188fdf..6b3477503dd0 100644 --- a/arch/x86/kernel/cpu/scattered.c +++ b/arch/x86/kernel/cpu/scattered.c @@ -52,6 +52,7 @@ static const struct cpuid_bit cpuid_bits[] = { { X86_FEATURE_PERFMON_V2, CPUID_EAX, 0, 0x80000022, 0 }, { X86_FEATURE_AMD_LBR_V2, CPUID_EAX, 1, 0x80000022, 0 }, { X86_FEATURE_AMD_LBR_PMC_FREEZE, CPUID_EAX, 2, 0x80000022, 0 }, + { X86_FEATURE_HETERO_CORE_TOPOLOGY, CPUID_EAX, 30, 0x80000026, 0 }, { 0, 0, 0, 0, 0 } }; From patchwork Mon Jun 17 06:59:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, Perry" X-Patchwork-Id: 805144 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2087.outbound.protection.outlook.com [40.107.236.87]) (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 DCFA619049D; Mon, 17 Jun 2024 07:00:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718607653; cv=fail; b=ZF0ZwUw5lgRgDCnv0tpK65X90CaAOols+A6pq7gwwA0kvfbDIxryPYqqIG1SjLscpderfmsyNr0H6w/Eu0+4QiT0nvMWFnV41eeB8VSSZ1lsHnCU5Up2QjnZGhzbKosaxAsbOUrCvEGWElL8JkbU9Z5zcO5FIjHe5HRNAZh+jT0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718607653; c=relaxed/simple; bh=GL2efB/2PBLNHfflHusdOewRCRF3vzG/5yhNrrRDZW4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CLzPN7Rjg9rvdtENBk5U21NJPES8RBqe9zqFibCyPf2qXJACN3BkxKCybrnYgsfDuHffDQH4M+8JmFxQzyiAf9UIYUhQbiRCIozbe6Y81MYGIt96Ar95aA2vJbOOXdad+Ur46c2x3ux07YAjy0SBYexzDqZgjixl5riEW8snvAI= 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=P4XR7a/o; arc=fail smtp.client-ip=40.107.236.87 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="P4XR7a/o" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dpEAWs4hjkxXxo3ydZFWKdY/szCCUyGyUnCCgKbeHO/1+8urEozE7t5Cgc1Iwg2SgCVyp+uIrQX7B0UlicezaR2xhPWVGQiNzeZTzrV/UjQqr7JQKnYGb3cWu+X9AE+nG7D1EqQ8ZP5Dc+cfnwiQ0aEgQlOseVAfEaT1UryD7CxzUsluYp3nYiaT9WYT8FwzktedCLyr5b8Vvi3GadQBNOQL9o9exZkUieu7WIT2Y+cewOnQdYhBs3vVDHavyAkdbOJ2vd7qOuW6ejFhMUoU6ztwp3yI0Ouwm1hGWTxcFa20yMhMMPdqjn4fW1uPH+fJfll8G2Y/TYjMU5ctJq1HHA== 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=eKbAm8NYAxJq5S5T2C68cJXzedNk+bP6HiFR5mkxFkI=; b=KXyn2DjQR3jmXjr/UxhpiXh0w6R5zt1FyTeYUGUBtJeqX7i3UXzaQeDSrOnh5/Z9aKfF3Sa9tcpp9RAy8tyFijohGD23ONpI8LiYWZ5AmAs6TuSZbiIPbjESttHO71nIfyYlaIFPXx3yTR6nqrdeGhI6cqDQDHeMJc+OKEbrJYbPPSdE6wRo/91rm3ajEBYHg0LJOKY2r8uEXqhaNHFA5m9/Dbpk4TIwxhQYmrvWGm7yForl8Ey+iezQsq40Sc3veuTTb2RuM58VdtM9Gs08sO0h3EItCZkgs2el2WT/0lM+PBBWdgW/ahNKsnBlpjyLLeDDqYJTYQi5HUYRR6Eyow== 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=eKbAm8NYAxJq5S5T2C68cJXzedNk+bP6HiFR5mkxFkI=; b=P4XR7a/o0JZNODWCOC5LkfOuakZEoKMxR/9xwGnm/mv4GMwQySxuQXxtmub2j4HmCbvnhY2uHZ4BIjkKvXzn7Tri0OKMifoQZRbkSbrJWi4S528GeQ7N8SVqZcA62SBO2/xiam6tUvWWR9QSYdo8YhfA+n5AD5uJh+0rYbbAVL8= Received: from DS7PR03CA0145.namprd03.prod.outlook.com (2603:10b6:5:3b4::30) by SJ0PR12MB5676.namprd12.prod.outlook.com (2603:10b6:a03:42e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Mon, 17 Jun 2024 07:00:48 +0000 Received: from DS2PEPF00003440.namprd02.prod.outlook.com (2603:10b6:5:3b4:cafe::be) by DS7PR03CA0145.outlook.office365.com (2603:10b6:5:3b4::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.31 via Frontend Transport; Mon, 17 Jun 2024 07:00:48 +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 DS2PEPF00003440.mail.protection.outlook.com (10.167.18.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Mon, 17 Jun 2024 07:00:47 +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; Mon, 17 Jun 2024 02:00:44 -0500 From: Perry Yuan To: , , , , , CC: , , , , , Subject: [PATCH v4 10/11] cpufreq: amd-pstate: auto-load pstate driver by default Date: Mon, 17 Jun 2024 14:59:12 +0800 Message-ID: <0a4699e224e1931c09d6ede2620d585382b7d168.1718606975.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: DS2PEPF00003440:EE_|SJ0PR12MB5676:EE_ X-MS-Office365-Filtering-Correlation-Id: e7bf42f2-6f9b-4071-27a5-08dc8e9b376b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|376011|82310400023|1800799021|36860700010; X-Microsoft-Antispam-Message-Info: weIoQJ/IPF7sysBWwCPx3EtjzVBJov2FUwot+pVrv1qJhbmTz3MmbEntIVUmul1pxqW6S4gXJZOclTV0QbKKTqA8oVXLlNfdJ+MvRAdNk/Kq3nJcmfTgL3jXkZsOE9F+up4kPQ00nbgjvaiHtwMIaHwKSgI86DNoIc4tBnEKfY/4OtXZ0oY6FNdN0U36Q3ioi0v3eI9IlNYEc8b++iStyamzLkoJPT3fwV/sJVA7vvas8KfSNwTqnS1/tYD33dBjW9x381/cpdfAQhVtaU89x0gPIokn4ccePE8ShhORYF59NvPa2AGB0b7UobeE2mgVg8GfpfRawRvmYqEf1kyIa6Ye7yRIEM9dCTmlteozcBb9nd+kI+WfRfS8mIknFP8YSQD/Vg2fIX4xQhi80lg2Eniw5QbSR9UT6t8xyHOkihWn6hG6iWL9GhJNEcSXslXpXSgG5kojMktXas+vlcqS7NQswv+1Y2TrX3jzglxqIuvF9xM3xLIeflmswjqt9hA2Wlk2A64AZdB0NrQokF9mFihNXwWoWGPMrfrHoMTCwsINbA2rHe54aFD5TYKjgHIu2+zXMuYWwS8d8uKzqYKbPkUMxWekGuALvhSCOevLrhonK4uFSIWUrgUwgRMW1sPwby82i8vEURhgVPEyNEgSlqW+7efv4T1jC7j91w449d8Poqbf4Ic4HoPC4TKOWU1dTH0wHWDqduDgBeigJGKH5X5q4I+FJsigsCendBdKEo/abevPvguJxoA0JA+WnVimrfuSlybg081dZuJfHVsr2sNgOB45CBs2L8JR7pK2evvpATIbiLyJvxY1Rh//kkXQ+H6giNWPpV4Nk9ctbnTZNoQ/3FjrXSJz55ysdAjNmFtVFrMJxKUsE4XHck8JjiLOLwRJS4mzKq8aqJfSZVYC+QlvBAOwgiHdeBcqbfjYIts6ZcaaW6kucoT6X8jP6Yb1OveLAieBs73zYAEZ8yktapxR/7FJGAUPxDJ23DqZie4dzwVulZHgU0n29DruXWU8Ll7MbQOFdH8Mx+enmwV9O+pOCKYsXyHnLL68kpZQ5iaDU+P6C5snaJtFimzRPA0CWOCqp2Fo1yWt7YVaFTHT/0pbGctKN12XN7ro+HBujt6+BLbhvi8ydRuNu10XyLMNvd+JRe51xEBqRkqAyDxh/Lgyu56r5jmJov4GyZ0lZ936PEP3hPOnLOySZAKMwjX/FjO2lwYJmA90nZzbG0W5QPzkH/ACBp4Lq7BQECLkE9u5jSJyj2+BZYh9pI1w4FV/gfsS6kLzeNB2Lxsz2lE0vZbwtADK6sB2djjsU+XzdO+YHmFPvlsmThNoVyNw1b/06pYQAdal5n0UbuLY4ED6Z1T1NbrnOHB3kAgDTJjUj68= 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:(13230037)(376011)(82310400023)(1800799021)(36860700010); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2024 07:00:47.9518 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e7bf42f2-6f9b-4071-27a5-08dc8e9b376b 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: DS2PEPF00003440.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5676 If the `amd-pstate` driver is not loaded automatically by default, it is because the kernel command line parameter has not been added. To resolve this issue, it is necessary to call the `amd_pstate_set_driver()` function to enable the desired mode (passive/active/guided) before registering the driver instance. This ensures that the driver is loaded correctly without relying on the kernel command line parameter. When there is no parameter added to command line, Kernel config will provide the default mode to load. Meanwhle, user can add driver mode in command line which will override the kernel config default option. Reported-by: Andrei Amuraritei Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218705 Signed-off-by: Perry Yuan Reviewed-by: Mario Limonciello --- drivers/cpufreq/amd-pstate.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index cf68343219d1..b48fd60cbc6d 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -1857,8 +1857,13 @@ static int __init amd_pstate_init(void) /* check if this machine need CPPC quirks */ dmi_check_system(amd_pstate_quirks_table); - switch (cppc_state) { - case AMD_PSTATE_UNDEFINED: + /* + * determine the driver mode from the command line or kernel config. + * If no command line input is provided, cppc_state will be AMD_PSTATE_UNDEFINED. + * command line options will override the kernel config settings. + */ + + if (cppc_state == AMD_PSTATE_UNDEFINED) { /* Disable on the following configs by default: * 1. Undefined platforms * 2. Server platforms @@ -1870,15 +1875,20 @@ static int __init amd_pstate_init(void) pr_info("driver load is disabled, boot with specific mode to enable this\n"); return -ENODEV; } - ret = amd_pstate_set_driver(CONFIG_X86_AMD_PSTATE_DEFAULT_MODE); - if (ret) - return ret; - break; + /* get driver mode from kernel config option [1:4] */ + cppc_state = CONFIG_X86_AMD_PSTATE_DEFAULT_MODE; + } + + switch (cppc_state) { case AMD_PSTATE_DISABLE: + pr_info("driver load is disabled, boot with specific mode to enable this\n"); return -ENODEV; case AMD_PSTATE_PASSIVE: case AMD_PSTATE_ACTIVE: case AMD_PSTATE_GUIDED: + ret = amd_pstate_set_driver(cppc_state); + if (ret) + return ret; break; default: return -EINVAL; @@ -1899,7 +1909,7 @@ static int __init amd_pstate_init(void) /* enable amd pstate feature */ ret = amd_pstate_enable(true); if (ret) { - pr_err("failed to enable with return %d\n", ret); + pr_err("failed to enable driver mode(%d)\n", cppc_state); return ret; }