Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp598512pxb; Wed, 3 Nov 2021 09:13:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwy2eQz9fyaSaOvZeL8EAOHehwHjlfqcmzOXfRAUAJV+rGsBPJN6bSlHGcxQlTIhdNnISmB X-Received: by 2002:a17:906:26c4:: with SMTP id u4mr55019860ejc.511.1635956017668; Wed, 03 Nov 2021 09:13:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635956017; cv=none; d=google.com; s=arc-20160816; b=qedXXY5GD1mxggBb1xUCO1iPnXWw/iZgjuHrPj9kcHaslkywa9u0zTU57dkJpE8ihG P2Z8z3hwpkJ+XEkCN3uJx36Z18CliCPBuQ02Isx2J3z2DFHSTmV5O8+COOLDWo88rXGg gPCFxygnp9CiOAcL0GCOKxUk1a+w+QeDiC3ELqeVYr/YqiI7YIYk4acV6pyHvhfO5AEr zu6KtdnyphLTYApwGkKwZRACBBxJ8X1eSHCcAUpNOwZVVadPS1skhQIaz0vAaMZTR2oZ 3Owx0FzlgQQF3jpO5AYMmcmADrxWJOo7FwQ/bvXD2kZOUcKr6zvB9IqDkVmZnVPWW7fj nzwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=LRvWm14fqKNe09cLkBb4QiTFV7lcNE+ThzaLbVlCE+M=; b=A9xzthrIjD5/XpYKge5qmMZesFz070JwqgL5Fv+4IdL07f95eBbiBXEl+xcPIeVrtt qqmPLXwaJ3MVIiEE6+KKZY9mzlF0T3EERfej9lxCkHXMu520nWVk5cIhy7I7vLqXNx0n P1R3b3y++JsVtW2sx/c1vEfGC1plCS6QUJTHXRQ+kcWdL6WiicoLU+XtzaViWbjHuUAL OHMaaBPF9mYEq99FzFE3Q/welwhUmNRqvRkqM003jk99wCJ7d4yslQ2WBHKvRnJ4A3wn 5+cshAooQmXqloXhxHK0nBCTbaPv9ovEG81+1pz52H4r7Es5+bYlNsCSLPv+Cu+yVf5b PRKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qb2si4865494ejc.603.2021.11.03.09.13.12; Wed, 03 Nov 2021 09:13:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232810AbhKCQNk (ORCPT + 99 others); Wed, 3 Nov 2021 12:13:40 -0400 Received: from foss.arm.com ([217.140.110.172]:33022 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232889AbhKCQNX (ORCPT ); Wed, 3 Nov 2021 12:13:23 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0468711D4; Wed, 3 Nov 2021 09:10:47 -0700 (PDT) Received: from e123648.arm.com (unknown [10.57.26.226]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 94C873F7D7; Wed, 3 Nov 2021 09:10:42 -0700 (PDT) From: Lukasz Luba To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, lukasz.luba@arm.com, sudeep.holla@arm.com, will@kernel.org, catalin.marinas@arm.com, linux@armlinux.org.uk, gregkh@linuxfoundation.org, rafael@kernel.org, viresh.kumar@linaro.org, amitk@kernel.org, daniel.lezcano@linaro.org, amit.kachhap@gmail.com, thara.gopinath@linaro.org, bjorn.andersson@linaro.org, agross@kernel.org Subject: [PATCH v3 2/5] thermal: cpufreq_cooling: Use new thermal pressure update function Date: Wed, 3 Nov 2021 16:10:17 +0000 Message-Id: <20211103161020.26714-3-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211103161020.26714-1-lukasz.luba@arm.com> References: <20211103161020.26714-1-lukasz.luba@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thermal pressure provides a new API, which allows to use CPU frequency as an argument. That removes the need of local conversion to capacity. Use this new function and remove old conversion code. Signed-off-by: Lukasz Luba --- drivers/thermal/cpufreq_cooling.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/thermal/cpufreq_cooling.c b/drivers/thermal/cpufreq_cooling.c index 43b1ae8a7789..0bfb8eebd126 100644 --- a/drivers/thermal/cpufreq_cooling.c +++ b/drivers/thermal/cpufreq_cooling.c @@ -462,7 +462,6 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata; struct cpumask *cpus; unsigned int frequency; - unsigned long max_capacity, capacity; int ret; /* Request state should be less than max_level */ @@ -479,10 +478,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, if (ret >= 0) { cpufreq_cdev->cpufreq_state = state; cpus = cpufreq_cdev->policy->related_cpus; - max_capacity = arch_scale_cpu_capacity(cpumask_first(cpus)); - capacity = frequency * max_capacity; - capacity /= cpufreq_cdev->policy->cpuinfo.max_freq; - arch_set_thermal_pressure(cpus, max_capacity - capacity); + arch_update_thermal_pressure(cpus, frequency); ret = 0; } -- 2.17.1