devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Stéphan Kochen" <stephan@kochen.nl>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Jean Delvare <jdelvare@suse.com>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	lm-sensors@lm-sensors.org, devicetree@vger.kernel.org,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	Zhang Rui <rui.zhang@intel.com>,
	Eduardo Valentin <edubezval@gmail.com>
Subject: Re: Interrupt driven thermal OF sensors
Date: Fri, 29 Jan 2016 01:16:24 +0100	[thread overview]
Message-ID: <20160129001624.GA29675@Stephans-iMac.lan> (raw)
In-Reply-To: <56A9A184.90001@roeck-us.net>

On Wed, Jan 27, 2016 at 09:05:08PM -0800, Guenter Roeck wrote:
> ... and thus disable any external chip signals associated with those limits.
> 
> The idea with most if not all temperature sensors is that multiple trip points
> would be configured as multiple limits in the chip. Often those limits,
> when reached, are tied to pins to cause a specific action (eg to cause
> an interrupt, turn on a fan, or shut down the hardware). In effect, you
> suggest to re-define this mechanism and, for all practical purposes,
> use just one of the limits provided by the chip(s).
> 
> Personally I don't think that would be a good idea, because it would have
> impact on hardware design. It would effectively limit the use of the thermal
> subsystem with temperature sensor chips to hardware designs which take
> the thermal subsystem's expectations and assumptions into account.
> At the same time, it would for all practical purposes mandate the use
> of the thermal subsystem on such systems, because the hardware would depend
> on the thermal subsystem's implementation to control the temperature
> in the system.

Ah, whoops. That makes a lot of sense. And I think I even saw the
poweroff in action once, when I misconfigured the temperature offset
register.

> While it may be feasible in some situations to have the thermal subsystem
> dynamically set free-moving limits, there are many other situations where
> those limits are tied to hardware responses, and the limits need to be static.
> 
> Maybe this is just a different world view. The thermal subsystem may see the
> world assuming that it always has an unlimited number of trip points available,
> and the chip it supports only support lower and upper boundaries (or trip points),
> which can be set and changed as needed. This is somewhat different to the
> traditional world view, implemented not only in many temperature sensors,
> but also in fan controller or Super-IO chips, where a set of temperatures
> is programmed into the chip only once. I hope that it is possible to support
> both mechanisms.

That would be nice.

For starters, I think it should be possible for a driver to enable
thermal subsystem stuff only if an of_node is present. (Though I haven't
checked what that's set to with `status = "disabled"` in the device
tree. Hopefully NULL.)

So, one option is to, instead of thermal OF telling the driver what the
limits are, we simply have thermal OF only notify the driver of trip
changes, and the driver does all the work of inspecting defined trips.

In the LM90 case, it can set low/high and critical alerts nicely based
on trip types (critical or not). But, for example, MAX6696 has an
additional 'emergency' alert. Should that just be left untouched?

Either way, this means hardcoding thermal trip to sensor alert mapping
in the driver. A more elaborate solution would be to define that mapping
in the device tree, and have thermal OF handle it, instructing the
driver to set specific alerts. (And then the device tree author may
choose to leave certain sensor alerts alone.)

-- 
Stéphan Kochen

  reply	other threads:[~2016-01-29  0:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21 19:34 [PATCH 0/3] lm90: device tree and thermal zone support Stéphan Kochen
     [not found] ` <1453404877-17897-1-git-send-email-stephan-j6uo2F6POYhmR6Xm/wNWPw@public.gmane.org>
2016-01-21 19:34   ` [PATCH 1/3] lm90: separate register accessors from sysfs Stéphan Kochen
     [not found]     ` <1453404877-17897-2-git-send-email-stephan-j6uo2F6POYhmR6Xm/wNWPw@public.gmane.org>
2016-01-22 14:42       ` Guenter Roeck
     [not found]         ` <56A23FD2.9040009-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2016-01-22 22:00           ` Stéphan Kochen
     [not found]             ` <20160122220056.GA21534-3Ql6wuUqVi7fKcxHm0zdRv8+0UxHXcjY@public.gmane.org>
2016-01-25  9:41               ` [lm-sensors] " Jean Delvare
2016-01-21 19:34   ` [PATCH 2/3] lm90: initialize parameters from devicetree Stéphan Kochen
     [not found]     ` <1453404877-17897-3-git-send-email-stephan-j6uo2F6POYhmR6Xm/wNWPw@public.gmane.org>
2016-01-22 14:53       ` Guenter Roeck
     [not found]         ` <56A24278.8050909-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2016-01-22 22:32           ` Stéphan Kochen
2016-01-23  2:53             ` Guenter Roeck
     [not found]               ` <56A2EB3E.4080002-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2016-01-27 21:18                 ` Interrupt driven thermal OF sensors (was: [PATCH 2/3] lm90: initialize parameters from devicetree) Stéphan Kochen
2016-01-28  5:05                   ` Interrupt driven thermal OF sensors Guenter Roeck
2016-01-29  0:16                     ` Stéphan Kochen [this message]
2016-01-21 19:34   ` [PATCH 3/3] lm90: register with thermal zones Stéphan Kochen
     [not found]     ` <1453404877-17897-4-git-send-email-stephan-j6uo2F6POYhmR6Xm/wNWPw@public.gmane.org>
2016-01-22 22:45       ` Rob Herring
2016-01-22 23:02         ` Stéphan Kochen
     [not found]           ` <20160122230239.GA22301-3Ql6wuUqVi7fKcxHm0zdRv8+0UxHXcjY@public.gmane.org>
2016-01-22 23:11             ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160129001624.GA29675@Stephans-iMac.lan \
    --to=stephan@kochen.nl \
    --cc=devicetree@vger.kernel.org \
    --cc=edubezval@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jdelvare@suse.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=lm-sensors@lm-sensors.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).