All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] hwmon API update
Date: Tue, 15 Feb 2011 22:07:35 +0000	[thread overview]
Message-ID: <20110215230735.6a52cfb6@endymion.delvare> (raw)
In-Reply-To: <4D57CC24.1040306@free.fr>

On Mon, 14 Feb 2011 19:40:14 +0000, Matthew Garrett wrote:
> On Mon, Feb 14, 2011 at 11:33:55AM -0800, Guenter Roeck wrote:
> > On Mon, Feb 14, 2011 at 02:05:57PM -0500, Matthew Garrett wrote:
> > > The kernel has generic support for thermal management. Making it work 
> > > for any device is just a matter of a driver generating the appropriate 
> > > thermal and cooling devices and associating them. ACPI already works 
> > > this way.
> > > 
> > Not sure what you suggest here. Thermal devices register as hwmon devices
> > if so configured, so having hwmon devices register as thermal devices
> > would not work, at least not without some serious thought to prevent
> > registration loops.
> 
> That's really an implementation detail - the worst case at present is 
> that you'd end up with the same sensor providing data twice, but that's 
> fixable.

I agree. I tend to believe that this approach would be superior to the
initial proposal for the problem at hand. The few required hwmon
drivers would simply register their temperature sensors as thermal
zones, and their fan control outputs as cooling devices, to the thermal
subsystem. This requires no change to the hwmon core, nor to all other
individual hwmon drivers.

> > If you are looking for thermal device support, maybe the drivers in question 
> > should be implemented as thermal device drivers and provide hwmon functionality
> > through the thermal subsystem. Did you consider that option ?
> 
> We could definitely change the existing hwmon drivers to be thermal 
> drivers instead, but not everything they do fits into that model.

Not instead. Additionally.

> > Do you plan to use/utilize the thermal subsystem, or do you plan to duplicate
> > that functionality in the GPU driver(s) ? Guess that was one of the reasons
> > why Jean asked for a use case of the proposed API.
> 
> Use the thermal subsystem. That's why I made the ACPI thermal code 
> generic in the first place.

This sounds good.

> > If you plan to use the thermal subsystem without having to rewrite hwmon drivers,
> > did you consider means to interconnect the hwmon subsystem with the thermal subsystem,
> > eg by creating a means for hwmon devices to register as thermal devices ?
> 
> As I said, we could rework the hwmon drivers into thermal devices
> instead, but we'd still need a mechanism for providing the thermal 
> device back to the registering device.

Correct.

> > > Because hardware control is the kernel's job, not userspace's. Having 
> > > hardware melt just because userspace fell off a cliff isn't acceptable.
> > > 
> > The same argument would apply to system fan control, doesn't it ?
> 
> Yes, which is why it belongs in the kernel.

The truth is IMHO more complex than this. I tend to believe that fan
speed control (or more generally thermal management) can be implemented
at different levels. Think about it, it's just like CPU frequency
scaling. You have kernel governors and one user-space governor for
people unhappy about the in-kernel ones and/or for hardware which can't
be supported by these.

Ideally, thermal management would be implemented by the hardware, and
neither the kernel drivers nor user-space should have to care. Less
ideally, the kernel driver has to care, but has enough knowledge to do
this by itself without user intervention. The worse case is where the
kernel doesn't know and the user has to configure everything manually.
This is the case of many PC motherboards out there, for which users
rely on the user-space fancontrol script (or anything similar.) It can
be pretty useful, but I still avoid when I can. And I definitely
wouldn't recommend this approach for GPUs.

So I can envision a similarly layered thermal management logic, where
the kernel drivers take care of what they have to and can handle, and
leave the rest to user-space (as is already the case today.) In other
words, please let me be clear that I have no objection to what Matthew
and Martin are trying to achieve. My objections relate to the
implementation and the way to submit it for review.


