From patchwork Tue Aug 13 09:51:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gautham R. Shenoy" X-Patchwork-Id: 819336 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2079.outbound.protection.outlook.com [40.107.223.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 DF87B187552; Tue, 13 Aug 2024 09:52:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723542731; cv=fail; b=u3apK48cU4NhMUIcwV0BLFOqvK1SAUhIg6BKP6PhCGYYpKjfcT7WCr4GXolQgB9q5rvT0xnjEY1JwtP/UZekAaojqn0oPcoiRG7Aaqq0z4GK5mhjSoIt8Gfo4QL9iKZ6NvBpYiD1hVjfDpxayCYtQhnsmMx+Gr7w8MhWAcs+sbo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723542731; c=relaxed/simple; bh=btqYl5lJqbl4YOklscTJCikE5SMejM0qsEjoP35qk9M=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JqgR4cNuepriHKp/paOJIjFHTC57vHVWWPtGfAsOe17AdYHi/qmTgCHRmysQG+fsAUws1/c4/9Oim6xT60GrgEix2MasuhbdG3OhyABkiJ27O9f4Ui+RMa/BTc51WAXgUZsmovnNz6ZKaQebu1vzN31NSMyo4rhEru4zKB3FggI= 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=ZtyzJZVQ; arc=fail smtp.client-ip=40.107.223.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="ZtyzJZVQ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CFvhKELJ7XYOQQtG2vqtys8PRw5+55+83wNLOgb176H5bqxXoNxoorUliSPpRyITMWVy9Ek+cTFFWN81To6+nCUivY4c0GqJ8PI5YXre09Kfn+QbBHkB2wJAmZFwLEfh+D6ynbyGuMFn077+nzNHQgbI0VUHTFHavpsmOCvb5fVRMG9dFqkP3dPMN3WMDV1jwIy144O7sQvlXN215NsrqperNOF92Wttc+cZZEvCPnRysjPF/uldHRcXb2m4PY+KhsvnQOYp1KHX9yHzLbsqjm+p5brt8M7bmZzhsmIjH9bb8ZM9t3ykz1Mjw280qnGktEaoG3AX300KrJPZwqtYJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=l/3GfHKXEv+Hn/0kICdw1WRX3FRZAoUTaYRklsmLSp8=; b=YZxBG0SKkMtDnYD3vC8v1is+OJCkR9Xh+7eJ4HBbuRH/jUNrvYhjwxQDwA7G71lXSy3D//0etZytDAQ79GNyOVCqHKNXn/mCkh26vV0yqiXXDEaLjCyH1X9uncPv9Xf7jPWsZ7UAwFhwA2n1ANgx4/nL64xZQmv0qcUzCvSDTU9xUHOZfK9rIKbge8xFxkYB3Y/qQVCLACwcxe01/oS8tWgIH6aKps/xNfuSek/g5d1RKDrc9Tz+jE1mAczzJndL2+2wjnhS0nzFSnUyrAnOjM6j3XsyEgvtWGfXHwjpHO+off8WWLRbW6XT4ptyIwr6bt37MOgR038rHd8cVpMWnw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org 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=l/3GfHKXEv+Hn/0kICdw1WRX3FRZAoUTaYRklsmLSp8=; b=ZtyzJZVQEehG5uOSaVRtZtlCDR6GUQEbjqm+yGZopm5LbtzXmn0y+IxExTUU1yrQ1ZdXgiwCZ4Xh38vYH6GEVxj42p2MluubKK4PG2zNM84Ifp5qADB12yW5MUaxC2psYfzia6BWwG7bRpMnZh5Dx5KNE4SfrK7tv5tiImQq908= Received: from SJ0PR03CA0147.namprd03.prod.outlook.com (2603:10b6:a03:33c::32) by IA1PR12MB8222.namprd12.prod.outlook.com (2603:10b6:208:3f2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Tue, 13 Aug 2024 09:52:07 +0000 Received: from SJ1PEPF00002310.namprd03.prod.outlook.com (2603:10b6:a03:33c:cafe::5) by SJ0PR03CA0147.outlook.office365.com (2603:10b6:a03:33c::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.33 via Frontend Transport; Tue, 13 Aug 2024 09:52: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 SJ1PEPF00002310.mail.protection.outlook.com (10.167.242.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Tue, 13 Aug 2024 09:52:06 +0000 Received: from BLRRASHENOY1.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; Tue, 13 Aug 2024 04:52:00 -0500 From: "Gautham R. Shenoy" To: "Rafael J . Wysocki" , Viresh Kumar CC: , , "Mario Limonciello" , Huang Rui , "Perry Yuan" , Dan Carpenter , Dhananjay Ugwekar , David Wang <00107082@163.com>, "Gautham R . Shenoy" Subject: [PATCH 1/3] cpufreq: amd-pstate: Fix uninitialized variable in amd_pstate_cpu_boost_update() Date: Tue, 13 Aug 2024 15:21:13 +0530 Message-ID: <20240813095115.2078-2-gautham.shenoy@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240813095115.2078-1-gautham.shenoy@amd.com> References: <20240813095115.2078-1-gautham.shenoy@amd.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00002310:EE_|IA1PR12MB8222:EE_ X-MS-Office365-Filtering-Correlation-Id: 505c1e54-fc3a-4195-54cb-08dcbb7d975d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|376014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: 1aagu6avy+lImg9si4DB5mF61xRTlFIcTlU6r10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YoeHfSauYVM3o/PQiCw9XtlfMz0VLtOsIxZME2psOhyidJsubqSO6xkXuaPRj9LBtIAkVg35ZIMVtrSGfoETdMBPizsbJveNC3g/gUkObvcTeyKEiw2oEA0vmymrIVxs9Ts9Vf3+6HKlhll0r/LCG//GpJXcvd5vwoIY8bUUny/0XpZwREpzJvsqvz+RDMlsk8eYnzPbRxcPk+mN53GAZ+ObevRx2DL30cI5HNml1/UPzQszG/xhLUXZ11zjL1EGRc16z3U9ucg0kmKN8oaq 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:(13230040)(36860700013)(376014)(82310400026)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2024 09:52:06.2987 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 505c1e54-fc3a-4195-54cb-08dcbb7d975d 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: SJ1PEPF00002310.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8222 From: Dan Carpenter Smatch complains that "ret" could be uninitialized: drivers/cpufreq/amd-pstate.c:734 amd_pstate_cpu_boost_update() error: uninitialized symbol 'ret'. This seems like it probably is a real issue. Initialize "ret" to zero to be safe. Fixes: c8c68c38b56f ("cpufreq: amd-pstate: initialize core precision boost state") Signed-off-by: Dan Carpenter Reviewed-by: Perry Yuan Acked-by: Gautham R. Shenoy Link: https://lore.kernel.org/lkml/7ff53543-6c04-48a0-8d99-7dc010b93b3a@stanley.mountain/T/ Signed-off-by: Gautham R. Shenoy --- drivers/cpufreq/amd-pstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 68c616b572f2..358bd88cd0c5 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -692,7 +692,7 @@ 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; + int ret = 0; highest_perf = READ_ONCE(cpudata->highest_perf); nominal_perf = READ_ONCE(cpudata->nominal_perf); From patchwork Tue Aug 13 09:51:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gautham R. Shenoy" X-Patchwork-Id: 819060 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2072.outbound.protection.outlook.com [40.107.93.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 CAF9116BE01; Tue, 13 Aug 2024 09:52:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.72 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723542756; cv=fail; b=V5IN3P8pDzqnQpy8OVVxj1c/77LcryqKgtyPwPp4MXc0sKGvs/LzfZvvo3ns9yZYpPRYIbcwM3e10zNpifu1Imn5pmvPNJ0TtLGXhveDDtIUHWttBVHix8DjhU827+PSgmhz3EywaIe78Vl812/SziEqtTkrQOAuk8F7sK26Wqo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723542756; c=relaxed/simple; bh=QiBJsvud8seYfmegU1/9/NvaAjYS6H4sQIwvxqZ6ces=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cKKdJAhoG6TnatMgxRU+6QV+nD7hIRnIJAz1SOpW++70YRlLsn7mXiu8JoyZ1UyQKNlWEg21U2Q8OmxezAM298qvoNmpOgAq3ZStH9NBLJJgOcHZDZ24bkOCTBfw3Zjqn1vILRhH6zef0Jh5jxcXkSxSUq2Zkm5qXHnBdLAktcA= 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=Ymwl4LL0; arc=fail smtp.client-ip=40.107.93.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="Ymwl4LL0" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=U+ecwBnnfVSoJe+cwnZZtiXjjqyj9sg/CT14cLMf3s9lh9aB9rcMnYK2RLko6YnvWzRrW9I9x/7oNi/BMTJZRmNAKI8lywM8vAgWJzZGOJ+IL2H1om+ukcKanFOZ5HCHvN4zYX+x0ABLecdXP+vm6KL1WP+Y6h18CfOFjgITx9rD46+w37rCPuN5dr/FqBPtBDLAwHuKKlu3pLvqADKv46Me0X+k6e43D0ZSyUrEZFccxwjFOm6C8nJNEt+IBmNv+NYM4DobqVGoNC7y961Z8TP6hLi6dprpBZcNP7h0wuY5JV30PeUYnDJ6XGKX2W2+OytVc+Rd8OwjXBaeKhghwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=wpOE2YWC4Lp1idNMm7Wv2bOabW78XnWA4nPk78H65eY=; b=EF/TNqT6LRuCYJyaZKGmRI6O3pYdyDP4hxXi3EhmaKA642WG2/HECcOLmPacZoDIZTT7kc4B9fX+SoEFCqHPixH0MjLQ3kpFAFDK6QYfpEQ7BTYLlDuulNENrAlYCqo1+b+lixe2WdwWqvy/5UO5R54IzqzsnrHiMiHRYY3LuRyQF9KKc0EPfmD0ZGNT5SsqXCtEsYJjP2tIhA0YlwXEY4gnkL2V1I4BV8NNyYjJGb4FmKhlEtU27bFFTCU0XV1w/+KRlrrMBvueZbEh0xyHJqIs/TGS8xF4Ri6+oVUMsP1JBZbB7XYm5MjwtIRXCVqPjNJcnprSDYxM8HmExEwThQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org 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=wpOE2YWC4Lp1idNMm7Wv2bOabW78XnWA4nPk78H65eY=; b=Ymwl4LL0R5LFte+oCly/L52flF0iAbR5oHtGPEMzP8o5qdSAYXlAedepe0FTWwqfLlcJkIBc5oMprbVzRl7wRJbujRoEb/Mz2s8bRmwwEhszuZVUwtAsjs3J6H5ZUaXbgOlySNStrUa6xtUkyHvEp74Emn/BrGRTlZKcG37O4/g= Received: from SA1P222CA0192.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:3c4::13) by PH7PR12MB9223.namprd12.prod.outlook.com (2603:10b6:510:2f2::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.23; Tue, 13 Aug 2024 09:52:31 +0000 Received: from SA2PEPF00003AE6.namprd02.prod.outlook.com (2603:10b6:806:3c4:cafe::89) by SA1P222CA0192.outlook.office365.com (2603:10b6:806:3c4::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend Transport; Tue, 13 Aug 2024 09:52:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SA2PEPF00003AE6.mail.protection.outlook.com (10.167.248.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7849.8 via Frontend Transport; Tue, 13 Aug 2024 09:52:31 +0000 Received: from BLRRASHENOY1.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; Tue, 13 Aug 2024 04:52:27 -0500 From: "Gautham R. Shenoy" To: "Rafael J . Wysocki" , Viresh Kumar CC: , , "Mario Limonciello" , Huang Rui , "Perry Yuan" , Dan Carpenter , Dhananjay Ugwekar , David Wang <00107082@163.com>, "Gautham R . Shenoy" , Subject: [PATCH 2/3] cpufreq/amd-pstate: Use topology_logical_package_id() instead of logical_die_id() Date: Tue, 13 Aug 2024 15:21:14 +0530 Message-ID: <20240813095115.2078-3-gautham.shenoy@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240813095115.2078-1-gautham.shenoy@amd.com> References: <20240813095115.2078-1-gautham.shenoy@amd.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00003AE6:EE_|PH7PR12MB9223:EE_ X-MS-Office365-Filtering-Correlation-Id: eb78a7c7-4603-4f8e-b9e6-08dcbb7da61d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|82310400026|376014; X-Microsoft-Antispam-Message-Info: gqZC3UAG/GLV+xQg51nxOAU4OLpehtncze83fC9nnIqubH0G7EbbzpjqNFaTzTgCCLJ4/oh0pauBZqik1OUexAjtj364O3Cxvp2HNyhUimpN8eknWhjEy30ztiBhqdLBhaP9H/1n2GlXhg4GTbRfuvGBXunhj/vRQ/HWqYPdd0q7NC/WmLLB/g9sdSpbCixD79cZHbQwkp+2Mbh3SzWb4k9EKjjEoVw8RlRWH9f3iMBk+x09+Typh8NYJ9fLLYEvYJ/ge4Sj6owz75eIY9adlVjm5aDu1IbEGwEn/ncWCFV75Oz6HaTHytY9ewVn55rK3HKG4WTHL8C3BGH9E8TCTJYpAz+68KhQBdjlex5CA0YfrLWHkHnbfNv98yV4eTLXF8EerO0dckgmIr/5KC9dDt/QubdCemnI7bABhj4QdC8HnzRNvj12eRmuXMEGIIbkcsfa+GBqZ+BRLVJi0yxdRdN1pT4edk3UE6JpHKA6T4MrvFnZmOuhWQCQ7j6xtUyXH0D8aMTYLO2RphcfNoJtOkSpiwZvK9WMCoPKExYHkpZtOLHv6ZT/8YXHHwHcPdZWJN0A2DiAO0ZSsG9FGSmkjf9Fox+72szY+KSNrPg/TtM5QBTDHFAKAM+yLs+fOL965VKhKZfjxJcE1nngDy5z+5SkXgPSXCF+vLd2QEzh7+Au+59iCzm8GCB0FmX3WK/ic7OErzNiWbgSS2B+sOF/ZyN9ZU8WpvYg6HgOipo+EeQlducQ4JJbuG/8mHxEFw3TSOSq/oZ2uVNWiQf47pTqepzfWI5xryBwa4Qq9LA295Xro85tHGxz8cGK75LJZRNVZ6oqdgMPaV6jqLgJ+4JNF2jAIQo5E06WDXt48aX77hBtCRbGC6cN0SPvRcvJpdmBFn80Ta6g4SKLYxIzVNfq9qQqG/pMzR/0IjjV5WQT7aN3JRi68NSq/L893cuUf0iGGOIZgDrX8RQmOgS7C+bJXYT9VeNhgfGe9e8VLmnpc9GJA2+ahh9wnd61TokJWICPNayxrD2pu4q4o6OlH9TE8umIpctEYKpJrQhf0z97kwfiu++iq3kBQmM7n5YK3zTRMwmOrhGHEk6wagWXdR4SDn4wUwycgq18whGIYzjkgnnt+KlbzZyCDtMQs5wCqNe/DJalz311GRTlEfj2fWiHEBFGTLKbfrdREs3jPedmeAVpwPYOpP0y0vGH8VdtvAkSAQJX0KGnn+9lD5WPvkANtte58iP7u6X4L/pVOmX4J9OhoXI5GD8FF6qzSiwqjHul2rsDaN2TpOO/AwXjRKJlxsjLmdaZX96K+BK21KV86qB1a/7qsUhRtTuxYCvtuQb/ukZV2OYS0xU9AyDn9kDlbVluC4ODQjpl+zDyGe2pLW7rVnGdD0Tj+AoD9Wp+r2ADyJh5GSfDiJqb4SK2evzKZQ== 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:(13230040)(36860700013)(1800799024)(82310400026)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2024 09:52:31.1102 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eb78a7c7-4603-4f8e-b9e6-08dcbb7da61d 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: SA2PEPF00003AE6.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB9223 After the commit 63edbaa48a57 ("x86/cpu/topology: Add support for the AMD 0x80000026 leaf"), the topolgy_logical_die_id() function returns the logical Core Chiplet Die (CCD) ID instead of the logical socket ID. Since this is currently used to set MSR_AMD_CPPC_ENABLE, which needs to be set on any one of the threads of the socket, it is prudent to use topology_logical_package_id() in place of topology_logical_die_id(). Fixes: 63edbaa48a57 ("x86/cpu/topology: Add support for the AMD 0x80000026 leaf") cc: stable@vger.kernel.org # 6.10 Signed-off-by: Gautham R. Shenoy Tested-by: Dhananjay Ugwekar Link: https://lore.kernel.org/lkml/20240801124509.3650-1-Dhananjay.Ugwekar@amd.com/ Signed-off-by: Dhananjay Ugwekar --- drivers/cpufreq/amd-pstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 358bd88cd0c5..89bda7a2bb8d 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -321,7 +321,7 @@ static inline int pstate_enable(bool enable) return 0; for_each_present_cpu(cpu) { - unsigned long logical_id = topology_logical_die_id(cpu); + unsigned long logical_id = topology_logical_package_id(cpu); if (test_bit(logical_id, &logical_proc_id_mask)) continue; From patchwork Tue Aug 13 09:54:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gautham R. Shenoy" X-Patchwork-Id: 819335 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2065.outbound.protection.outlook.com [40.107.244.65]) (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 ECB3916DEAA; Tue, 13 Aug 2024 09:55:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.65 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723542940; cv=fail; b=KtdvBZaJgDY8YaMiYEHWXFbfPcA6LS2XbiFOfsFaPjTy2zi2UGihcgxgJcqs256IzShiBbg+7BjUWgfOGel/gZevOSWp97KHkH4tjt2D35MS38wVfu1FtJblNQFA0c8M9u9p0Ij3m+4jDmMf38LwxQm9Sa7mMZjfibN0J86owLc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723542940; c=relaxed/simple; bh=RRjru+KP4Zq9XJzDoL0RpSfT/fnt5p+JQ5eHEXqNUkk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jJm79hq5y83+uuJHRGB6UKJKtY0md5Wa/yuatNWcv1s3CxpS7xhjhvr+lOJN4e7+Vl0Xbb9MRryTBI0I+KkRosLQifSZBUZ2q5AMMCDoXjg7/H2S+lCODShUengAVOu7gCoMLxsPpE9CwxJ9E3it7LLgzPduwY0viqNYHKH39vk= 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=HsofGCG1; arc=fail smtp.client-ip=40.107.244.65 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="HsofGCG1" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ka02kog49Xw2/B0rWePMMhG4FOOMbAIMuwMql75w/Rffi7h5sltggyeB/69mlVOR4pWSenR2pD1Xi3inBisBhGEsAlycuUASMP+mlDQIQZxnnkFmP7/EG4xnVxpIKjDwb2bVx+u3nPGNNHQA176+MSOjrQeImEOrxALUZ+AE+KudiyjkzPTrNFpBW4PSgBmD+qmcp0Cs+sRBVmNRbUG6b7mMElU9ZY/Pk87EGPxa8FBYSAhwEjCtpNnewScLD5U3KTtt5OWaXuB1n6aEBx9F3VmmuFByN8n5pnU7aSGmEWJp3G5mXyqJTRbGjS/uG/L3CDgL1B7ahrbO3nvqgNJahQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=qhZwVD3hKwQ5Z0IB/kRLMzCGJ7bXOzagxFjV/8oy7HQ=; b=SgwGEVp/m/ZB7cKhAc185Ppo1qxQOq9RAmz4BZOKLGDmYS9v/sa6XE2bwKvVs9nzroxXmC30SD2iU45v5z4Y4sOnyt3Ezhf6RhA9zRJqrI5nanPTEfU35BZtmkrypdmxedFr764PYkttPwdurpvFUEdcI/9irSkonbEz00gwdID1Rx/XG21eiUFyEnW8bLTjMGyuDL44oylTO4R/abbcHASL17nKk/lkUkgc66bCLn01BLOA+GHXKRetyJDd8axKWMyW0zYUlg2v9lxIp1oGveym/4CYNewd3q4JyyU3bUslMBPwu9zimmfqfASVBRh9mV/tpK+O5sGwJcDGbLfoOQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org 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=qhZwVD3hKwQ5Z0IB/kRLMzCGJ7bXOzagxFjV/8oy7HQ=; b=HsofGCG17G+8bjcIqvwdQChd1iCyWVl8GQPvuwlms6HKrY/N4WHwhI5puAEMh+G5Po6mntQ1+l6dVGjijIEhCTYRbJGzzSmE4qH6/Oew9qsZ1LDuRwbNOVJpkdbAVaTPonSNQsAS/126m591Hdm+csh8+3D1H8jsYpOUkcxx4Zk= Received: from SA1P222CA0021.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:22c::28) by SJ1PR12MB6170.namprd12.prod.outlook.com (2603:10b6:a03:45b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Tue, 13 Aug 2024 09:55:36 +0000 Received: from SA2PEPF00003AEA.namprd02.prod.outlook.com (2603:10b6:806:22c:cafe::d7) by SA1P222CA0021.outlook.office365.com (2603:10b6:806:22c::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend Transport; Tue, 13 Aug 2024 09:55:36 +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 SA2PEPF00003AEA.mail.protection.outlook.com (10.167.248.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7849.8 via Frontend Transport; Tue, 13 Aug 2024 09:55:35 +0000 Received: from BLRRASHENOY1.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; Tue, 13 Aug 2024 04:55:32 -0500 From: "Gautham R. Shenoy" To: "Rafael J . Wysocki" , Viresh Kumar CC: , , "Mario Limonciello" , Huang Rui , "Perry Yuan" , Dan Carpenter , Dhananjay Ugwekar , David Wang <00107082@163.com>, "Gautham R . Shenoy" Subject: [PATCH 3/3] cpufreq/amd-pstate: Remove warning for X86_FEATURE_CPPC on Zen1 and Zen2 Date: Tue, 13 Aug 2024 15:24:59 +0530 Message-ID: <20240813095459.2122-1-gautham.shenoy@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240813095115.2078-3-gautham.shenoy@amd.com> References: <20240813095115.2078-3-gautham.shenoy@amd.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00003AEA:EE_|SJ1PR12MB6170:EE_ X-MS-Office365-Filtering-Correlation-Id: c799e75e-35d5-4a39-0732-08dcbb7e1442 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|82310400026|376014; X-Microsoft-Antispam-Message-Info: GnNkyeMNvUoZ5AdN9cRVDxLuCOLr9vHC2rMrGrooju01VgElH/SqreszXcVmAC12/3u0NCXlM5zBlSRGS64H/wiet67EgUjUPpOmO9DAqal+CIlq0mQWF+I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T5APEC+TMgNND03hxfwsXfliQj0ibhxqCPk5KmnlQG5AZg7oKLlPFXtl/ttuxxGMb+6TCzROlFEtEDIGby+VO+quWWOT5dStRn4ZdBzZ0qK7Kos7rtFWtyuZApoq5Nsg7GPiBPs6XyZt/vdGJGPlFLKKRlFbPRrjmIJHwg5OKlFVT06whfP+LCtO85SjcOxA5SxRhnAa51AZQuk34PwxBAHPrmvBA== 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:(13230040)(36860700013)(1800799024)(82310400026)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2024 09:55:35.8975 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c799e75e-35d5-4a39-0732-08dcbb7e1442 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: SA2PEPF00003AEA.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6170 commit bff7d13c190a ("cpufreq: amd-pstate: add debug message while CPPC is supported and disabled by SBIOS") issues a warning on plaforms where the X86_FEATURE_CPPC is expected to be enabled, but is not due to it being disabled in the BIOS. This feature bit corresponds to CPUID 0x80000008.ebx[27] which is a reserved bit on the Zen1 and Zen2 platforms, and is expected to be cleared on these platforms. Thus printing the warning message for Zen1 and Zen2 models when X86_FEATURE_CPPC is incorrect. Fix this. Fixes: bff7d13c190a ("cpufreq: amd-pstate: add debug message while CPPC is supported and disabled by SBIOS") Reported-by: David Wang <00107082@163.com> Closes: https://lore.kernel.org/lkml/20240730140111.4491-1-00107082@163.com/ Signed-off-by: Gautham R. Shenoy --- 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 89bda7a2bb8d..66002718397c 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -1841,10 +1841,8 @@ static bool amd_cppc_supported(void) * 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 (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;