Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1131513pxb; Thu, 7 Oct 2021 01:10:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/WOBqBBizFTQBNehIvGcgSqbRpS2PVlPO3xuIAGvsN4UKWzqf1cHPOcGeeGCREhE7DXt5 X-Received: by 2002:a62:1ac3:0:b0:44b:b424:b49c with SMTP id a186-20020a621ac3000000b0044bb424b49cmr2953057pfa.86.1633594231481; Thu, 07 Oct 2021 01:10:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633594231; cv=none; d=google.com; s=arc-20160816; b=wsznT9HfG1T0RNhlHuu55uOt6TAejxZJ3ZZOmRWhFEX7oNK++0aPjKHw5ODX2HCFsH xsNJ3lKoxEoEPi594LgR2nvPMHvJ+V2dZck+9hCfK4rKjl149Ipt/bUKo4aWRy5/LwHa OgwVCOzMuefycuR0B9OOxL9/UddOpKd3+8txe8Htbtu7rYMBJkgthUWG3CK3cNFcSXHi IRwTuTzMoUcaW2XfpGEVmlb0yOSy+Q3S9pUkTdZ/H4Ig3ooJ+rd+dcPTFoorf4C1NV2H wxtbb9B0pMu2EaMMuAA3WNlAjMdLbnrbPNK4xdSw9gDGocgMtVthASK9ZyBWsLOwOTQ+ YNlA== 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=pYr3hxxr/wNOYRrFkbJM39ZUhn/JcyjirYu8S4YHw/k=; b=po6FG03qT7sHwzk8D1hayrWDylwAvyzSaip6gwJM0MR/McJbOOJGsZuOwi2t01jJeA d3SynkhvKbEV2gicKYyVkM8hI7uTYkdXb+zPR/iAb+aAEK8Q+uj1AaDcNNmTksOjZBlD m+Z/YrmTJZCrs75jTtpEF4vLCeT9VdyLSa02b75GjFcs+zVb0g+njB2pWHIj2fWy8g9I dRvMQBGyDkOUfWNk73Yx/QopSF70fOtky5SidamR2RiiGVaa/NHfFk2vfg8KCubbRCLl DKmmMWL4h91vc6GUCrsXu0a0G/3IneQCDkJt9CoRRnZpT+UwF300QiHHHE5K/iC9m4eE WvBA== 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 o11si29236491pgc.13.2021.10.07.01.10.18; Thu, 07 Oct 2021 01:10:31 -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 S240580AbhJGIJu (ORCPT + 99 others); Thu, 7 Oct 2021 04:09:50 -0400 Received: from foss.arm.com ([217.140.110.172]:35556 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240559AbhJGIJq (ORCPT ); Thu, 7 Oct 2021 04:09:46 -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 57BEB11B3; Thu, 7 Oct 2021 01:07:52 -0700 (PDT) Received: from e123648.arm.com (unknown [10.57.18.236]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 663873F766; Thu, 7 Oct 2021 01:07:49 -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 3/5] cpufreq: qcom-cpufreq-hw: Update offline CPUs per-cpu thermal pressure Date: Thu, 7 Oct 2021 09:07:27 +0100 Message-Id: <20211007080729.8262-4-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211007080729.8262-1-lukasz.luba@arm.com> References: <20211007080729.8262-1-lukasz.luba@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The thermal pressure signal gives information to the scheduler about reduced CPU capacity due to thermal. It is based on a value stored in a per-cpu 'thermal_pressure' variable. The online CPUs will get the new value there, while the offline won't. Unfortunately, when the CPU is back online, the value read from per-cpu variable might be wrong (stale data). This might affect the scheduler decisions, since it sees the CPU capacity differently than what is actually available. Fix it by making sure that all online+offline CPUs would get the proper value in their per-cpu variable when there is throttling or throttling is removed. Fixes: 275157b367f479 ("cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support") Signed-off-by: Lukasz Luba --- drivers/cpufreq/qcom-cpufreq-hw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index a2be0df7e174..0138b2ec406d 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -304,7 +304,8 @@ static void qcom_lmh_dcvs_notify(struct qcom_cpufreq_data *data) if (capacity > max_capacity) capacity = max_capacity; - arch_set_thermal_pressure(policy->cpus, max_capacity - capacity); + arch_set_thermal_pressure(policy->related_cpus, + max_capacity - capacity); /* * In the unlikely case policy is unregistered do not enable -- 2.17.1