public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
To: "Zhang, Rui" <rui.zhang@intel.com>
Cc: Hans de Goede <j.w.r.degoede@hhs.nl>,
	Matthew Garrett <mjg59@srcf.ucam.org>,
	linux-acpi@vger.kernel.org, "Thomas,
	Sujith" <sujith.thomas@intel.com>,
	Richard Hughes <hughsient@gmail.com>,
	lm-sensors@lm-sensors.org,
	"Mark M. Hoffman" <mhoffman@lightlink.com>,
	Thomas Renninger <trenn@suse.de>, Len Brown <lenb@kernel.org>
Subject: Re: [lm-sensors] The new thermal management sysfs class, and hwmon
Date: Sat, 23 Feb 2008 17:39:53 -0300	[thread overview]
Message-ID: <20080223203953.GC5123@khazad-dum.debian.net> (raw)
In-Reply-To: <1203669206.3210.68.camel@localhost.localdomain>

On Fri, 22 Feb 2008, Zhang, Rui wrote:
> pwm[1-*]_enable = 1 : manual fan control (using pwm[1-*])
> 		  2+: automatic fan control (by acpi thermal driver)

And pwm[1-*]_enable = 0 should try to bump the fan to the fasted speed
possible, BTW.  This is not very obvious :-)

Many hwmon devices already have a function assigned to lower values of
pwm_enable.  I suggest we define a static (high) value to the generic
software-based kernel-mode fan controllers (of which, ACPI thermal
management is the first one), so that the software-based fan-controllers can
control generic fans too.

say, reserve bits 7,6 and 5 to select the fan controller class:
 000 - 
     000 00000: disabled (fan at top speed)
     000 00001: manual pwm control
     000 001xx: device specific hw or sw strategies
     000 01xxx: reserved for future use
     000 1xxxx: reserved for future use

 001 -
     001 00000: ACPI thermal management controller
     001 00001: (foobar thermal management controller)
     ...

 01x - reserved for future use.
 1xx - reserved for future use.

Or something like that.  Note that the above is, AFAIK, fully backwards
compatible with all current hwmon devices.

> Yes, it can work for ACPI fan although I don't think the existing pwm
> hwmon I/F maps well to what we need and it seems like a "forced fit" to
> use it. Any better ideas? :)

Sure: we add a new "view" of the pwm controller.  hwmon drivers are allowed
to export either one or both.  If they export both, however, they MUST be
kept in complete sync.  Most hwmon devices will export either, but not both.
Stuff like thinkpad-acpi that is already complex enough anyway, can go
through the pain of providing both and keeping them in sync.

The new "view" could well use the ACPI thermal management idea, which is
nicely generic (if a bit less powerful) than hwmon's current view, and you
could very easily convert the current thermal management stuff to it.
Here's a proposal:

pwm[1-*]_max_level (RO):
   Maximum valid level for pwm[1-*]_level

pwm[1-*]_level (RO/RW):
   Alternate view of pwm[1-*].  0 means off. 1-pwm[1-*]_max_level means
   active.  The higher the level, the higher the speed.

However, that would only make sense for fans.  Using the pwm model to
control generic cooling properties of devices doesn't work well.

I propose we add an alternate "cooling power" set of attributes.  Fans could
use either one, or even both (as long as they are kept in sync):

cooling_mode (RO/RW):
   0 = disabled (no extra cooling effort)
   1 = manual
   2.. (same as pwm_enable)

   Note that this does NOT have the same behaviour of pwm_enable=0!

cooling[1-*]_max_level (RO):
   maximum cooling effort level available

cooling[1-*]_level (RW/RO):
   0 = no extra cooling
   1 = cooling effort level 1
   ...

   Increasing the cooling effort level, increases the cooling effect of the
   device (might mean downclocking buses at higher levels, etc).

I propose this, because it is actually a damn nice way to deal with fans in
most Linux platforms, as they are used only for cooling.  It has clearly
conceptual advantages over the pwm model we have right now.  And it could
be easily used by the ACPI thermal management stuff.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

  parent reply	other threads:[~2008-02-23 20:39 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-03  2:26 The new thermal management sysfs class, and hwmon Henrique de Moraes Holschuh
2008-02-03  9:31 ` Zhang Rui
2008-02-03 16:44   ` Mark M. Hoffman
2008-02-03 17:50     ` Henrique de Moraes Holschuh
2008-02-05 10:14       ` Thomas, Sujith
2008-02-05 13:57         ` Mark M. Hoffman
2008-02-05 14:55           ` [lm-sensors] " Henrique de Moraes Holschuh
2008-02-07  7:01             ` Len Brown
2008-02-07 12:30               ` Henrique de Moraes Holschuh
2008-02-06  5:23           ` Thomas, Sujith
2008-02-13 15:10             ` Thomas Renninger
2008-02-14 14:08               ` Matthew Garrett
2008-02-15 11:04                 ` Thomas, Sujith
2008-02-15 11:56                   ` Matthew Garrett
2008-02-15 12:19                     ` [lm-sensors] " Henrique de Moraes Holschuh
2008-02-22  5:47                 ` zhangrui
2008-02-22  8:00                   ` [lm-sensors] " Hans de Goede
2008-02-22  8:33                     ` Zhang, Rui
2008-02-22 10:54                       ` Hans de Goede
2008-02-23  7:43                         ` Len Brown
2008-02-23  8:29                         ` Jean Delvare
2008-02-24 22:52                           ` Zhang, Rui
2008-02-25  8:53                             ` Hans de Goede
2008-02-23 20:39                       ` Henrique de Moraes Holschuh [this message]
2008-02-07  6:41       ` Len Brown

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=20080223203953.GC5123@khazad-dum.debian.net \
    --to=hmh@hmh.eng.br \
    --cc=hughsient@gmail.com \
    --cc=j.w.r.degoede@hhs.nl \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=mhoffman@lightlink.com \
    --cc=mjg59@srcf.ucam.org \
    --cc=rui.zhang@intel.com \
    --cc=sujith.thomas@intel.com \
    --cc=trenn@suse.de \
    /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