Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3744235pxb; Tue, 26 Jan 2021 03:43:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJWpt+U6WOFBZ+HXKb5JxuWwmoKPHkxQTGFDvJqTB6E7iRKLymv4V5N826TNnJ8fCsVbg4 X-Received: by 2002:a17:906:b51:: with SMTP id v17mr3300239ejg.8.1611661425263; Tue, 26 Jan 2021 03:43:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611661425; cv=none; d=google.com; s=arc-20160816; b=ZKiqgsRSelCz1okS0DBpBG8rB88eaisHrXTPOfoXbbhIZVan7J6MbYENzdeELhP8Bh 2f5aMBft/HP0fdG12Q39+YO4WgKVCp9HZ4BNccdbfeXfo8GkS4Tyz7CUqGFexD4IYWiv 7bZ5RYE4pLvSfBnD1MyUaXS2KvTDGWbo/ptcEO2x8FrvuYWtjoEPm6Przq4mxHZylN8Y 37Sn9f2sMLDjOH3uGX/9B70hSOszb/B0W9NfEHR0vA1qCAnMswpvCmui8VmqO6WJ5Fwv zupqwamB4AQpPFCRTT4Xd24X7rEhpSKp1PQDH+SPx+uMx7UAYD198f2IEbIv6Okyk+Y/ iAog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=9vj4mvqD58pILTb+UV+gIyoYda2yPTzCUInAKZRqtb0=; b=aH9PFU2DWbp2peU4FRlWAIR0C2fcheJh3quYPZiBox/bE4UqKwMots+2cXTIOMkuXd mGj8lBAyuuc7xsK2Ry5MLU3fwQUeRYUDp7LWozsp02qgdIWikUBR6ZX3uXvX9ZJqO0y3 l5mx+v3evfA0XB2mhSljXB9TxVQNYDRUu3kzOZp9ANJWJ5d0eRy8/pcWYxGRskqP2CgY gWzQma4w+3RCV8R5ossqsts7kdBOChC3EXbpX3zQc6g/kSA+ezeU6HFApKqkMTgRIuQo 9KzxwadlYvJl2SW9lBb1ggQnPi80F6xdTGQhVzqhLNijo79SEKh39svbmX+7bHEm24sk AZEA== 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 y11si8958780edp.516.2021.01.26.03.43.20; Tue, 26 Jan 2021 03:43:45 -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 S2405341AbhAZLjp (ORCPT + 99 others); Tue, 26 Jan 2021 06:39:45 -0500 Received: from foss.arm.com ([217.140.110.172]:60876 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404262AbhAZKlJ (ORCPT ); Tue, 26 Jan 2021 05:41:09 -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 7DF83D6E; Tue, 26 Jan 2021 02:40:23 -0800 (PST) Received: from e123648.arm.com (unknown [10.57.2.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CA2D83F66B; Tue, 26 Jan 2021 02:40:20 -0800 (PST) From: Lukasz Luba To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: vireshk@kernel.org, rafael@kernel.org, daniel.lezcano@linaro.org, Dietmar.Eggemann@arm.com, lukasz.luba@arm.com, amitk@kernel.org, rui.zhang@intel.com, cw00.choi@samsung.com, myungjoo.ham@samsung.com, kyungmin.park@samsung.com Subject: [RFC][PATCH 0/3] New thermal interface allowing IPA to get max power Date: Tue, 26 Jan 2021 10:39:58 +0000 Message-Id: <20210126104001.20361-1-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, This patch set tries to add the missing feature in the Intelligent Power Allocation (IPA) governor which is: frequency limit set by user space. User can set max allowed frequency for a given device which has impact on max allowed power. In current design there is no mechanism to figure this out. IPA must know the maximum allowed power for every device. It is then used for proper power split and divvy-up. When the user limit for max frequency is not know, IPA assumes it is the highest possible frequency. It causes wrong power split across the devices. This new mechanism provides the max allowed frequency to the thermal framework and then max allowed power to the IPA. The implementation is done in this way because currently there is no way to retrieve the limits from the PM QoS, without uncapping the local thermal limit and reading the next value. It would be a heavy way of doing these things, since it should be done every polling time (e.g. 50ms). Also, the value stored in PM QoS can be different than the real OPP 'rate' so still would need conversion into proper OPP for comparison with EM. Furthermore, uncapping the device in thermal just to check the user freq limit is not the safest way. Thus, this simple implementation moves the calculation of the proper frequency to the sysfs write code, since it's called less often. The value is then used as-is in the thermal framework without any hassle. As it's a RFC, it still misses the cpufreq sysfs implementation, but would be addressed if all agree. Regards, Lukasz Luba Lukasz Luba (3): PM /devfreq: add user frequency limits into devfreq struct thermal: devfreq_cooling: add new callback to get user limit for min state thermal: power_allocator: get proper max power limited by user drivers/devfreq/devfreq.c | 41 ++++++++++++++++++++++++--- drivers/thermal/devfreq_cooling.c | 33 +++++++++++++++++++++ drivers/thermal/gov_power_allocator.c | 17 +++++++++-- include/linux/devfreq.h | 4 +++ include/linux/thermal.h | 1 + 5 files changed, 90 insertions(+), 6 deletions(-) -- 2.17.1