Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6366928pxb; Wed, 17 Feb 2021 02:33:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyB+VXvKlOr+U52AWN0TGbkrkHpoftRBlps5pgI9mQ8RqZvHsUe1qGq7Vg7xvsxBNavWo4W X-Received: by 2002:a17:906:c7cd:: with SMTP id dc13mr6877809ejb.405.1613558015616; Wed, 17 Feb 2021 02:33:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613558015; cv=none; d=google.com; s=arc-20160816; b=ZyTlfuoVgaanuJLzfllqyXrW34RYPbR41GDIJkAgBpnVoU+VFIXwdqhT4czE8wK4x3 obHGfV017VjxpT+W0+xx/F3wvRvDQKsHxxr1/8JjK0sw7nXqXtCNZCdMNP/CqLvlFj60 S0shvJ94s9kYDmiVJPNWzRz2GTBerdwyFRehTMlHhfXs6GW4IyGUresRW+qLeD2OhM8k UVvQTy747I0vlnDTEnRaZrPU0/kyMGZUkcops5M8bjF2DJGu2wkxsNREVnY8VDz39KaN esHkukfH+UqmaAT01365pzy7VyFya+x2ZBpn7Q+qG813kzxGL5Xt1KB2uoM4OoQn4r4S pVtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=/EHdOzkVMPJMszVK0O3rW5f+Ai4311eiWYnQz6hS0HY=; b=piuGoHjvMotPjMBFWA8rNICDW9p+XGbTUwo2fR/FE0Fof4V7s6H+DksuFa/0m51h1m LVjDJ5szfaq50fBjQ3eWZzEdH7WoX0Z3nl+yF6RGE0T0gP8IX96HsboNf5ArREx9cA2A N+mNidneQu6ecw2qEvxZmVYjxioCK+BJchTa7DTfpoQCa4ml1Xagrn6ZpLSGYwZMy14c V3gzvGKeXGVUmP1H9ebsE0kDK6XMtjPPsLad5CRWh1mxydHpq6jcwBZI8v8dizzHIjYt aeBbnLgXM8nwO8q9AbEdIF4O007R1GUVhYr7DNVU0pU/O4bmu0enjXL50yrl1KsyHca+ tWZg== 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 dk18si941642edb.443.2021.02.17.02.33.12; Wed, 17 Feb 2021 02:33:35 -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 S232226AbhBQKaH (ORCPT + 99 others); Wed, 17 Feb 2021 05:30:07 -0500 Received: from foss.arm.com ([217.140.110.172]:55582 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229707AbhBQKaE (ORCPT ); Wed, 17 Feb 2021 05:30:04 -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 282A51042; Wed, 17 Feb 2021 02:29:18 -0800 (PST) Received: from [10.57.61.90] (unknown [10.57.61.90]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8D0B73F73B; Wed, 17 Feb 2021 02:29:15 -0800 (PST) Subject: Re: [PATCH] thermal: cpufreq_cooling: freq_qos_update_request() returns < 0 on error To: Viresh Kumar , Amit Kucheria Cc: Amit Daniel Kachhap , Daniel Lezcano , Javi Merino , Zhang Rui , "Peter Zijlstra (Intel)" , Ingo Molnar , Thara Gopinath , Vincent Guittot , "v5 . 7+" , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org References: From: Lukasz Luba Message-ID: <91749e19-9091-1292-b8aa-c923efa8021d@arm.com> Date: Wed, 17 Feb 2021 10:29:13 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Viresh, On 2/17/21 5:48 AM, Viresh Kumar wrote: > freq_qos_update_request() returns 1 if the effective constraint value > has changed, 0 if the effective constraint value has not changed, or a > negative error code on failures. > > The frequency constraints for CPUs can be set by different parts of the > kernel. If the maximum frequency constraint set by other parts of the > kernel are set at a lower value than the one corresponding to cooling > state 0, then we will never be able to cool down the system as > freq_qos_update_request() will keep on returning 0 and we will skip > updating cpufreq_state and thermal pressure. To be precised, thermal pressure signal is not so important in this mechanism and the 'cpufreq_state' has changed recently: 236761f19a4f373354 thermal/drivers/cpufreq_cooling: Update cpufreq_state only if state has changed > > Fix that by doing the updates even in the case where > freq_qos_update_request() returns 0, as we have effectively set the > constraint to a new value even if the consolidated value of the > actual constraint is unchanged because of external factors. > > Cc: v5.7+ # v5.7+ > Reported-by: Thara Gopinath > Fixes: f12e4f66ab6a ("thermal/cpu-cooling: Update thermal pressure in case of a maximum frequency capping") I'm not sure if that f12e4f is the root cause. > Signed-off-by: Viresh Kumar > --- > Hi Guys, > > This needs to go in 5.12-rc. > > Thara, please give this a try and give your tested-by :). > > drivers/thermal/cpufreq_cooling.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Anyway, the fix LGTM. I will have to make sure that I'm CC'ed for these topic, so I can have a look (I missed somehow 236761f19) Reviewed-by: Lukasz Luba Tested-by: Lukasz Luba Regards, Lukasz