From: Borislav Petkov <bp@alien8.de>
To: Peter Feuerer <peter@piie.net>
Cc: Alexander Lam <azl@andrew.cmu.edu>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Andreas Mohr <andi@lisas.de>
Subject: Re: thermal governor: does it actually work??
Date: Sun, 17 Feb 2013 15:09:08 +0100 [thread overview]
Message-ID: <20130217140908.GA20323@pd.tnic> (raw)
In-Reply-To: <cone.1361068993.271211.4532.1000@galar>
On Sun, Feb 17, 2013 at 03:43:13AM +0100, Peter Feuerer wrote:
> Hi Boris, Alex, Andreas,
>
> what do you think about this acerhdf patch?
> I think it makes things straight and implements the two-point regulation of
> acerhdf to be for correctly handled by the thermal layer:
>
>
> From 7b39bd8837de6dc5658ac3e54ac5d4df9d351528 Mon Sep 17 00:00:00 2001
> From: Peter Feuerer <peter@piie.net>
> Date: Sun, 17 Feb 2013 03:29:19 +0100
> Subject: [PATCH] added two more trip points to acerhdf, this allows thermal
> layer to correctly handle the two point regulation of acerhdf. Trip point 0
> will be active from 0 degree to "fanoff" and is marked as passive, then trip
> point 1 is valid from "fanoff" to "fanon" value and is marked as active,
> even if it's only really active in case temperature is going down from trip
> point 2. Trip point 2 will be valid above "fanon" value and is also marked
> as active.
Right, so this is clearly something new in the thermal pile of code. I
still don't understand the big picture all that clearly but whatever...
> ---
> drivers/platform/x86/acerhdf.c | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
> index f94467c..c36633b 100644
> --- a/drivers/platform/x86/acerhdf.c
> +++ b/drivers/platform/x86/acerhdf.c
> @@ -400,6 +400,10 @@ static int acerhdf_get_trip_type(struct thermal_zone_device *thermal, int trip,
> enum thermal_trip_type *type)
> {
> if (trip == 0)
> + *type = THERMAL_TRIP_PASSIVE;
> + if (trip == 1)
> + *type = THERMAL_TRIP_ACTIVE;
> + if (trip == 2)
> *type = THERMAL_TRIP_ACTIVE;
So, digging deep into thermal_sys.c, those naked numbers which we get
handed down for 'trip' are some sort of trip points. Now, I'd very much
like to know what those are and there are no defines what they mean -
code simply iterates over a number of thermal_zone trips - tz->trips -
and we (try to) act accordingly.
Now this is very fragile, IMO.
/me stares at the code a bit more.
Ok, from the looks of it, I'm guessing each driver has to do its own
mapping of what each trip point is, IIUC. And the thermal_zone doodles
over those and for those which the driver has defined, it asks the
driver itself what it wants done (i.e. ->get_trip_temp) and, in our case
it doesn't do anything...
Also, come to think of it, why don't we have THERMAL_TRIP_CRITICAL and
THERMAL_TRIP_HOT trip types?
> return 0;
> @@ -409,6 +413,10 @@ static int acerhdf_get_trip_temp(struct thermal_zone_device *thermal, int trip,
> unsigned long *temp)
> {
> if (trip == 0)
> + *temp = 0;
> + if (trip == 1)
> + *temp = fanoff;
> + if (trip == 2)
> *temp = fanon;
Maybe the critical and hot types need to go here? I.e., 3 and 4?
> return 0;
> @@ -486,7 +494,8 @@ static int acerhdf_set_cur_state(struct thermal_cooling_device *cdev,
> (cur_temp < fanoff))
> acerhdf_change_fanstate(ACERHDF_FAN_OFF);
> } else {
> - if (cur_state == ACERHDF_FAN_OFF)
> + if ((cur_state == ACERHDF_FAN_OFF) &&
> + (cur_temp > fanon))
> acerhdf_change_fanstate(ACERHDF_FAN_AUTO);
... and we hook in into the thermal_cdev_update() call here and do the
correction ourselves.
Oh well. I need to befriend myself with the whole concept of thermal
- still have a bad feeling about it, like a star wars character:
http://www.youtube.com/watch?v=sBknAcTaMiI :-)
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
next prev parent reply other threads:[~2013-02-17 14:09 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-14 15:32 thermal governor: does it actually work?? Andreas Mohr
2013-02-15 9:47 ` Zhang, Rui
2013-02-15 15:49 ` Andreas Mohr
2013-02-16 21:08 ` Alexander Lam
2013-02-16 21:47 ` Borislav Petkov
2013-02-17 2:43 ` Peter Feuerer
2013-02-17 14:09 ` Borislav Petkov [this message]
2013-02-17 15:41 ` Peter Feuerer
2013-02-18 13:50 ` Borislav Petkov
2013-02-18 16:47 ` Peter Feuerer
2013-02-19 14:51 ` Zhang Rui
2013-02-19 15:05 ` Borislav Petkov
2013-02-19 15:27 ` Zhang Rui
[not found] ` <CACWwPisqpmLjiqEh+J2DjnEtNObmmA0w=qMQYTgBsb6Ntad7Pw@mail.gmail.com>
[not found] ` <744357E9AAD1214791ACBA4B0B90926329F98E@SHSMSX101.ccr.corp.intel.com>
[not found] ` <CACWwPit=xxeeCW1+jfxE8eww+P545B5xebh3YT2yE78zcsqSMg@mail.gmail.com>
2013-02-18 20:33 ` Alexander Lam
2013-02-19 14:53 ` Zhang Rui
2013-02-19 15:35 ` Zhang Rui
2013-02-22 5:33 ` Peter Feuerer
2013-02-22 11:15 ` Borislav Petkov
2013-02-23 19:20 ` [PATCH] acerhdf: Fix fan activation with new thermal governor Borislav Petkov
2013-02-24 11:28 ` Borislav Petkov
2013-02-24 11:42 ` Peter Feuerer
2013-02-24 12:09 ` Borislav Petkov
2013-02-24 12:59 ` Borislav Petkov
2013-02-25 3:06 ` Zhang Rui
2013-02-25 10:20 ` Borislav Petkov
2013-02-25 10:36 ` Peter Feuerer
2013-02-24 14:34 ` Borislav Petkov
2013-02-25 3:21 ` Zhang Rui
2013-02-25 10:25 ` Borislav Petkov
2013-02-25 12:16 ` Borislav Petkov
2013-03-04 13:34 ` Borislav Petkov
2013-03-04 19:25 ` Andreas Mohr
2013-03-05 21:59 ` Andreas Mohr
2013-03-06 3:47 ` Zhang Rui
2013-03-06 7:00 ` Borislav Petkov
2013-03-06 7:30 ` Zhang Rui
2013-03-06 7:36 ` Borislav Petkov
2013-03-07 20:17 ` Peter Feuerer
2013-03-07 20:27 ` Borislav Petkov
2013-02-25 3:01 ` Zhang Rui
2013-02-25 2:58 ` Zhang Rui
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=20130217140908.GA20323@pd.tnic \
--to=bp@alien8.de \
--cc=andi@lisas.de \
--cc=azl@andrew.cmu.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=peter@piie.net \
/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