From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965637AbcBQUwg (ORCPT ); Wed, 17 Feb 2016 15:52:36 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:8979 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965407AbcBQUwd convert rfc822-to-8bit (ORCPT ); Wed, 17 Feb 2016 15:52:33 -0500 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Wed, 17 Feb 2016 12:52:39 -0800 Subject: Re: [PATCH V5 07/11] of: Add bindings of hw-trip-points for soctherm To: Wei Ni , Rob Herring References: <1454057260-16412-1-git-send-email-wni@nvidia.com> <56C17AFD.8050203@nvidia.com> <56C4417D.2030409@nvidia.com> CC: Sascha Hauer , Thierry Reding , Zhang Rui , Stephen Warren , Mikko Perttunen , "linux-tegra@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , From: Matt Longnecker Message-ID: <56C4DD90.3080506@nvidia.com> Date: Wed, 17 Feb 2016 12:52:32 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56C4417D.2030409@nvidia.com> X-Originating-IP: [172.17.185.213] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL101.nvidia.com (172.20.187.10) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (cc += linux-pm) Rob, The Linux thermal framework makes a sharp distinction between "thermal zones" and "cooling devices". thermal_zones are aware of temperatures and have trip points. cooling_devices are unaware of temperatures -- they just have a state variable. The thermal framework binds thermal zones at particular temperatures to particular cooling devices. It does so *in software* The SOC_THERM IP block doesn't fit neatly in that paradigm. Yes, it provides the ability to read temperatures and raise interrupts at temperatures. However, it also has the ability to take cooling action _in hardware_ at particular temperatures. It can throttle the CPU & GPU clock and it can shut down the SOC. Neither of those are graceful actions, but they are valuable in practice. In previous incarnations of this driver we have implemented an unholy mash-up of a cooling device and a thermal zone for configuring the hardware thermal actions. It was a mess. This patchset from Wei takes a simpler approach -- allow the thermal hardware cooling actions to be configured directly via DT. It's simple but it's good enough in practice. I like it. -Matt On 02/17/2016 01:46 AM, Wei Ni wrote: > On 2016年02月15日 15:15, Wei Ni wrote: >> >Hi, Rob >> > >> >On 2016年02月12日 22:42, Rob Herring wrote: >>> >>On Fri, Jan 29, 2016 at 2:47 AM, Wei Ni wrote: >>>> >>>Add hw-trips sub-node for soctherm, which is >>>> >>>used to describe the hardware trip points for >>>> >>>each soctherm sensors. >>> >> >>> >>I still don't understand why you are doing something custom here. >>> >>What's wrong with what is defined in: >>> >> >>> >>Documentation/devicetree/bindings/thermal/thermal.txt > I think it's better to add a .set_trip_temp for of-thermal's > thermal_zone_of_device_ops{}, so that we can set trip points on hardware. I'm > preparing patches, and will send out next version. > Thanks for your comments. >