Bugzilla – Attachment 49094 Details for
Bug 98178
thermal management not working
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
fix passive cooling mode
fix_passive_cooling.diff (text/plain), 3.07 KB, created by
Thomas Renninger
on 2005-09-07 17:09:34 UTC
(
hide
)
Description:
fix passive cooling mode
Filename:
MIME Type:
Creator:
Thomas Renninger
Created:
2005-09-07 17:09:34 UTC
Size:
3.07 KB
patch
obsolete
>--- drivers/acpi/thermal.c.orig 2005-09-07 10:53:59.000000000 -0600 >+++ drivers/acpi/thermal.c 2005-09-07 10:54:05.000000000 -0600 >@@ -519,7 +519,7 @@ > int result = 0; > struct acpi_thermal_passive *passive = NULL; > int trend = 0; >- int i = 0; >+ int i = 0, ret; > > ACPI_FUNCTION_TRACE("acpi_thermal_passive"); > >@@ -565,10 +565,18 @@ > * assume symmetry. > */ > else if (tz->trips.passive.flags.enabled) { >- for (i=0; i<passive->devices.count; i++) >- result = acpi_processor_set_thermal_limit( >+ result = 1; >+ for (i=0; i<passive->devices.count; i++) { >+ ret = acpi_processor_set_thermal_limit( > passive->devices.handles[i], > ACPI_PROCESSOR_LIMIT_DECREMENT); >+ if(ret < 0) { >+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR, >+ "Can't use passive device 0x%x to set thermal limit\n", >+ passive->devices.handles[i])); >+ } else >+ result &= ret; >+ } > if (result == 1) { > tz->trips.passive.flags.enabled = 0; > ACPI_DEBUG_PRINT((ACPI_DB_INFO, >@@ -724,13 +732,23 @@ > */ > if (tz->trips.critical.flags.enabled) > tz->state.critical = 1; >+ else >+ tz->state.critical = 0; > if (tz->trips.hot.flags.enabled) > tz->state.hot = 1; >+ else >+ tz->state.hot = 0; > if (tz->trips.passive.flags.enabled) > tz->state.passive = 1; >+ else >+ tz->state.passive = 0; > for (i=0; i<ACPI_THERMAL_MAX_ACTIVE; i++) >- if (tz->trips.active[i].flags.enabled) >- tz->state.active = 1; >+ if (tz->trips.active[i].flags.enabled) { >+ tz->state.active = 1; break; >+ } >+ if ( i == ACPI_THERMAL_MAX_ACTIVE ) >+ tz->state.active = 0; >+ > > /* > * Calculate Sleep Time > >--- drivers/acpi/processor_thermal.c.orig 2005-09-07 10:53:59.000000000 -0600 >+++ drivers/acpi/processor_thermal.c 2005-09-07 11:07:05.000000000 -0600 >@@ -199,7 +199,15 @@ > > #endif > >- >+/** >+ * acpi_processor_set_thermal_limit - >+ * @handle: device handler >+ * @type: limit inc/dec >+ * >+ * routine returns 0 when setting limit successfully, especial >+ * return value 1 tells thermal module that minimum state is reached, >+ * so we can leave passive thermal mode. >+ */ > int > acpi_processor_set_thermal_limit ( > acpi_handle handle, >@@ -249,27 +257,40 @@ > > result = acpi_thermal_cpufreq_increase(pr->id); > if (!result) >+ // Handle error case properly, we need to return >+ // 1 if we are at max freq/thrott again > goto end; >- else if (result == -ERANGE) >+ >+ else if (result == -ERANGE){ > ACPI_DEBUG_PRINT((ACPI_DB_INFO, > "At maximum performance state\n")); >+ result = 1; >+ } > > if (pr->flags.throttling) { > if (tx == (pr->throttling.state_count - 1)) > ACPI_DEBUG_PRINT((ACPI_DB_INFO, > "At maximum throttling state\n")); >- else >+ else{ > tx++; >+ result = 0; >+ } > } >+ // TX and PX are at maximum again. >+ // Tell invoking func -> we can leave passive cooling mode now >+ if (result) >+ return_VALUE(1); >+ > break; > > case ACPI_PROCESSOR_LIMIT_DECREMENT: > /* if going down: T-states first, P-states later */ > > if (pr->flags.throttling) { >- if (tx == 0) >+ if (tx == 0) { > ACPI_DEBUG_PRINT((ACPI_DB_INFO, > "At minimum throttling state\n")); >+ } > else { > tx--; > goto end;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 98178
: 49094 |
49594
|
49676