Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp618833pxh; Tue, 9 Nov 2021 16:16:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJwp631ke4OKjp+hdMQKT7WJ3iVcQHqYMB3/7vIiJM66g988E/91KtgM4ba5REANPsV8xLJI X-Received: by 2002:a02:661e:: with SMTP id k30mr8811795jac.20.1636503406814; Tue, 09 Nov 2021 16:16:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636503406; cv=none; d=google.com; s=arc-20160816; b=sgAi4liTtiPoLrGvdiTsAAJcqF2gmkB10MrNevLAFipobSfmxgq+8f9omdlf2i0wdv GVPRhRklop57Ac4UXkRRigjfGA6PKZINWVpEA4dlSXm4UimtNVfhXe3CKw3Ab25Mtjib xCiCoF/MxY+JgkkK6SXXLABoTIKMqj+Y+uIdQO4ag05Fc3vyvR4Ae34yCGS93cE4BOzm dBMTIL7+eLk9EaTC4NZoViT+VnkNGUIbkSOtFlpGwQU0AfCJPcwpjTs/EJ7JjycLB+TD RUK3kCWNypgRVmA/6bzfHdYsoMQeRsRl0H0TWt1TcchPYFcrA341qiL7Iwf58BP4c3oA 6y9g== 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=gLeqMoQ6dpiohkoH+xlYdkq/IF1l5ECVGAijrWEp4vUsCKAM8igtJPlkP7jfESoK7C SNGWrixtVrgFkYFQHvOh+rymwniwsMxgzBcTQRcBRQcO9lCpgSgbJG+kPu0dzgaX1mIg IDzh1zTLhHKMxhBSYu2/j6puDpcQMg/66CX2fBH5lRP6Wxfg5Gdt5ZqXQIBLdELmj8p8 665VhmL9AcCjjNG2WuVe7opr1w3NMhrMCFcuYwGydAvluMig2Wz/PDFfWWGCSqkZ3VRz xRuw78ej6yb45X5pyQnQ5h5/g2g/BIVjVNQhvUfgLhr3oM+L4L3dDC+I/g+JiUYtTrv3 twxg== 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 m1si48489732jat.12.2021.11.09.16.16.34; Tue, 09 Nov 2021 16:16:46 -0800 (PST) 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 S243998AbhKIUAa (ORCPT + 97 others); Tue, 9 Nov 2021 15:00:30 -0500 Received: from foss.arm.com ([217.140.110.172]:37936 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243986AbhKIUA3 (ORCPT ); Tue, 9 Nov 2021 15:00:29 -0500 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 086062B; Tue, 9 Nov 2021 11:57:43 -0800 (PST) Received: from e123648.arm.com (unknown [10.57.26.224]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B109C3F7F5; Tue, 9 Nov 2021 11:57:38 -0800 (PST) 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, steev@kali.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 v4 2/5] thermal: cpufreq_cooling: Use new thermal pressure update function Date: Tue, 9 Nov 2021 19:57:11 +0000 Message-Id: <20211109195714.7750-3-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211109195714.7750-1-lukasz.luba@arm.com> References: <20211109195714.7750-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