public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thermal active cooling step
@ 2004-05-28  5:23 Wang, Zhenyu Z
       [not found] ` <6E0C289723A0564F9A8279E236E8565F078052FF-4yWAQGcml64divtuJNk2fFDQ4js95KgL@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Wang, Zhenyu Z @ 2004-05-28  5:23 UTC (permalink / raw)
  To: Brown, Len, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: Yu, Luming, Li, Shaohua, Qiang, Mike, Zhu, Yi

[-- Attachment #1: Type: text/plain, Size: 640 bytes --]

Hi,

I have a question about thermal active cooling process that we do 
in acpi_thermal_active. 
For example, if _AC0 is lower than current temperature, we set maxtemp
to _AC0's temperature then turn it on. Next step is checking _AC1, if
_AC1 
is also lower than current, we turn it on by ignore maxtemp in current
code.

According to the Spec, _AC0 should be greater than _AC1's cooling
strength.
(If two fans are in system, AC0 includes both two and AC1 may include
one of them)
So i think the variable maxtemp seems not be used properly here.

Pls, see my patch attached. And correct me if I am wrong.

thanks,
-zhen

[-- Attachment #2: tz_active.patch --]
[-- Type: application/octet-stream, Size: 733 bytes --]

--- linux-2.6.6-acpi/drivers/acpi/thermal.c.orig	2004-05-28 11:18:46.426467912 +0800
+++ linux-2.6.6-acpi/drivers/acpi/thermal.c	2004-05-28 11:41:55.477300088 +0800
@@ -603,7 +603,7 @@ acpi_thermal_active (
 		 * associated with this active threshold.
 		 */
 		if (tz->temperature >= active->temperature) {
-			if (active->temperature > maxtemp)
+			if (active->temperature > maxtemp){
 				tz->state.active_index = i, maxtemp = active->temperature;
 			if (!active->flags.enabled) {
 				for (j = 0; j < active->devices.count; j++) {
@@ -616,6 +616,7 @@ acpi_thermal_active (
 					ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Cooling device [%p] now 'on'\n", active->devices.handles[j]));
 				}
 			}
+			}
 		}
 		/*
 		 * Below Threshold?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] thermal active cooling step
       [not found] ` <6E0C289723A0564F9A8279E236E8565F078052FF-4yWAQGcml64divtuJNk2fFDQ4js95KgL@public.gmane.org>
@ 2004-06-22 17:37   ` Pavel Machek
  0 siblings, 0 replies; 5+ messages in thread
From: Pavel Machek @ 2004-06-22 17:37 UTC (permalink / raw)
  To: Wang, Zhenyu Z
  Cc: Brown, Len, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	Yu, Luming, Li, Shaohua, Qiang, Mike, Zhu, Yi

Hi!

> I have a question about thermal active cooling process that we do 
> in acpi_thermal_active. 
> For example, if _AC0 is lower than current temperature, we set maxtemp
> to _AC0's temperature then turn it on. Next step is checking _AC1, if
> _AC1 
> is also lower than current, we turn it on by ignore maxtemp in current
> code.
> 
> According to the Spec, _AC0 should be greater than _AC1's cooling
> strength.
> (If two fans are in system, AC0 includes both two and AC1 may include
> one of them)
> So i think the variable maxtemp seems not be used properly here.
> 
> Pls, see my patch attached. And correct me if I am wrong.

At least indentation is very wrong. Plus please include patches in the
text, *not* as attachments.
								Pavel

-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] thermal active cooling step
@ 2004-06-23  1:51 Wang, Zhenyu Z
       [not found] ` <6E0C289723A0564F9A8279E236E8565F07A55409-4yWAQGcml64divtuJNk2fFDQ4js95KgL@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Wang, Zhenyu Z @ 2004-06-23  1:51 UTC (permalink / raw)
  To: Pavel Machek; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Fine. Resend patch below.

-zhen


