From patchwork Wed Dec 4 14:48:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dhananjay Ugwekar X-Patchwork-Id: 847515 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2071.outbound.protection.outlook.com [40.107.94.71]) (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 E4FA820ADE8; Wed, 4 Dec 2024 14:50:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.71 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733323852; cv=fail; b=jMM//FH9bfTFY4UBqhlTr+9o988u6GgvUVVH9m/gQ+41NVqT0lxfjgL9UoT9tTRC2fXmAkFR6B4zL+3lrhc4jIO5d8q0ErnozO9kfwWXDJTOlcB/KfkocY2jf0ySeC84opg+n4KmjOLqEZIZ2KLcj0SJU21MXY6mwTMESO3Mvfc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733323852; c=relaxed/simple; bh=lM8g9IonuBVsR3yiRFWJFDhtKkqh53YREPOzPgTKlj0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=U52pTGd9UbHKh0q9UpeCgcdnq0lssCRN2Mr4MFPHZUcI/7VsPCGSAUb0ljnc1ExruKzwn69oxAEtd7+H6vIeIrs/JXDTAlSDv7WhyxeWjCCzQ06aRZv+LBr+d0Mu8Q7+DFyaFxzxfNzb+v3k/bFJJtflExklL4ogxD3sHacTD9Q= 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=ca0Cy6xe; arc=fail smtp.client-ip=40.107.94.71 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="ca0Cy6xe" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aNwGtuo+1MzUowcchsbyAzSrH/qLzPS1BAIw2NYfZS4c5s4mdM9YRRRRqE/aDjn+ENh0AdCHciQnhP+y5jivifdczs5YgKrTriXBCZUIXklF67YaDdPAhGuCdEPksj2RIq11Osd8adxmo74zzEJDXs4KCuZ/hvOyubWINUMuPf3QRs6y14cEYPDTmVFRiwas+l/gTfAt2k40K5FEAS6aLk4qnS3GykmwpIZTeWqCXlBThtw+847hpKp6XvDIBeP3gg6xGFYDzKQ8WAm2nQF1NkIEUqTsAOeAnX3VubSlJDJEgABYm6caDFF1yJy5x6XhsjKdtDb+ZKBtq+PUGkIAUw== 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=Sg8wdDAQS4KVcKon6AeajUBsitYeJKKNANIlCeGVL/Y=; b=UjhrG6+MqmJGW4uNgvS6Gsh852LPUbFO4WD35d14r45vNbeNk393S7H+e1aFaW/VE2diUL1mLeKZMOW7p8TVWwnIzwLxhs1v2NhxaRJoOxn199k8i2Hsnhcr85B0d3YywOg4zigJ2lH3nYwKyTiS58rTIGOZQ3G88jtFNRBSBs2FT4o73AEva32nSwipC4gVBeBkoAd+hGFinVD0tGqbDObIQfyNejQfhN6DdVeo1Ma0nEEhIykLPt2voVLb2OD2oGmueIztLSdIZlbyXNUO1mj4itmLpujMTxVRRfuCzLDYP3Ri+BvbOeQoTuz3mW9wOQBOwuesqzR6CHX9MwhrbA== 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=Sg8wdDAQS4KVcKon6AeajUBsitYeJKKNANIlCeGVL/Y=; b=ca0Cy6xe3Cyp5IMlAyokIY+L7mdOx4ADkCfQAwBeSjqCZHhQUypnLKPrPX/JquiPiS9ayJBnjAcbOZoyRrMqKhBJTqQX827Fvpb79F5LC4hpRjE6mshsjkSDeSFpk02gKH+GNip40ojliE3oOGwOhH1QqMi5LWMsKWmrVEf7NPs= Received: from SA1P222CA0153.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:3c3::17) by PH7PR12MB5758.namprd12.prod.outlook.com (2603:10b6:510:1d1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.11; Wed, 4 Dec 2024 14:50:43 +0000 Received: from SN1PEPF000252A4.namprd05.prod.outlook.com (2603:10b6:806:3c3:cafe::7b) by SA1P222CA0153.outlook.office365.com (2603:10b6:806:3c3::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8207.19 via Frontend Transport; Wed, 4 Dec 2024 14:50:43 +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 SN1PEPF000252A4.mail.protection.outlook.com (10.167.242.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8230.7 via Frontend Transport; Wed, 4 Dec 2024 14:50:43 +0000 Received: from shatadru.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; Wed, 4 Dec 2024 08:50:40 -0600 From: Dhananjay Ugwekar To: , , , , CC: , , "Dhananjay Ugwekar" Subject: [PATCH 5/5] cpufreq/amd-pstate: Merge amd_pstate_epp_cpu_offline() and amd_pstate_epp_offline() Date: Wed, 4 Dec 2024 14:48:42 +0000 Message-ID: <20241204144842.164178-6-Dhananjay.Ugwekar@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241204144842.164178-1-Dhananjay.Ugwekar@amd.com> References: <20241204144842.164178-1-Dhananjay.Ugwekar@amd.com> 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: SN1PEPF000252A4:EE_|PH7PR12MB5758:EE_ X-MS-Office365-Filtering-Correlation-Id: f423e94a-0399-41fa-d6d4-08dd14730790 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: Rmsyy1ZSTbi4uy3t4Ir7DKdjT4UuXgePPsmACrtjAyS5HLltooZiyvLNRPJsUzV77kvjpEDbahn2nUbcNw5M4VuCnQ2pmM5yZjlWLy6z5JxEiUtbxF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M5NHFo7CGtAbr/4Z1uJFmAK4pMdk36mglg5IpIAMigr6r8VksXz338GcEg5RGkM3glgP6IIN9olIXaL8fk2cqehSZnpdegqFZPHRGunHFrVUFFuMfYwycx+nwF92X3YTT/ZpE0KlyyIqlY+SzNh4uJ02ubTwQ2sjwlY8Ts4zQy5LzXpwR6JFMBS7ZG+BY1MUJozlkNJBONCcX4334wiXj9aEZrvXaI+XT4NS1TxQ4TuyK4oKx6kVD+jxsOqiOg9QpR8tF8po 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)(376014)(1800799024)(82310400026)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2024 14:50:43.6424 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f423e94a-0399-41fa-d6d4-08dd14730790 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: SN1PEPF000252A4.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5758 amd_pstate_epp_offline() is only called from within amd_pstate_epp_cpu_offline() and doesn't make much sense to have it at all. Hence, remove it. Also remove the unncessary debug print in the offline path while at it. Signed-off-by: Dhananjay Ugwekar Reviewed-by: Gautham R. Shenoy --- drivers/cpufreq/amd-pstate.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 08a10ef7aa5b..298065912976 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -1655,12 +1655,15 @@ static int amd_pstate_epp_cpu_online(struct cpufreq_policy *policy) return 0; } -static void amd_pstate_epp_offline(struct cpufreq_policy *policy) +static int amd_pstate_epp_cpu_offline(struct cpufreq_policy *policy) { struct amd_cpudata *cpudata = policy->driver_data; int min_perf; u64 value; + if (cpudata->suspended) + return 0; + min_perf = READ_ONCE(cpudata->lowest_perf); value = READ_ONCE(cpudata->cppc_req_cached); @@ -1670,18 +1673,6 @@ static void amd_pstate_epp_offline(struct cpufreq_policy *policy) amd_pstate_set_epp(cpudata, AMD_CPPC_EPP_BALANCE_POWERSAVE); mutex_unlock(&amd_pstate_limits_lock); -} - -static int amd_pstate_epp_cpu_offline(struct cpufreq_policy *policy) -{ - struct amd_cpudata *cpudata = policy->driver_data; - - pr_debug("AMD CPU Core %d going offline\n", cpudata->cpu); - - if (cpudata->suspended) - return 0; - - amd_pstate_epp_offline(policy); return 0; }