Received: by 10.223.185.116 with SMTP id b49csp3421012wrg; Mon, 5 Mar 2018 21:39:29 -0800 (PST) X-Google-Smtp-Source: AG47ELvg7Eiua+PNE+jMbHKVLGLb6N9hHSt11OxqkYQAezCNWudp7krHknXbolIVfrS2o7RSZTdN X-Received: by 2002:a17:902:7044:: with SMTP id h4-v6mr15424030plt.378.1520314768956; Mon, 05 Mar 2018 21:39:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520314768; cv=none; d=google.com; s=arc-20160816; b=aeAt7Brp6Q+3ENgByTqJuKipvJBALVBIIENPFAApoAGaIUn4uqzghj8Gxq3tVucnn1 wBxdJpvtdz9LSgoz2lNuOmapbkUgrOV+FJQnVkXNpH3uFuBPeGtotRNdzYVuzOsdr1BZ 0gYP8pChcAhjZqiruip+rIQ3b2QPMcAvw2KaAfNPToAjEp0AkmLZgCLwIKnVtNxigKqo p8OYOHnpGJH2GnGazVkqjsicGs98t6HgFxzbJNkjwb+x7fcbGXEMgG6OnS/vYz3uNDDp xbTlQQQPOTnAap0jL6PUd7lrnNtejXQueDixc04P4DcSEq490ConVoD/FZhhhDREcuTl WYMw== 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=lPdSVXi33JQr1PDC3kBFx7zg475IZ62vITVk8WMQJOQ=; b=rXmMCWTgC0eKC+Tkv74gMLtRNYRhmLQT1bo/OfGkcMZGr/ym1//6eILKRdnTH5mwkj Dj+CdADQ3u6NWxr3JWAT88rkcKc43e4rlDP5/sMzkCCHsZ7YMUWavxGbisMltd0Wy0FJ k+7KIw++d5EFom0XUOHZLZKKyUmTHHKc7YCGXF796MMXxGdDTtQNsyPX+x8G6ZJiMb1e UanxdW24MyCbz4s6Z5GmvGlARnyO2aEQjR2+xTHvGXrn+mbJo1pFVdINcY1848o1/Kc3 sFppIfdWc0hrYJOqAL5sTDxwTPUcMNe9hP+D1lNwdAv6NpxbC5fok/Bokw00M+xPs032 faNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=clc7dwya; 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 i4-v6si10788024plk.771.2018.03.05.21.39.14; Mon, 05 Mar 2018 21:39:28 -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=clc7dwya; 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 S1750865AbeCFFiW (ORCPT + 99 others); Tue, 6 Mar 2018 00:38:22 -0500 Received: from mail-qk0-f195.google.com ([209.85.220.195]:46970 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750780AbeCFFiU (ORCPT ); Tue, 6 Mar 2018 00:38:20 -0500 Received: by mail-qk0-f195.google.com with SMTP id 130so23532854qkd.13 for ; Mon, 05 Mar 2018 21:38:19 -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=lPdSVXi33JQr1PDC3kBFx7zg475IZ62vITVk8WMQJOQ=; b=clc7dwyaYsLxutPUZD0za4l+KnIL7ff1I2lbq0YVkgrFpKbB6V5DuKCQxPiRzC/dKR mu+c6GkpGBV0TMyA4uwhpKKwc594d65RdiUbhLp5W7i6Zta6Mfb7V6aiHTBFDhAeNw2s 4u+ub0BjChb2fME1oUMnWuo4RRqCFmyMoV7p0= 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=lPdSVXi33JQr1PDC3kBFx7zg475IZ62vITVk8WMQJOQ=; b=gNtsKPnsBpYduxU62g+7LsgwsOM+12wVNzQLLFApjSwwZzkYeMGHgtTnRye6TsKIBA T23xk4sz+LRO6EhH3UVK/qZD3xeBWIauhmbRRHve4sNVHRT9dGr1u0a3PkdzCalJc5mL VI5SbAo7que3eVR17BfivE6vXGfEVpVOE49/RRrNzXwZIPTzLgcNgeFX7xJd9YBv5bbe qEZeBc6UXjFoze7cyWBtHonk6JNkRzX3DTWq5G2owWGqGUmYaKUJie75sTWStLk/F8QA j3IjRLm0f/RCABVI/LbbkpWS38CRDy1MaR4fXPWkQr9wtWRX2diHFduWatf3wrNBJQSp sc7w== X-Gm-Message-State: APf1xPBy1yms14Dufcfcy66GraGXcVk1AMG45wfXbJw3hM54Y7rGrGgr pMpdtSBYwMvaQWt4faBDHzN4CGIRKAlWmAukOknjG6i3 X-Received: by 10.55.6.140 with SMTP id 134mr27024285qkg.281.1520314699370; Mon, 05 Mar 2018 21:38:19 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.48.48 with HTTP; Mon, 5 Mar 2018 21:38:18 -0800 (PST) In-Reply-To: References: <3b80853abb45a9e067cf7a16754b07bb67712457.1520274879.git.amit.kucheria@linaro.org> From: Amit Kucheria Date: Tue, 6 Mar 2018 11:08:18 +0530 Message-ID: Subject: Re: [PATCH] thermal: of: Allow selection of thermal governor in DT To: Rob Herring Cc: DTML , Ram Chandrasekar , Lina Iyer , Zhang Rui , Eduardo Valentin , Mark Rutland , Linux PM list , "linux-kernel@vger.kernel.org" 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 1:38 AM, Rob Herring wrote: > On Mon, Mar 5, 2018 at 12:36 PM, Amit Kucheria wrote: >> From: Ram Chandrasekar >> >> There is currently no way for the governor to be selected for each thermal >> zone in devicetree. This results in the default governor being used for all >> thermal zones even though no such restriction exists in the core code. >> >> Add support for specifying the thermal governor to be used for a thermal >> zone in the devicetree. 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. >> >> Signed-off-by: Ram Chandrasekar >> Signed-off-by: Amit Kucheria >> --- >> Documentation/devicetree/bindings/thermal/thermal.txt | 8 ++++++++ >> drivers/thermal/of-thermal.c | 6 ++++++ >> 2 files changed, 14 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt b/Documentation/devicetree/bindings/thermal/thermal.txt >> index 1719d47..fced9d3 100644 >> --- a/Documentation/devicetree/bindings/thermal/thermal.txt >> +++ b/Documentation/devicetree/bindings/thermal/thermal.txt >> @@ -168,6 +168,14 @@ Optional property: >> by means of sensor ID. Additional coefficients are >> interpreted as constant offset. >> >> +- thermal-governor: Thermal governor to be used for this thermal zone. >> + Expected values are: >> + "step_wise": Use step wise governor. >> + "fair_share": Use fair share governor. >> + "user_space": Use user space governor. >> + "power_allocator": Use power allocator governor. > > This looks pretty Linux specific. Not that we can't have Linux > specific properties, but we try to avoid them. > > What determines the selection? I'd imagine only certain governors make > sense for certain devices. We should perhaps describe those > characteristics which can then infer the best governor. Not really > sure though... I'm not sure if it would be easy to assign preferred governors to device classes. It is dependent on what devices are present on the system, what throttling knobs they expose and how the system designer decided to integrate it all. e.g. A GPU driver might be controlled in kernel or userspace depending on whether it exposes a devfreq knob or some more esoteric statistics to userspace. Bang Bang governor seems to be designed for Fans with a simple ON/OFF iterface. Userspace governor is designed to move thermal policy to userspace (e.g. through thermald). So backlight brightness, battery charging, GPU scaling, even cpu frequency scaling can be offloaded to userspace. On embedded platforms, modem control typically happens in userspace Power allocator governor is designed for a closed-loop system to keep the total TDP of the platform under control while allowing various devices (cpu, gpu, modem, etc.) to dynamically increase or decrease their individual budget depending on the usecase. Regards, Amit