Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7904828rwp; Wed, 19 Jul 2023 02:03:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlGKS4GZMAcji4pa8QVHml+XqlZLq/0zXpaILCtALJIow0RD+l95yxPJR+g0oXouqNk4C9cC X-Received: by 2002:a05:6a00:2312:b0:67a:b045:e290 with SMTP id h18-20020a056a00231200b0067ab045e290mr2374526pfh.4.1689757383027; Wed, 19 Jul 2023 02:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689757383; cv=none; d=google.com; s=arc-20160816; b=FbboNeeYjHddHeesxOHu1AFyl1HCPmVRLwdXB/lrCUeASDowA3sHuYB12ZAlCMGCzL OJY/cDYEeXNa8C2m3fqsqfKMEW0rzMjgU52X2tFdwO1kVThxedCYz2YEubw79kzMJfZh 14p8FpoAxHJfJJ10vpnNXVdjtgB65KwM6hyho6EEIkLNhdvzIRZF47EelVPK+6LbKYAl Zj1zBQKOPTjb8llZosN9YM5lJbjE1pLsb7yEix6l4dgMmFcRm3iK1xlaRI3Fd8Fp4JPU ninE6bSAVhcuKocV7ldIVgVGCo8TBdN5X9tKe6mrEGbzHz/1J7n3kIGE+sQ+7khiKtav uHLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=vjVuACHY2+4UQNfpkhhRcmaDU0BL8jd8R0EhPu0a2Do=; fh=JwEYEXaw9vEgBrRos7VMRHVY7BhL0lM9VK81FBLHeWI=; b=d1nioskn0DKfIuS9UiSXl0jdhfQYSyGrJ+wETCXS96et1lk3/+BrX66y1A8j9v+q0Y vcwhaWkWxe8t9IKJNJEfpoghDWX6XlZoR0t7NZ/QvHqRLh4PyL0ljyXWUD+ULG3upaAG L0x27eA9ezDXqWKQDM+Uehen147OYmWtTdsnL2Zpt+CC5Hxig5d4Ob3z/1rLpRyfMyFu TUGiUcUMEdcXGMLAdWipBsegVZJdFR283z6ifJ+7Npr2M0xUA+6vstM3wGaG6LqBRmO2 81R9fKD1U9oAwrmU8ODxIOc9Bv8vlTpHFGhuWS8gFXLT6+A2xb4cjVAIgWtDNxYD5dX9 Un9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e189-20020a6369c6000000b00543a881db0fsi3037184pgc.283.2023.07.19.02.02.48; Wed, 19 Jul 2023 02:03:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229618AbjGSIj3 (ORCPT + 99 others); Wed, 19 Jul 2023 04:39:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229558AbjGSIj1 (ORCPT ); Wed, 19 Jul 2023 04:39:27 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A2056136; Wed, 19 Jul 2023 01:39:26 -0700 (PDT) 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 A7CFC2F4; Wed, 19 Jul 2023 01:40:09 -0700 (PDT) Received: from [10.57.31.26] (unknown [10.57.31.26]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6B5F93F6C4; Wed, 19 Jul 2023 01:39:24 -0700 (PDT) Message-ID: <47ded4da-5c39-9132-7978-d0f8c8ee0318@arm.com> Date: Wed, 19 Jul 2023 09:39:53 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] Revert "thermal: power allocator: change the 'k_*' always in estimate_pid_constants()" Content-Language: en-US To: Di Shen Cc: linux-pm@vger.kernel.org, rui.zhang@intel.com, rafael@kernel.org, daniel.lezcano@linaro.org, linux-kernel@vger.kernel.org, xuewen.yan@unisoc.com, jeson.gao@unisoc.com, orsonzhai@gmail.com, zhanglyra@gmail.com, amitk@kernel.org References: <20230712084840.3594-1-di.shen@unisoc.com> From: Lukasz Luba In-Reply-To: <20230712084840.3594-1-di.shen@unisoc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Di, On 7/12/23 09:48, Di Shen wrote: > This reverts commit 90a996544946d1d4834ec2ec8add586edd905779. > > The commit ensures that the pid constants are updated when > sustainable_power changes, but it makes it impossible for > the driver to set the pid constants when the sustainable_power > is not changed. > > When the driver tries to register a thermal zone device by > thermal_zone_device_register_with_trips(const char *type, > struct thermal_trip *trips, int num_trips, int mask, > void *devdata, struct thermal_zone_device_ops *ops, > struct thermal_zone_params *tzp, int passive_delay, > int polling_delay) > and passes the private thermal_zone_params structure data, > > thermal_zone_devcice_register_with_trips > | > thermal_set_governor > | > bind_to_tz > | > power_allocator_bind > | > estimate_pid_constants > > the tzp->k_* will not be the data that driver have given, > but the data estimated by sustainable_power. > > To make it possible for driver to add its own pid constants, That was dropped, the drivers shouldn't configure 'k_*' IPA parameters. There was also an ask to add those parameter values to the DT for setup - also not allowed. > the 'force' flag is needed to indicate whether the tzp->k_* > should be estimated by sustainable_power or not. We don't want to maintain many different ways of configurations, which can cause bugs in not tested corner cases. Please use the user-space to change those 'k_*' parameters. There are this dedicated and safe sysfs interfaces for each thermal zone. The phones that I have on my desk do the update of 'k_*' parameters via sysfs. They do this in different scenarios. You can try to derive best 'k_*' values for your workload scenarios and than save them in the config file. You can update in runtime from user-space when you switch to your scenario (e.g. camera, game, video call). Regards, Lukasz