Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755101AbcJGRtN convert rfc822-to-8bit (ORCPT ); Fri, 7 Oct 2016 13:49:13 -0400 Received: from mail1.bemta3.messagelabs.com ([195.245.230.176]:23453 "EHLO mail1.bemta3.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751222AbcJGRtD (ORCPT ); Fri, 7 Oct 2016 13:49:03 -0400 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplk+JIrShJLcpLzFFi42KJ27nUWJfzwfd wg1W7hSxmzl/CajH14RM2i/lHzrFaHF70gtFi/pVrrBb3vx5ltPh2pYPJ4uanb6wWl3fNYbP4 3HuE0eLGun3sFk8WnmGyWHr9IpNF694jQO7DPjaLWzNesDoIeKyZt4bRY+esu+we1zaLeSze8 5LJY9OqTjaPO9f2sHns/N7A7nH8xnYmj8+b5AI4o1gz85LyKxJYM55Nqiw4J1Wx5noTWwNjv1 gXIyeHkMBSRokfc9JAbDYBQ4l5b94zgtgiApkSj3e3sXcxcnEwC+xikZg5+Qc7SEJYIFFi9fa tzBBFSRK/dnwEsjmAbCuJA+tZQcIsAioSR/etAivhFQiQaH7WzAQyR0jgBKPE5CXzwOZwAtWf fLmFBcRmFJCV+NK4GqyBWUBc4taT+UwgtoSAgMSSPeeZIWxRiZeP/7FC2PISa389gYrbS7y+9 44F5AYJAX2JvsZiiLChxKppB1ggbHOJ86uXs0CM15FYsPsTG4StLbFs4WuoOwUlTs58wjKBUX wWkitmIWmZhaRlFpKWBYwsqxg1ilOLylKLdA3N9JKKMtMzSnITM3N0DQ2M9XJTi4sT01NzEpO K9ZLzczcxApMHAxDsYFy13fMQoyQHk5Io78vK7+FCfEn5KZUZicUZ8UWlOanFhxhlODiUJHhz 7wHlBItS01Mr0jJzgGkMJi3BwaMkwnv5LlCat7ggMbc4Mx0idYpRUUqc1xGkTwAkkVGaB9cGS 52XGGWlhHkZgQ4R4ilILcrNLEGVf8UozsGoJMw7F2QKT2ZeCdz0V0CLmYAW5y/9ArK4JBEhJd XAWFbpubbxjY/OSavWUJGvjBmi3FqKdsURWht2LLxQlBzQEBtS8PdeceIpdsXph3RtHLh3sBi b3/UvTN85c0b8CTXtj5UfKs/f/5/Kl6vT7pT889ediZ99g60eL/vo+vbUhAzxPQLcrifcb08O uVR6xDhy9TImOVWXzEtqahoczZqecwz9VXWUWIozEg21mIuKEwEPhp9hmAMAAA== X-Env-Sender: stwiss.opensource@diasemi.com X-Msg-Ref: server-8.tower-38.messagelabs.com!1475862537!57210633!1 X-Originating-IP: [94.185.165.51] X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked From: Steve Twiss To: Keerthy , Eduardo Valentin , "Zhang Rui" CC: DEVICETREE , Dmitry Torokhov , Guenter Roeck , LINUX-INPUT , LINUX-WATCHDOG , Lee Jones , "Liam Girdwood" , Mark Brown , Mark Rutland , Rob Herring , Support Opensource , Wim Van Sebroeck , LINUX-KERNEL , LINUX-PM Subject: RE: [PATCH V1 05/10] thermal: da9062/61: Thermal junction temperature monitoring driver Thread-Topic: [PATCH V1 05/10] thermal: da9062/61: Thermal junction temperature monitoring driver Thread-Index: AQHSH7B3m++mOrvh0ECD7ljm7p6YrKCcZ0SAgAC5ZLA= Date: Fri, 7 Oct 2016 17:48:56 +0000 Message-ID: <6ED8E3B22081A4459DAC7699F3695FB7018CCE2815@SW-EX-MBX02.diasemi.com> References: <3bc9fd76-2885-b07a-9df8-7802b7535da2@ti.com> In-Reply-To: <3bc9fd76-2885-b07a-9df8-7802b7535da2@ti.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.20.26.77] x-kse-attachmentfiltering-interceptor-info: protection disabled x-kse-serverinfo: sw-ex-cashub01.diasemi.com, 9 x-kse-antivirus-interceptor-info: scan successful x-kse-antivirus-info: Clean, bases: 07/10/2016 16:04:00 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3341 Lines: 102 Hi, On 07 October 2016 06:29, Keerthy [mailto:a0393675@ti.com] wrote: > On Thursday 06 October 2016 02:13 PM, Steve Twiss wrote: > > From: Steve Twiss [...] > > + > > +static int da9062_thermal_get_trip_type(struct thermal_zone_device *z, > > + int trip, > > + enum thermal_trip_type *type) > > +{ > > + struct da9062_thermal *thermal = z->devdata; > > + > > + switch (trip) { > > + case 0: > > + *type = THERMAL_TRIP_HOT; > > 125C is pretty hot. Just a suggestion, do look at THERMAL_TRIP_CRITICAL. > Quite warm. I got this from the Documentation/devicetree/bindings/thermal/thermal.txt "hot": A trip point to notify emergency "critical": Hardware not reliable. The junction temperature supervision characteristics for DA9061 supports three levels and 125degC is the lowest "warning" level. This warning level is intended for non-invasive temperature control where the necessary mitigation is under software control of the system. The other two levels are hotter than 125degC and it is not possible to intervene using software. The hardware will automatically power off. [...] > > +static int da9062_thermal_notify(struct thermal_zone_device *z, > > + int trip, > > + enum thermal_trip_type type) > > +{ > > + struct da9062_thermal *thermal = z->devdata; > > + > > + switch (type) { > > + case THERMAL_TRIP_HOT: > > + dev_warn(thermal->dev, "Reached HOT (125degC) > temperature\n"); > > Any cooling action? What is done once you reach this high temperature? There is nothing to do in the device driver. This is just a stub for board specific additions to mitigate the temperature. There is a similar function in the RCAR thermal driver which contains a FIXME comment. But, apart from helping with my testing, it doesn't add anything in the driver. It can be removed. [...] > > +static const struct da9062_thermal_config da9062_config = { > > + .name = "da9062-thermal", > > +}; > > + > > +static const struct da9062_thermal_config da9061_config = { > > + .name = "da9061-thermal", > > +}; > > + > > +static const struct of_device_id da9062_compatible_reg_id_table[] = { > > + { .compatible = "dlg,da9062-thermal", .data = &da9062_config }, > > + { .compatible = "dlg,da9061-thermal", .data = &da9061_config }, > > Two separate compatible values. Do you have anything different apart > from the name? Why use 2 compatibles when there is absolutely no > difference? Yes. This was a comment for the watchdog device driver as well. My concern was having multiple devices (61 and 62) in the same system -- and allowing the driver to report the hardware difference. There is discussion going on about this in other threads. Not certain of the final outcome yet, apart from my existing proposal should be changed. -- From Guenter Roeck: -- http://www.spinics.net/lists/linux-watchdog/msg10040.html [...] > > + INIT_DELAYED_WORK(&thermal->work, da9062_thermal_poll_on); > > + mutex_init(&thermal->lock); > > thermal_zone_device_register itself does > INIT_DELAYED_WORK(&(tz->poll_queue), thermal_zone_device_check); > > refer: drivers/thermal/thermal_core.c > > It does a periodic monitoring of the temperature as well. Do you really > want to have an additional work for monitoring temperature in your > driver also? I will take a look at this for V2. Regards, Steve