Received: by 10.223.185.116 with SMTP id b49csp4897161wrg; Wed, 7 Mar 2018 03:00:52 -0800 (PST) X-Google-Smtp-Source: AG47ELvChjul1INmO2m7Enx8UcRfegspw1Xq9WeTEmXRdb3QmsLs5f8e5kw/3ECqySvQdoZLPmFf X-Received: by 2002:a17:902:8b85:: with SMTP id ay5-v6mr20381456plb.329.1520420451852; Wed, 07 Mar 2018 03:00:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520420451; cv=none; d=google.com; s=arc-20160816; b=nKt5nzr7ITsW1bTWqvfRWR3I93QIpYY0ofnOPs6sINkLGhO3If93yYIACZnH3BmoZx K3nqFyXCsddiXkRk3oBlj/KpO1WcuBxQITLsGW7wYbQc5RgDz4Pud7ltgYVrL5Gj0wdT zm3skz1DVZN3DSl96uZkK5FGubWZ6jryQwQWCqaa1pYfzKBateD+vb/OvmGBOlYJJIA0 ZoiEY8LaUiilUy1pDp2WDT5dbq8o9HKozGbXi9u/dibwxySutaoHRNR+jUMwT7RB6Gva 40tWULPBERFtL0fAziic9EoG/FPS7Q0F5qkWOLsEEPQPXzIFR7FyGJNJKGWw2sJoM1JE Pq2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=oqEYsNB8ACOsRYsfyCf6s7L/ffbsWThgHRFp6KHaJrc=; b=tadWyl6tbMD076DincwRJEoUTjvkubgferxR1Hap6HYJGiNz/4Nxkd+ai0FEcHBQC/ GxSGMHb0kXwN/ehZxTinFdabrGGown2pFOskqP2CIqC2dAsn/w07RjVqecD/o9/86oMg fBkQxjz5FP/mS/zFJThq5v/UpJ6z2XSIjtsrYnBRpmp7S+Qra057z2eDZYxzOAGAubu7 YeMztMEBd6jhbsHcI+tFJMx1VSwHRj3GqmxdMc/Lucyod6P8lqsA8zCiXiPd+fMxV1V1 nGOMy0tfpIlKo622DQjvwkVVDrKZlz9AmzzAkOV69ALJgzA9upIL5oxXXsaWVqQKPt0E 3n3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ehyAq3RS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 21si13748756pfj.306.2018.03.07.03.00.36; Wed, 07 Mar 2018 03:00:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ehyAq3RS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751322AbeCGK7m (ORCPT + 99 others); Wed, 7 Mar 2018 05:59:42 -0500 Received: from mail-qt0-f170.google.com ([209.85.216.170]:35537 "EHLO mail-qt0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751149AbeCGK7k (ORCPT ); Wed, 7 Mar 2018 05:59:40 -0500 Received: by mail-qt0-f170.google.com with SMTP id z14so2068466qti.2 for ; Wed, 07 Mar 2018 02:59:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=oqEYsNB8ACOsRYsfyCf6s7L/ffbsWThgHRFp6KHaJrc=; b=ehyAq3RSIIZA8xg9N/dmzXMEcxp5vkp0xzgohZcs9u6/1aD6Np0s342+spQI4VJYaR FCiIZXrcBuFtGsQC/717HwrWZOf1dHm/p4iqs2ga0BdEnk01AFYHiGuKqYRsJV3F8JBA vYRC1lan2D55y2ZuXnevA86G71My1KpRc3twQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=oqEYsNB8ACOsRYsfyCf6s7L/ffbsWThgHRFp6KHaJrc=; b=KZ5zkx68S6d1xAh2crCT5QK25CQOTwNTrDl0P1ltHnZG1BPl5/6SklnuQkezyQKsV3 iXaIPajXTtwXX+yiMdxHi2b7crnS3EsBKAA4MgDIEXXxbtrnNmpEAs/MgaM6Fzk7Yy9m awPTS8MchAIzcCJzjrEpBc1atw5gFfkiUMo/JZwcCqBeBIYz2H0bZerHhLBvihlxCqdK I6ZEBxh7ffsPzqd4Q3Wu8No8PawcMW1QzNB6gnmZYHcm3BWox1o77auWeeD2QR+iGo7H 7dxGipplFd46//dyrmsFJx60tRQtBLJIcaoigBUebz5zKEWoYifbzfgJLAkTxcan5kT6 doow== X-Gm-Message-State: AElRT7FGYTlzPUDGBBiGMthigaHifcYvHzhxsLalMlGJRY/Ds/9bAnDR 9+ZX6VwQ9KJvocbt2czNQAU/iujjLBV9Aop2Ab3q7E7YBqE= X-Received: by 10.237.54.230 with SMTP id f93mr32030086qtb.139.1520420379392; Wed, 07 Mar 2018 02:59:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.48.48 with HTTP; Wed, 7 Mar 2018 02:59:38 -0800 (PST) In-Reply-To: <6d5aeab8-aafe-fa3b-585e-953a34864e7d@arm.com> References: <3b80853abb45a9e067cf7a16754b07bb67712457.1520274879.git.amit.kucheria@linaro.org> <6d5aeab8-aafe-fa3b-585e-953a34864e7d@arm.com> From: Amit Kucheria Date: Wed, 7 Mar 2018 16:29:38 +0530 Message-ID: Subject: Re: [PATCH] thermal: of: Allow selection of thermal governor in DT To: Sudeep Holla Cc: Ram Chandrasekar , DTML , Lina Iyer , Zhang Rui , Eduardo Valentin , Rob Herring , Mark Rutland , Linux PM list , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 6, 2018 at 6:02 PM, Sudeep Holla wrote: > > > On 05/03/18 18:36, Amit Kucheria wrote: >> From: Ram Chandrasekar >> >> There is currently no way for the governor to be selected for each thermal >> zone in devicetree. > > How is that any different from cpufreq, cpuidle or devfreq subsystems ? Cpufreq/cpuidle are designed to control a single parameter while thermal framework is trying to mitigate heat from several disparate sources that are throttled in different ways. Besides, cpufreq/cpuidle have somewhat mature governors. Cpuidle has only one governor (for tickless) - menu governor, cpufreq has ondemand in mainline, replaced by interactive in android and hopefully soon both will be replaced by schedutil. Badly configured cpufreq/cpuidle/devfreq only leads to wasted power, while badly configured thermal zone leads to the loss of operation e.g. reboots, too hot to touch, etc. >> This results in the default governor being used for all >> thermal zones even though no such restriction exists in the core code. >> > > What restrictions ? I said "no such restriction exists". IOW, the core code does allow the governor to be changed. >> Add support for specifying the thermal governor to be used for a thermal >> zone in the devicetree. > > Then what prevents us from doing the same for other subsystems with so > called /inefficient default/ governors ? Nothing? :-) It depends on how closely we want the board DT to represent a production-ready setup. If a platform maintainer wants to ship a well-tested configuration in DT, is that really a problem? If however, you are requiring them to ship magic runes for userspace daemons (e.g. per-board thermald config) to tweak the various governors in sysfs, it takes a bit more work to get to a production-ready setup. We should of course continue to improve our govenors to arrive at the one true governor, but that'll take some time and might never even happen in the case of thermal IMHO. >> The devicetree config should specify the governor >> name as a string that matches any available governors. If not specified, we >> maintain the current behaviour of using the default governor. > > If one is specified, can the user change it from sysfs ? If > yes, then why do we need this binding at all ? If no, we are basically > restricting, then what would happen if the DT was shipped with wrong > governor specified because the firmware author didn't know about any > other governor ? The governor can be changed from sysfs today. So it is all override-able. I guess your main worry is an unmodifiable DT with this option being shipped in firmware, right? That is a fair point, though that could be worked around from sysfs. > IMO, having this in DT is bad idea as it may cause more issues than > gain. We already have sysfs support like other PM subsystems and > userspace can deal with it. As mentioned above, I think thermal is a bit special because bad configuration may lead to loss of operation. But iff we're strictly enforcing the rule about no policy in board DTs, then I concede. Personally, I'd like mainline board DTs to have enough policy to provide a stable system so I don't have to futz around with userspace to set it all up correctly (in 3 different distros). Regards, Amit