Bug 1770

Summary: cooling _mode gives <not supported>
Product: ACPI Reporter: Luming Yu (luming.yu)
Component: Power-ThermalAssignee: Luming Yu (luming.yu)
Status: CLOSED PATCH_ALREADY_AVAILABLE    
Severity: normal CC: acpi-bugzilla
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.4 2.6 Subsystem:
Regression: --- Bisected commit-id:
Attachments: a proposal patch
an update
proposal patch
refined patch
fixed patch

Description Luming Yu 2004-01-01 21:14:32 UTC
Some DSDT don't have _SCP method, which result in
/proc/acpi/thermal*/THM*/cooling _mode gives <not supported>. It's wrong message
to user. Actually, the cooling mode should be Active mode.
Comment 1 Luming Yu 2004-01-01 21:16:26 UTC
Created attachment 1775 [details]
a proposal patch
Comment 2 Luming Yu 2004-01-01 22:36:29 UTC
Created attachment 1776 [details]
an update

OOPS, it should be passive mode
Comment 3 Len Brown 2004-04-14 18:57:55 UTC
please fix syntax so that it matches existing /proc/ file format.
Comment 4 Wang, Zhenyu Z 2004-06-18 01:21:30 UTC
I don't think this patch is right to go.
If _PSV failed, cooling mode is also <not support>.
I think a easy way to do is:
--- linux-2.6.7-rc2/drivers/acpi/thermal.c.orig 2004-06-18 15:48:40.493865544 +0800
+++ linux-2.6.7-rc2/drivers/acpi/thermal.c      2004-06-18 15:49:07.443768536 +0800
@@ -1220,7 +1220,7 @@ acpi_thermal_get_info (
  
        /* Set the cooling mode [_SCP] to active cooling (default) */
        result = acpi_thermal_set_cooling_mode(tz, ACPI_THERMAL_MODE_ACTIVE);
-       if (!result)
+       if (result)
                tz->flags.cooling_mode = 1;
  
        /* Get trip points [_CRT, _PSV, etc.] (required) */

Correct me if i'm wrong.
-zhen
Comment 5 Wang, Zhenyu Z 2004-07-07 20:55:38 UTC
Sorry for my mistake. My patch above is wrong!
I did mistake with tz->cooling_mode and tz->flags.cooling_mode...

For those _SCP is not exist. We should check _ACx and _PSV threshholds,
then tell user the general idea of cooling mode, but no ablity to set it.
Comment 6 Wang, Zhenyu Z 2004-07-07 23:40:23 UTC
Created attachment 3319 [details]
proposal patch 

This patch trys to do properly on reporting cooling_mode to user.
If _SCP is exist, the default cooling_mode is active and every time
after user alter the mode, we should do acpi_thermal_check().
If _SCP is not exist, the patch according with acpi spec 12.2 calculates the
threshholds of _AC and _PSV to get the cooling_mode. 
As _AC and _PSV are optional, if none of
them are exist, the mode will be ACPI_THERMAL_MODE_CRT. Also tell user
that setting cooling mode is not supported.

Pls help to review.

thanks,
-zhen
Comment 7 Wang, Zhenyu Z 2004-07-14 03:46:28 UTC
Created attachment 3351 [details]
refined patch

everytime we change the threshholds, we will check cooling_mode
with latest values.
This patch includes the patch of bug 2588, and changes a little.
Comment 8 Wang, Zhenyu Z 2004-07-14 22:38:19 UTC
Comment on attachment 3351 [details]
refined patch

will re-work on this against current bk tree
Comment 9 Wang, Zhenyu Z 2004-07-15 01:54:55 UTC
Created attachment 3367 [details]
fixed patch

This patch is against current acpi-test-2.6.8 bk tree.
Some content issues of proc are fixed.
Comment 10 Len Brown 2004-11-03 15:43:06 UTC
shipped in Linux-2.4.27 and Linux-2.6.8.1, closing.