Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2846314lqp; Mon, 25 Mar 2024 10:51:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUjUhkTSx80de1h271I1k40dsDngj+qhsHkDdxx3XgnmHqftw4MYHGKuhd+lh9aLpAK2RKwqhMCsFBZN2Jsops3AX/WwYC0BN+9dcRVHA== X-Google-Smtp-Source: AGHT+IFxX0GwdKeq+ssA4oCxenaOMMLlJJPZ8kB3MtHdZhu/PrBllQKYCp21aFu+dg3E79fiUL6a X-Received: by 2002:a67:ed04:0:b0:476:8cda:8e6a with SMTP id l4-20020a67ed04000000b004768cda8e6amr5987656vsp.22.1711389087819; Mon, 25 Mar 2024 10:51:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711389087; cv=pass; d=google.com; s=arc-20160816; b=1AK/VSZsOd5rsYN4d2KJG+TRvlLlvpdvt6uOL26evqw9/X5kU/VJq80fwFn4SgEYVS KPDS8voYSt34mn+SZ8g7QpQDGtyV2zr7VZko+lrABcvFYaISXxnCQIJSUu5tbULyDBIo rvafwqAIWmvfsBnQEt9UlefE6RgS4Jtky7a0Qfc7gnYsXy5289UAUPlz9KlRirNnV4Ch 3qU/0fIjgBSQEM/KMzqWdDxchZCGIrFm8c5GVgEwuH0itOYWAK1L2XcDh5QofY2XALfv 7pjQRI62jzxvbkIORUT5kA5LcwsTGb1n17pgldHl7LuzWd9UKbQK9A21xd0+jpG9uxlG 4V4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=EWWASfJykpxWFK9PM3hFUlzPPGIFCPnlSxGWeGBsgbg=; fh=ioMWnWtowhk3HBvhCOjNmK8xJXWkeaWr8of6U42MhKE=; b=T2lbkPV1td/ZuaB4FAj+QTQuQE1ID7NJ/81tK9aI+f2EnBH1BqF4AUJ4yktEqV6rOC HPkDAizNLhLKV5cEbwLUr7QbGf1F2vj5SovyESNSwGfLR6RO78aQZHl1El9TUtH+5d8C G205HHjtzbFXEd+hfxseyEI2iI3YcmXqg+d5Wl7AeoG06GJIBxuxrVC9AqqC5Wb8dR2n hf37HUemxROcMxjUQtkAy50qQBZwRt27RaUHdHc36yVpPflf5Q2voHYdHU2u0QDQjbOk CigFYlw4DKvYlGgduwd43+a+1mCti2yQkL3Ld5XZLL7VVlyK/vKfzCFmxPyQMoHiBXoB N7EQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@rjwysocki.net header.s=dkim header.b="Y/bF2eMJ"; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-117542-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117542-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h27-20020a05620a13fb00b00789eefa2a57si5987420qkl.749.2024.03.25.10.51.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 10:51:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117542-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=fail header.i=@rjwysocki.net header.s=dkim header.b="Y/bF2eMJ"; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-117542-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117542-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6B9871C3FB2B for ; Mon, 25 Mar 2024 17:51:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 98D0183A02; Mon, 25 Mar 2024 17:06:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=rjwysocki.net header.i=@rjwysocki.net header.b="Y/bF2eMJ" Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) (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 A406C71B52; Mon, 25 Mar 2024 17:06:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.96.170.134 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711386393; cv=none; b=YNkAQRLdQEETRQnMqayOcdpX/f7jBnHfZGmc60W2xTnzK1lH0QvXVDwHuMwMGonoGqKwAabVdyDk281eLExAoEn2zTUhO9vAFqr2GyQ7vBsbpxR0puclxAt2SLFl54EETUeE2S420zXMOkRmXJ7754OTWK2a+YS29XVav8Hr6I0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711386393; c=relaxed/simple; bh=lZ2ADGkGSXJYxvx17bX1oYw2MgDp/Tjhetn+uOngFP0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XjNe1k7U1k0FacqDzGO9Xs+qTypqxa3UoZOC5KS31zTsJN0974+otiom5Of00vb62Y9hV75AyXobDY0kOSvuYDztwQw5IwH7b6wtU7XLJBukLHQoa9SMhL+fWryPav7oJ7oVvrk+A3genqTAtj2ncnAF+AdB0lfas9oUR7FRI4k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net; spf=pass smtp.mailfrom=rjwysocki.net; dkim=fail (2048-bit key) header.d=rjwysocki.net header.i=@rjwysocki.net header.b=Y/bF2eMJ reason="signature verification failed"; arc=none smtp.client-ip=79.96.170.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rjwysocki.net Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.4.0) id 5a06f3efee13d21f; Mon, 25 Mar 2024 18:06:29 +0100 Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cloudserver094114.home.pl (Postfix) with ESMTPSA id 0D2CE66BCFE; Mon, 25 Mar 2024 18:06:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rjwysocki.net; s=dkim; t=1711386389; bh=lZ2ADGkGSXJYxvx17bX1oYw2MgDp/Tjhetn+uOngFP0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Y/bF2eMJJtEV1rGeaT4+XLiN31Am3Ylmjkrf4AU8d6/cR010pRNeY5dr9jORM/CNe Y4a8cC8M5Ub454SdKOU6RhuliNb7pA2Y9ngDU/MSilp0WWF6ajMFHuLa61epsfxpRg wQ2aFCMwQxejtzwwWzhSXpQ5eD/UzClPaDfPjuz7AzZcScUlurwmeUYo0L5z4Lgkmo ilboju+yFq9fw9j0EF3X4PpVozU7xD4K7dDaYlTLKwhcFWXf58LlL1BhD8G/zFk9n6 T7uyeWoLoegy/X8UYDIGwa8atFZTf+jTZvA6Fp0SEHr0IxFxkP7+3o8IImASL0MsLi DIFnoh8Fsl6uA== From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Srinivas Pandruvada Subject: [PATCH v1 1/6] cpufreq: intel_pstate: Fold intel_pstate_max_within_limits() into caller Date: Mon, 25 Mar 2024 18:01:58 +0100 Message-ID: <3297274.aeNJFYEL58@kreacher> In-Reply-To: <13494237.uLZWGnKmhe@kreacher> References: <13494237.uLZWGnKmhe@kreacher> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrudduuddgfeeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepfedprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehsrhhinhhivhgrshdrphgrnhgurhhuvhgruggrsehlihhnuhigrdhinhhtvghlrdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=3 Fuz1=3 Fuz2=3 From: Rafael J. Wysocki Fold intel_pstate_max_within_limits() into its only caller. No functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/cpufreq/intel_pstate.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) Index: linux-pm/drivers/cpufreq/intel_pstate.c =================================================================== --- linux-pm.orig/drivers/cpufreq/intel_pstate.c +++ linux-pm/drivers/cpufreq/intel_pstate.c @@ -2012,14 +2012,6 @@ static void intel_pstate_set_min_pstate( intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate); } -static void intel_pstate_max_within_limits(struct cpudata *cpu) -{ - int pstate = max(cpu->pstate.min_pstate, cpu->max_perf_ratio); - - update_turbo_state(); - intel_pstate_set_pstate(cpu, pstate); -} - static void intel_pstate_get_cpu_pstates(struct cpudata *cpu) { int perf_ctl_max_phys = pstate_funcs.get_max_physical(cpu->cpu); @@ -2594,12 +2586,15 @@ static int intel_pstate_set_policy(struc intel_pstate_update_perf_limits(cpu, policy->min, policy->max); if (cpu->policy == CPUFREQ_POLICY_PERFORMANCE) { + int pstate = max(cpu->pstate.min_pstate, cpu->max_perf_ratio); + /* * NOHZ_FULL CPUs need this as the governor callback may not * be invoked on them. */ intel_pstate_clear_update_util_hook(policy->cpu); - intel_pstate_max_within_limits(cpu); + update_turbo_state(); + intel_pstate_set_pstate(cpu, pstate); } else { intel_pstate_set_update_util_hook(policy->cpu); }