Received: by 10.223.185.116 with SMTP id b49csp6263752wrg; Thu, 8 Mar 2018 04:42:43 -0800 (PST) X-Google-Smtp-Source: AG47ELsJsxUznaOCxsZDkjun6b1u3+AfLKpQDUi0J8bZx0fNJFndskEukJM6uOPI5QUVreGiF9Pg X-Received: by 2002:a17:902:a985:: with SMTP id bh5-v6mr18065908plb.35.1520512962954; Thu, 08 Mar 2018 04:42:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520512962; cv=none; d=google.com; s=arc-20160816; b=Q86BKYc3ra+uKA0LPRgPIV4ND5imQPYLpFfrez2pSSxvygshPyEeWHYRnC5ax7My2B SGJVgRknOidv//2Zj+L89GxEWskNQrgf0z4+9FhDYampZCMm1Jd4P/Si59FhE7oB2oUo A7Tr2NJ+yla3JmARMTDPoQfOkvYUbnxyqNDRvXxd+PYfN89b/t2ZGzGBww+2NY+CPQBF 5iAdr+6BAVb+ang1sDus2XquMYycXxFYO/XHIOJgZxJni47DKnNIppkF4gZmQTxhbbCZ asRZx/X84Udw7wjIzsJ54XkYSSVfsNgNfePIwGwX1RkndJJgsrG25jrWdF8k/daTEqXC linQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:to:subject:cc :arc-authentication-results; bh=nLAI3t8n0oSjIABK/UrzqW7WFUhqCUcCj/DtqMp5Aag=; b=OXFPt7w0YLe/42krMJ2OmngGDh/Y6tPsxsoN05QnLY946zaM9v+0IbY7OWLfESM3Y1 wpSBrLy2CnvGrGPnpnpMoSw/C2GZQg+EC+6iQROgBF3bA37OVswQx6ENrcVI+HdlxGVV dIu4efjn1CIIsneyQ1wDqu1km4e2AEe/r7Emecp5jXD1YZQ/10YRwroKEKL3ATk6yfav PTPSDTnMufrPqnPI/JLvjrlrFLaRqd/uSVJFOU2JcPWfZdJlDehghhrYC1gEvTXMiIc1 CnBjHEHTsB7swEPpsiYsn/X3qxrCsAYfeGRZfcxQjvyUkqMpO6Z1QWCHrqsVgL6QMIH9 mSdw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m24si12959037pgd.763.2018.03.08.04.42.26; Thu, 08 Mar 2018 04:42:42 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755256AbeCHMlb (ORCPT + 99 others); Thu, 8 Mar 2018 07:41:31 -0500 Received: from foss.arm.com ([217.140.101.70]:37274 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751355AbeCHMl3 (ORCPT ); Thu, 8 Mar 2018 07:41:29 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 166E01435; Thu, 8 Mar 2018 04:41:29 -0800 (PST) Received: from [10.1.210.28] (e107155-lin.cambridge.arm.com [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F14893F53D; Thu, 8 Mar 2018 04:41:25 -0800 (PST) Cc: Sudeep Holla , Ram Chandrasekar , DTML , Lina Iyer , Zhang Rui , Eduardo Valentin , Rob Herring , Mark Rutland , Linux PM list , Linux Kernel Mailing List Subject: Re: [PATCH] thermal: of: Allow selection of thermal governor in DT To: Amit Kucheria References: <3b80853abb45a9e067cf7a16754b07bb67712457.1520274879.git.amit.kucheria@linaro.org> <6d5aeab8-aafe-fa3b-585e-953a34864e7d@arm.com> From: Sudeep Holla Organization: ARM Message-ID: Date: Thu, 8 Mar 2018 12:41:19 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/03/18 10:59, Amit Kucheria wrote: > 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. > While I agree on the facts, I don't think adding this information to DT because thermal governors are not so mature compared to cpufreq/idle is acceptable. It's give more reason not to add as new governors may get added as things mature. > 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. > As Viresh pointed out, if the default hardware or firmware configuration causes that then it's no good platform to use. If adding more functionality in Linux(like cpufreq and others) causes this then Linux needs to deal with it. If default thermal can't help in preventing such damage then it shouldn't be default. >>> 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. > Ah ok. >>> 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? :-) > Cool problem solved, just kidding. > 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? > You mean configuration + policy ? Then yes policy in DT is no-no. > 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. > Fair enough. > 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. > I am not sure about "one true governor" as different users have different needs. >>> 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. > Yes, and Viresh's point triggered more question to me. If DT has some governor like interactive which will not in mainline or not configure in the default build what will be done. If in such case default governor is good enough to boot without burning or any other issues, why not always? >> 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. > As I said IMO I see more issues with that, so I don't like it. > 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). > Sysfs is more flexible than DT and requires some fuzzing to get the best out of the platform if you need. -- Regards, Sudeep