-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

  parent reply	other threads:[~2011-02-15 22:07 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-13 12:18 hwmon API update Martin Peres
2011-02-13 12:18 ` [lm-sensors] " Martin Peres
2011-02-13 17:16 ` Guenter Roeck
2011-02-13 17:16   ` [lm-sensors] " Guenter Roeck
2011-02-13 20:00   ` Martin Peres
2011-02-13 20:00     ` [lm-sensors] " Martin Peres
2011-02-13 22:08   ` Jean Delvare
2011-02-13 22:08     ` [lm-sensors] " Jean Delvare
     [not found]     ` <20110213230833.0ee2ff16-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2011-03-03  9:36       ` Dave Airlie
2011-03-03  9:36         ` [lm-sensors] [Nouveau] " Dave Airlie
     [not found]         ` <AANLkTindG=m4FhNS202MH8YVBUCoDEADTQLxo-Bf_8qx-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-03-03 13:09           ` [lm-sensors] " Martin Peres
2011-03-03 13:09             ` [lm-sensors] [Nouveau] " Martin Peres
2011-03-03 15:22         ` Guenter Roeck
2011-03-03 15:22           ` [lm-sensors] " Guenter Roeck
     [not found]           ` <20110303152216.GA21667-IzeFyvvaP7pWk0Htik3J/w@public.gmane.org>
2011-03-03 17:29             ` [lm-sensors] " Martin Peres
2011-03-03 17:29               ` [lm-sensors] [Nouveau] " Martin Peres
     [not found]               ` <4D6FCFF2.7040604-GANU6spQydw@public.gmane.org>
2011-03-03 20:48                 ` [lm-sensors] " Lucas Stach
2011-03-03 20:48                   ` [lm-sensors] [Nouveau] " Lucas Stach
2011-03-03 21:19                   ` Guenter Roeck
2011-03-03 21:19                     ` [lm-sensors] " Guenter Roeck
2011-03-03 21:56                     ` [lm-sensors] " Lucas Stach
2011-03-03 21:56                       ` [lm-sensors] [Nouveau] " Lucas Stach
2011-03-03 22:03                       ` [lm-sensors] " Guenter Roeck
2011-03-03 22:03                         ` [lm-sensors] [Nouveau] " Guenter Roeck
2011-03-03 23:53                         ` [lm-sensors] " Martin Peres
2011-03-03 23:53                           ` [lm-sensors] [Nouveau] " Martin Peres
     [not found]                           ` <4D7029E8.4040706-GANU6spQydw@public.gmane.org>
2011-03-04  0:59                             ` [lm-sensors] " Guenter Roeck
2011-03-04  0:59                               ` [lm-sensors] [Nouveau] " Guenter Roeck
     [not found]                               ` <20110304005900.GB31318-IzeFyvvaP7pWk0Htik3J/w@public.gmane.org>
2011-03-04  8:36                                 ` [lm-sensors] " Martin Peres
2011-03-04  8:36                                   ` [lm-sensors] [Nouveau] " Martin Peres
2011-02-14 16:23 ` [lm-sensors] " Matthew Garrett
2011-02-14 18:19 ` Guenter Roeck
2011-02-14 18:22 ` Matthew Garrett
2011-02-14 19:01 ` Guenter Roeck
2011-02-14 19:05 ` Matthew Garrett
2011-02-14 19:33 ` Guenter Roeck
2011-02-14 19:40 ` Matthew Garrett
2011-02-14 21:25 ` Guenter Roeck
2011-02-14 21:29 ` Matthew Garrett
2011-02-15 21:50 ` Jean Delvare
2011-02-15 22:07 ` Jean Delvare [this message]
2011-02-15 22:23 ` Guenter Roeck
2011-02-28 17:50 ` Lucas Stach
2011-02-28 18:42 ` Guenter Roeck
2011-02-28 23:24 ` Lucas Stach
2011-10-10 22:29 ` Kristen Eisenberg

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=20110215230735.6a52cfb6@endymion.delvare \
    --to=khali@linux-fr.org \
    --cc=lm-sensors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.