Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1474054pxb; Sat, 16 Oct 2021 10:50:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYUewCVA6Hu6CQ8GtldEm0TnH2R6FElDV0mxNIIh3Ab5fwajvaMUCsvkNMLNoJLtPX+gx2 X-Received: by 2002:aa7:cb03:: with SMTP id s3mr28720597edt.334.1634406603839; Sat, 16 Oct 2021 10:50:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634406603; cv=none; d=google.com; s=arc-20160816; b=xc2fCb98OPSOOzrzsG0Yza/ofhTuN+2nQCqii7A4DE06oPxh6mHBzHTD5KmsnV7d7w +eHB6kik8G+yCJMabajT34mMHPYruSTXllFMv4OhCJ1Rwq7ZRZRG55hBj6oOIIZWpw8b g16HrNDa7M8Z1RCuTxXXlOnUIMeQHd5HPd18FdwIcwlOIB+kWWUwP6skkXOy3SQ92YSz jmijO2BPBkyAVBXuPKiPH1Tz1xZJ8dEqZgd7RM6+2AVgEfk8ElWescF+rUv3xKN/+FYC FdGxdaVVBsaLy4dFt8yt+jrXhwgWeJtw/jhZrFQ84NdPPJBiqN26Kkl7u2kZ28JuRR+V Eubw== 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=MEK4M5kOx7wMWFIDfBmzTphguyr4Lk/FYRbSv57HNh8=; b=KIQss9jMfXJsFhW1FolVeaFlFedV0u0QzRmCRYA4i6kR8GeKegCiuFSl5JTsPBpg+W mcV4Py7x+sUYLkWZqPRR2IKreljwVfRjeYZWZ1ykzmPBp5HJwG3FYpDMcCYFzF3/SbBe k8iLpQGqrWMpASDL0ul0BwJ5sv76UkcQqC0fVf9goPZf+63jN77t+2YZ7gdGxuGq6H6w qQRFFg2SS1iTob01NYYfHLLJC4IO0Wk1ygOjbGPi4YyncZ05YDp46QmHwOPpDCZDma5R a+xuLhENOvvsmgcI5sf+xYxP9Dc7GosxpGySkwg7wDBSoY1Vfw3tbOjVrxDejb2cwvus p8FA== 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 ka7si12985239ejc.664.2021.10.16.10.49.24; Sat, 16 Oct 2021 10:50:03 -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 S236516AbhJOOtU (ORCPT + 99 others); Fri, 15 Oct 2021 10:49:20 -0400 Received: from foss.arm.com ([217.140.110.172]:44070 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240769AbhJOOsO (ORCPT ); Fri, 15 Oct 2021 10:48:14 -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 C97D914BF; Fri, 15 Oct 2021 07:46:07 -0700 (PDT) Received: from e123648.arm.com (unknown [10.57.23.184]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D0B7A3F66F; Fri, 15 Oct 2021 07:46:04 -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 v2 2/5] thermal: cpufreq_cooling: Use new thermal pressure update function Date: Fri, 15 Oct 2021 15:45:47 +0100 Message-Id: <20211015144550.23719-3-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211015144550.23719-1-lukasz.luba@arm.com> References: <20211015144550.23719-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..835c091ce818 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_thermal_pressure_update(cpus, frequency); ret = 0; } -- 2.17.1