Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3623776pxb; Mon, 24 Jan 2022 13:46:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtiXkwG7+gdreVNw/yig36mdhMgXCp1ap7IrloTqb3QhnGMxsCRqOFUgFE3tkDDNutuzwa X-Received: by 2002:a17:90b:3106:: with SMTP id gc6mr227834pjb.77.1643060788607; Mon, 24 Jan 2022 13:46:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643060788; cv=none; d=google.com; s=arc-20160816; b=qUCcY0oFReJ7ZUB1lYgt52GnVWAf0DbpEmtWjHgwJgHpYzBNNDsks/mDpCSRtFsOCA G3l9bx6wqesvgOJZLvmTGCbtYconxjYM6QgdVHI0PPam6h2aHfkDJAmYCJlrjglW1cWt 3TtblVr9wexRIjjIHO40tF8SpkvVb0UtBWmDBlYcv6Y9Ocgc/F+bnMzdJYvBBgCqQSsB 3PfIjMPKmA3yEgDqRaQitelxWMTtcMHWxbUvwTzTwmpvKGnehbmwHpMnumvtlZKkFSPJ zPdtzufuAN26ufCjwbjYCdmL0+82sJmJ47QFeCpyOh7BhcOLoNayA8QGOIy0leEfF1pg PL0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Lmq2mUkGwvfrE7/2ThEntqcYB9pGLz9kPPSUXCsh+U8=; b=mjpoI5s1oHyKWjBLszoxtl+iVYzA6pftNeLP2htPRsOMkQ6DyZBZB0q5nFvFYgg6S8 YaaN0H9k96K6Ik7EcDmYb98sWJAz78EEIUuu+QnFN+75FxRnzWbnQevVu8ih02Zh/ne5 r2tr8xD6ojA9lyV6/ksXBMFMfIrlRdjEkDxU7iUKkjH3R6MIxwMZtMDKQeEJZOIaMhhK 8pnKDHCsmovMdxO5um+Eslkme8ET8MosJLFntqkktoam59Xs8/HMy8foKag02COsuBQ/ /o1eL/W24HF6iLopPRu1ZbGs7jUi54tPj32eI9hjeDtARmPKGMbusd8Sn2YJTp9e4VOo qkPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Wd45aYVF; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q3si444606pjf.139.2022.01.24.13.46.17; Mon, 24 Jan 2022 13:46:28 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Wd45aYVF; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378088AbiAXV07 (ORCPT + 99 others); Mon, 24 Jan 2022 16:26:59 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:53558 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444396AbiAXVAu (ORCPT ); Mon, 24 Jan 2022 16:00:50 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E0AD4612E9; Mon, 24 Jan 2022 21:00:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E4F6C340E5; Mon, 24 Jan 2022 21:00:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058048; bh=AuuH0Kty7H2/ZTZUm98NLAwa0+UopAyoe2zfWSIK1HU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wd45aYVFvtw+cucv9Fcjw+A63o8/+DI2YvUwm44ikSixlEdUWmxVK8j83Uc6zXVIX kD/IzjeXc01yTbcE2Tn5Pse8Us/HdS4+ioUkIkSATGKsQgtj4ATSiXI9gz22IESY9R B/GjiqB5Yc3db8NPm2LUCmCvrTZjSTSw5TDo7nTM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thara Gopinath , Lukasz Luba , Viresh Kumar , Sasha Levin Subject: [PATCH 5.16 0165/1039] cpufreq: qcom-cpufreq-hw: Update offline CPUs per-cpu thermal pressure Date: Mon, 24 Jan 2022 19:32:34 +0100 Message-Id: <20220124184130.767895775@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lukasz Luba [ Upstream commit 93d9e6f93e1586fcc97498c764be2e8c8401f4bd ] 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") Reviewed-by: Thara Gopinath Signed-off-by: Lukasz Luba Signed-off-by: Viresh Kumar Signed-off-by: Sasha Levin --- 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 a2be0df7e1747..0138b2ec406dc 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.34.1