--- linux-2.6.7/drivers/acpi/thermal.c.orig     2004-06-23 09:16:13.360411712 +0800
+++ linux-2.6.7/drivers/acpi/thermal.c  2004-06-23 09:17:51.985418432 +0800
@@ -610,7 +610,7 @@ acpi_thermal_active (
                 * associated with this active threshold.
                 */
                if (tz->temperature >= active->temperature) {
-                       if (active->temperature > maxtemp)
+                       if (active->temperature > maxtemp){
                                tz->state.active_index = i, maxtemp = active->temperature;
                        if (!active->flags.enabled) {
                                for (j = 0; j < active->devices.count; j++) {
@@ -623,6 +623,7 @@ acpi_thermal_active (
                                        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Cooling device [%p] now 'on'\n", active->devices.handles[j]));
                                }
                        }
+                       }
                }
                /*
                 * Below Threshold? 

-----Original Message-----
From: acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org [mailto:acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Pavel Machek
Sent: 2004年6月23日 1:37
To: Wang, Zhenyu Z
Cc: Brown, Len; acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org; Yu, Luming; Li, Shaohua; Qiang, Mike; Zhu, Yi
Subject: Re: [ACPI] [PATCH] thermal active cooling step

Hi!

> I have a question about thermal active cooling process that we do 
> in acpi_thermal_active. 
> For example, if _AC0 is lower than current temperature, we set maxtemp
> to _AC0's temperature then turn it on. Next step is checking _AC1, if
> _AC1 
> is also lower than current, we turn it on by ignore maxtemp in current
> code.
> 
> According to the Spec, _AC0 should be greater than _AC1's cooling
> strength.
> (If two fans are in system, AC0 includes both two and AC1 may include
> one of them)
> So i think the variable maxtemp seems not be used properly here.
> 
> Pls, see my patch attached. And correct me if I am wrong.

At least indentation is very wrong. Plus please include patches in the
text, *not* as attachments.
								Pavel

-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Acpi-devel mailing list
Acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/acpi-devel



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] thermal active cooling step
       [not found] ` <6E0C289723A0564F9A8279E236E8565F07A55409-4yWAQGcml64divtuJNk2fFDQ4js95KgL@public.gmane.org>
@ 2004-06-23  9:25   ` Pavel Machek
  0 siblings, 0 replies; 5+ messages in thread
From: Pavel Machek @ 2004-06-23  9:25 UTC (permalink / raw)
  To: Wang, Zhenyu Z; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hi!

> Fine. Resend patch below.
> 
> -zhen
> 
> 
> --- linux-2.6.7/drivers/acpi/thermal.c.orig     2004-06-23 09:16:13.360411712 +0800
> +++ linux-2.6.7/drivers/acpi/thermal.c  2004-06-23 09:17:51.985418432 +0800
> @@ -610,7 +610,7 @@ acpi_thermal_active (
>                  * associated with this active threshold.
>                  */
>                 if (tz->temperature >= active->temperature) {
> -                       if (active->temperature > maxtemp)
> +                       if (active->temperature > maxtemp){

Put space between ) and {

>                                 tz->state.active_index = i, maxtemp = active->temperature;
>                         if (!active->flags.enabled) {
>                                 for (j = 0; j < active->devices.count; j++) {
> @@ -623,6 +623,7 @@ acpi_thermal_active (
>                                         ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Cooling device [%p] now 'on'\n", active->devices.handles[j]));
>                                 }
>                         }

This whole block needs to be moved one tab to the right...

> +                       }

-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] thermal active cooling step
@ 2004-06-23  9:36 Wang, Zhenyu Z
  0 siblings, 0 replies; 5+ messages in thread
From: Wang, Zhenyu Z @ 2004-06-23  9:36 UTC (permalink / raw)
  To: Pavel Machek; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Corrected.

--- linux-2.6.7/drivers/acpi/thermal.c.orig     2004-06-23 17:00:50.986368384 +0800
+++ linux-2.6.7/drivers/acpi/thermal.c  2004-06-23 17:03:25.687850184 +0800
@@ -610,17 +610,18 @@ acpi_thermal_active (
                 * associated with this active threshold.
                 */
                if (tz->temperature >= active->temperature) {
-                       if (active->temperature > maxtemp)
+                       if (active->temperature > maxtemp) {
                                tz->state.active_index = i, maxtemp = active->temperature;
-                       if (!active->flags.enabled) {
-                               for (j = 0; j < active->devices.count; j++) {
-                                       result = acpi_bus_set_power(active->devices.handles[j], ACPI
_STATE_D0);
-                                       if (result) {
-                                               ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Unable to turn cool
ing device [%p] 'on'\n", active->devices.handles[j]));
-                                               continue;
+                               if (!active->flags.enabled) {
+                                       for (j = 0; j < active->devices.count; j++) {
+                                               result = acpi_bus_set_power(active->devices.handles[
j], ACPI_STATE_D0);
+                                               if (result) {
+                                                       ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Unable to t
urn cooling device [%p] 'on'\n", active->devices.handles[j]));
+                                                       continue;
+                                               }
+                                               active->flags.enabled = 1;
+                                               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Cooling device [%p]
 now 'on'\n", active->devices.handles[j]));
                                        }
-                                       active->flags.enabled = 1;
-                                       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Cooling device [%p] now 'on
'\n", active->devices.handles[j]));
                                }
                        }
                } 


-----Original Message-----
From: Pavel Machek [mailto:pavel-+ZI9xUNit7I@public.gmane.org] 
Sent: 2004年6月23日 17:26
To: Wang, Zhenyu Z
Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [ACPI] [PATCH] thermal active cooling step

Hi!

> Fine. Resend patch below.
> 
> -zhen
> 
> 
> --- linux-2.6.7/drivers/acpi/thermal.c.orig     2004-06-23 09:16:13.360411712 +0800
> +++ linux-2.6.7/drivers/acpi/thermal.c  2004-06-23 09:17:51.985418432 +0800
> @@ -610,7 +610,7 @@ acpi_thermal_active (
>                  * associated with this active threshold.
>                  */
>                 if (tz->temperature >= active->temperature) {
> -                       if (active->temperature > maxtemp)
> +                       if (active->temperature > maxtemp){

Put space between ) and {

>                                 tz->state.active_index = i, maxtemp = active->temperature;
>                         if (!active->flags.enabled) {
>                                 for (j = 0; j < active->devices.count; j++) {
> @@ -623,6 +623,7 @@ acpi_thermal_active (
>                                         ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Cooling device [%p] now 'on'\n", active->devices.handles[j]));
>                                 }
>                         }

This whole block needs to be moved one tab to the right...

> +                       }

-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-06-23  9:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-23  1:51 [PATCH] thermal active cooling step Wang, Zhenyu Z
     [not found] ` <6E0C289723A0564F9A8279E236E8565F07A55409-4yWAQGcml64divtuJNk2fFDQ4js95KgL@public.gmane.org>
2004-06-23  9:25   ` Pavel Machek
  -- strict thread matches above, loose matches on Subject: below --
2004-06-23  9:36 Wang, Zhenyu Z
2004-05-28  5:23 Wang, Zhenyu Z
     [not found] ` <6E0C289723A0564F9A8279E236E8565F078052FF-4yWAQGcml64divtuJNk2fFDQ4js95KgL@public.gmane.org>
2004-06-22 17:37   ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox