Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3601652pxb; Mon, 24 Jan 2022 13:15:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJylXkOok/WDpUS91mDx1i9CI16zhErH8SnGJbdjMPdByCo0dYzl5M+VRzLJ1YEXXfKR1Iz3 X-Received: by 2002:a17:902:6b89:b0:149:7aa8:d98c with SMTP id p9-20020a1709026b8900b001497aa8d98cmr16127168plk.72.1643058844235; Mon, 24 Jan 2022 13:14:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643058844; cv=none; d=google.com; s=arc-20160816; b=C1+z8b/tWaq7nrb7cDLN3i+R0S5nirKHOWB+jJ0dBb4IotpuQ82E9WLPiw9J7cupuY AAqjPWBdrQ+zZFs2AVzhubF1bS6rLh4OlDAJGYgqhskVhvhPlJk7OfHx/dzwg28sdla1 TrWvG722VF4pfmLAkdEVNqzpYU213c7EliSKm/qP8tk5sBkuJwXkapcYQE6NC/b7davk Nr67TgzIWy5hcUXXqKu85aF8WTpVlNmmeAe7N+rTrtcg3g6dVNxum1vEbTscmx0uWxJL wgqdw58DtxeXMcCqBovLjdoHsBW9rdqhvcFwpt0bG1ZGC8nMuPftqsxzChaSjqUtv6XO dEVg== 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=gcsKCzrGcxjvBhBpn0limG3/l6SHSW4yf3RlqcQ8jlhUm/AA26kYr4p6uHujFy1e0K LSR85YE/t489+0rGpaw7PPwXf+AkoNzC0qKHqpH2VvrDIh0r+btc+VRDwpG2ZOEDr9bS fl9uscW7L2NIoJrrDrU5ds8ETV/m1IMrO6peGuprzYC1tUNkVsv5N9wvK62x2ZXh2nqT ICLU7t83AIgnXDa7sEmNrERQailY80kqf2ohPk70Fhv6TEtaH+xQdPo1uXt+nW2jSuOJ yjMtuzaLll09KZm4S2GW96OCeDmIegQngpbF5XThH7KkGSskkjM3kelHC87k0+9kXMtv in1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Mhc5G9Kk; 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 i5si9012709pla.326.2022.01.24.13.13.51; Mon, 24 Jan 2022 13:14:04 -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=Mhc5G9Kk; 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 S1388650AbiAXUjz (ORCPT + 99 others); Mon, 24 Jan 2022 15:39:55 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:56450 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380841AbiAXUQ7 (ORCPT ); Mon, 24 Jan 2022 15:16:59 -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 ams.source.kernel.org (Postfix) with ESMTPS id 2F5E2B811F9; Mon, 24 Jan 2022 20:16:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 584DEC340E7; Mon, 24 Jan 2022 20:16:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643055416; bh=AuuH0Kty7H2/ZTZUm98NLAwa0+UopAyoe2zfWSIK1HU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mhc5G9KkBQIoRR6uJp8MJsrdALGqcZB3axbSB3ZTmtsD/cHBnQmtN+PwCh79jJKfK mZjXWWoWImtwt9TVfTCl+R3GDuPgO2YXC7TYKttqhdEI1HPoIkISLVo0oAJyRx2ea0 jXSAIam47xkEEgCv1Bw/PapDosYNQtYFCMxRpiGM= 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.15 143/846] cpufreq: qcom-cpufreq-hw: Update offline CPUs per-cpu thermal pressure Date: Mon, 24 Jan 2022 19:34:20 +0100 Message-Id: <20220124184105.911964992@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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