Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp728420ybb; Wed, 25 Mar 2020 08:29:34 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvIHt0MG1MrqOPPZQrtG9CyOO3/3BB8OKQpBeTGkanwwBYJQBz33cVpCsweNSpwf2CFyunr X-Received: by 2002:aca:d645:: with SMTP id n66mr2781283oig.66.1585150173878; Wed, 25 Mar 2020 08:29:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585150173; cv=none; d=google.com; s=arc-20160816; b=pkxBLGU6Unh3g5clCoiqfAuXJvwzvMRx8LKF5omNbonY04um/DY4+bkYs1QaNTGlv+ i8FwgFHlefzYh524i29DfTgtDmLORkJ7ZfF+2ANtlEgLN9BS7Ext30syyp/anW9UQjc/ A9TNWe2jfcsoI9d+IQjSP3C8eOQjX4at6KsYRk85kV0SQdRoI+X9AIZzLz9Dr1DOiLwm d4u7YvDvAMUdvrrr94sZp5VUL5SLVexQyYhp2+07FYlt4D7w+FgGBg8xmS2AjdcWMn28 S5aVjgup2PBxIrPdMrK3bUDCwPCQAhzP6o5ZhlIHDlrzqRfV+OqG4HtNmbBOQIzWD6hp p5Lw== 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 :in-reply-to:references:mime-version:dkim-signature; bh=MAfXLeK4jv3GCXZEXdtxljvjsSAfg9wpjX0t8Ep/xn0=; b=V8nhNPMnJK8HTDlt0LDlvnCFO+7i9XOce1WUGCRCR4wnTahoAbL6hUpNnSaukXuz4E KUD/dCvH3evreQ7H3QMPd9GIh4uuJFarHVU++LpklJWFHVcg06V/CxTwQ2R+lq1FpibI 3Qndydsab53d8INIKpVILPqaf1vHLWayRkQznmdiaLS1wxTE4OaLX+eQ5R9TfvcObk3v 8px5CvJbM6cH1YU/brVHGBm5PlxneydQ3BkdDn/3ZgUNTprUyGm4tRqvQZ5UQ1mL4ZCo hTCeFluAW9y47mmlPlnn4/fMw9vp/nrwiZ7iULO395IkebzP+e5QWTlfH8lBqS+9TLDE stNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aDW1feaQ; 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 z29si1576722oog.56.2020.03.25.08.29.20; Wed, 25 Mar 2020 08:29:33 -0700 (PDT) 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=aDW1feaQ; 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 S1727847AbgCYP2j (ORCPT + 99 others); Wed, 25 Mar 2020 11:28:39 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:36816 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727828AbgCYP2j (ORCPT ); Wed, 25 Mar 2020 11:28:39 -0400 Received: by mail-lf1-f66.google.com with SMTP id s1so2149600lfd.3 for ; Wed, 25 Mar 2020 08:28:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MAfXLeK4jv3GCXZEXdtxljvjsSAfg9wpjX0t8Ep/xn0=; b=aDW1feaQrj/vQbwncf35ZAbIJQv6QoVYZCbKz9TCT9fUH98JKwEEaGp+U3VA4/RSxj M2U1pJCxnd/u57YPJBO93DEX2pyVd5yTcvNeo3knsXJMSZXsjuSwyZbLvyiU1biwWm6p CGrF1GW7glPm10woi2K7MCSpOd6gPGxgfI5wUW4egp3qRlpv0tElS6C3iexVg400nWrW jFLalqO3PixJa/k6GxgaWExvLfeARawYBJhoYg6e2BCtnChUG8KMqaG1szJeWQ2KoZpY BHHVvBAmrzGU9sAO4d+K7uYZ0ONthZXN1RMD0zzJ5xLy4buThs8hGRL8hQeUor+yr0S0 i15A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MAfXLeK4jv3GCXZEXdtxljvjsSAfg9wpjX0t8Ep/xn0=; b=Re2EFhcPg9yVMMj2hGGH4FKFIIu1PaKMUDEFGhlV9EUDXgMPjfxq9GDcWlrUJnRxFz 4bdAOkMsvHi5X9wQqAqFRlZB07uLKxDf3KR7zX3dbs6hwJZPhEadEiUR/5pBelotuAjG tzuogVfQ7u0rtfak/fo6V3hYaAHVArk0f1jQf6x1w+lLYLwxonsfQCYi+hAq/XwS/KbW QR1vsSb2YtqLEy5p3nMSdmT8xpDix3H2NsaIIaGCw2/BfcgKvKccFIk4w3AKeaXKqMNI /br+KwBXISMoTj7xsSSpyXYFXqyC+tMBkQa2FZgtTrGRLgeEzFgnBVND3Pmz8wNx2bR2 Wr8w== X-Gm-Message-State: ANhLgQ38WzH9lyG8wWrSmANES/SFRaZmIfF3WpSQJa8XMJl/fLY5lQYQ UbgreHoumA7Apj6KBZJOz6tFcJVGGJSeJZm9Y1mhLQ== X-Received: by 2002:ac2:43a8:: with SMTP id t8mr2721177lfl.82.1585150114380; Wed, 25 Mar 2020 08:28:34 -0700 (PDT) MIME-Version: 1.0 References: <1ee4240e29edefc36b5d410d4792971c2bb4c5d5.1585117436.git.amit.kucheria@linaro.org> In-Reply-To: From: Amit Kucheria Date: Wed, 25 Mar 2020 20:58:23 +0530 Message-ID: Subject: Re: [PATCH v3 2/3] dt-bindings: thermal: Add yaml bindings for thermal cooling-devices To: Lukasz Luba Cc: Linux Kernel Mailing List , linux-arm-msm , Stephen Boyd , Matthias Kaehlcke , Daniel Lezcano , Amit Kucheria , Zhang Rui , Linux PM list , DTML 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 Wed, Mar 25, 2020 at 3:51 PM Lukasz Luba wrote: > > Hi Amit, > > On 3/25/20 6:34 AM, Amit Kucheria wrote: > > As part of moving the thermal bindings to YAML, split it up into 3 > > bindings: thermal sensors, cooling devices and thermal zones. > > > > The property #cooling-cells is required in each device that acts as a > > cooling device - whether active or passive. So any device that can > > throttle its performance to passively reduce heat dissipation (e.g. > > cpus, gpus) and any device that can actively dissipate heat at different > > levels (e.g. fans) will contain this property. > > > > Signed-off-by: Amit Kucheria > > --- > > .../thermal/thermal-cooling-devices.yaml | 116 ++++++++++++++++++ > > 1 file changed, 116 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/thermal/thermal-cooling-devices.yaml > > > > diff --git a/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.yaml b/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.yaml > > new file mode 100644 > > index 000000000000..b5599f7859f8 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.yaml > > @@ -0,0 +1,116 @@ > > +# SPDX-License-Identifier: (GPL-2.0) > > +# Copyright 2020 Linaro Ltd. > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/thermal/thermal-cooling-devices.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Thermal cooling device binding > > + > > +maintainers: > > + - Amit Kucheria > > + > > +description: | > > + Thermal management is achieved in devicetree by describing the sensor hardware > > + and the software abstraction of cooling devices and thermal zones required to > > + take appropriate action to mitigate thermal overload. > > + > > + The following node types are used to completely describe a thermal management > > + system in devicetree: > > + - thermal-sensor: device that measures temperature, has SoC-specific bindings > > + - cooling-device: device used to dissipate heat either passively or artively > > + - thermal-zones: a container of the following node types used to describe all > > + thermal data for the platform > > + > > + This binding describes the cooling devices. > > + > > + There are essentially two ways to provide control on power dissipation: > > + - Passive cooling: by means of regulating device performance. A typical > > + passive cooling mechanism is a CPU that has dynamic voltage and frequency > > + scaling (DVFS), and uses lower frequencies as cooling states. > > + - Active cooling: by means of activating devices in order to remove the > > + dissipated heat, e.g. regulating fan speeds. > > + > > + Any cooling device has a range of cooling states (i.e. different levels of > > + heat dissipation). They also have a way to determine the state of cooling in > > + which the device is. For example, a fan's cooling states correspond to the > > + different fan speeds possible. Cooling states are referred to by single > > + unsigned integers, where larger numbers mean greater heat dissipation. The > > + precise set of cooling states associated with a device should be defined in > > + a particular device's binding. > > [snip] > > > + > > + thermal-zones { > > + cpu0-thermal { > > + polling-delay-passive = <250>; > > + polling-delay = <1000>; > > + > > + thermal-sensors = <&tsens0 1>; > > + > > + trips { > > + cpu0_alert0: trip-point0 { > > + temperature = <90000>; > > + hysteresis = <2000>; > > + type = "passive"; > > + }; > > + }; > > + > > + cooling-maps { > > + map0 { > > + trip = <&cpu0_alert0>; > > + cooling-device = <&CPU0 THERMAL_NO_LIMIT > > + THERMAL_NO_LIMIT>; > > Maybe add something like this, to better reflect the description: > > trip = <&cpu0_alert0>; > /* Corresponds to 1000MHz in OPP table */ > cooling-device = <&CPU0 5 5>; > > This is less confusing than THERMAL_NO_LIMIT. Thanks for the review. Will fix.