Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp646282pxb; Tue, 1 Feb 2022 07:36:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0hvY+C2zBqU8zEh828RsEcj3PHY73deRin7YNRcbcw0yM3yuqvtng8PQmWIfzaMHYx3zk X-Received: by 2002:a17:90b:2516:: with SMTP id ns22mr2925831pjb.242.1643729789155; Tue, 01 Feb 2022 07:36:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643729789; cv=none; d=google.com; s=arc-20160816; b=gMfzdzxKwSJL9P4q9jY0eH8FwBnoxPWRgjz5zlB4lGQtdjAjNoYWeAZRd9lgtIPi0M b9luTRUtjZspXPi8LevD6G5WsSd0OXNVzHVPgs2IAZnLSzfpfzfqjn2xjc0JtwK4kNNv rREOd9s8YEefPe3BgwvPFStz3YX0zBeO0ktxUqoQw7YcaoaxFl62LbEG++KT83NXErkj QjnWhl7ntHXXRLPIOyI9wh4XWw7iIKXKSAM7ZT0PJw4TiH/5FAAI6dubLw9WK10homQn FzUz7adNUBa3zYoHkoVgkqYNIQGBWIMIM+lX0JxliAe9QqPAI8aUIhZtJDJ8tbSsfAJO 3+KQ== 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=qjbhkSBUbjN4D5zo7DElYJ48Ath1FsP2nPdXtDozYPw=; b=aRWumuWnwsgNVvxeI1DGbCsQMSUpSmGUxfLDzhRTuF8QsalPZUnD5urFbEl7cnaHK8 lIkBIXxJxFuy1C034zW3kOKPqSuJoNkvyCHb86h5W4XnG2Ao8VInhkpffbA8+MQjGgWU TdVWqCP5vkts2JcG+gcxZRmDKAdgQcF4nGRP6g5hf1rlDxSnnDd92jSEauin2iP42R9w XowO6JM/L1siVL3A/qFpLFKq0EwaoXwZ5QaFyN6qOMMQxy9mckEeoxyORolJ9XHOfUZk desyNsoz2pj2BPI15iU/PFuUlADEGxQqyqpTZl/CAlTmc41+gCg2KO9bLrAoV7+0kDqH ipeg== 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 p12si16357686plq.95.2022.02.01.07.36.17; Tue, 01 Feb 2022 07:36:29 -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 S1357981AbiAaH0N (ORCPT + 99 others); Mon, 31 Jan 2022 02:26:13 -0500 Received: from foss.arm.com ([217.140.110.172]:36498 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357985AbiAaHZi (ORCPT ); Mon, 31 Jan 2022 02:25:38 -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 14BE7D6E; Sun, 30 Jan 2022 23:25:37 -0800 (PST) Received: from [10.57.9.236] (unknown [10.57.9.236]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2B4C03F73B; Sun, 30 Jan 2022 23:25:35 -0800 (PST) Subject: Re: [PATCH v5] drivers: thermal: clear all mitigation when thermal zone is disabled To: Manaf Meethalavalappu Pallikunhi Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Zhang Rui , "Rafael J . Wysocki" , Amit Kucheria , Daniel Lezcano References: <1643307093-22501-1-git-send-email-quic_manafm@quicinc.com> From: Lukasz Luba Message-ID: <4024218b-7938-e181-f456-bff4b3fb157a@arm.com> Date: Mon, 31 Jan 2022 07:25:33 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <1643307093-22501-1-git-send-email-quic_manafm@quicinc.com> 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 Manaf, On 1/27/22 6:11 PM, Manaf Meethalavalappu Pallikunhi wrote: > Whenever a thermal zone is in trip violated state, there is a chance > that the same thermal zone mode can be disabled either via > thermal core API or via thermal zone sysfs. Once it is disabled, > the framework bails out any re-evaluation of thermal zone. It leads > to a case where if it is already in mitigation state, it will stay > the same state forever. > > To avoid above mentioned issue, add support to bind/unbind > governor from thermal zone during thermal zone mode change request > and clear all existing throttling in governor unbind_from_tz() > callback. I have one use case: This would be a bit dangerous, e.g. to switch governors while there is a high temperature. Although, sounds reasonable to left a 'default' state for a next governor. > > Suggested-by: Daniel Lezcano > Signed-off-by: Manaf Meethalavalappu Pallikunhi > --- > drivers/thermal/gov_power_allocator.c | 3 +++ > drivers/thermal/gov_step_wise.c | 26 ++++++++++++++++++++++++++ > drivers/thermal/thermal_core.c | 31 +++++++++++++++++++++++++++---- > 3 files changed, 56 insertions(+), 4 deletions(-) Why only two governors need that change and not all? Because they don't have 'bind/unbind' callbacks, then maybe we should change that as well to make it consistent? Regards, Lukasz