Bugzilla – Attachment 49676 Details for
Bug 98178
thermal management not working
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
thermal fix
thermal_fix.diff (text/plain), 4.93 KB, created by
Dirk Mueller
on 2005-09-12 19:41:42 UTC
(
hide
)
Description:
thermal fix
Filename:
MIME Type:
Creator:
Dirk Mueller
Created:
2005-09-12 19:41:42 UTC
Size:
4.93 KB
patch
obsolete
>--- processor_thermal.c.orig 2005-09-09 00:20:15.000000000 +0200 >+++ processor_thermal.c 2005-09-09 01:51:26.000000000 +0200 >@@ -116,6 +116,12 @@ > } > > >+/* returns 0 if it was able to set a higher limit and >+ another call will also succeed >+ returns 1 if it was able to set a higher limit but >+ no further limit possible >+ returns < 0 otherwise >+*/ > static int acpi_thermal_cpufreq_increase(unsigned int cpu) > { > if (!cpu_has_cpufreq(cpu)) >@@ -123,14 +129,26 @@ > > if (cpufreq_thermal_reduction_pctg[cpu] < 60) { > cpufreq_thermal_reduction_pctg[cpu] += 20; >+ >+ if( cpufreq_thermal_reduction_pctg[cpu] >= 60) >+ cpufreq_thermal_reduction_pctg[ cpu ] = 80; >+ > cpufreq_update_policy(cpu); >+ >+ if( cpufreq_thermal_reduction_pctg[cpu] >= 60) >+ return 1; > return 0; > } > > return -ERANGE; > } > >- >+/* returns 0 if it was able to set a higher limit and >+ another call will also succeed >+ returns 1 if it was able to set a higher limit but >+ no further limit possible >+ returns < 0 otherwise >+*/ > static int acpi_thermal_cpufreq_decrease(unsigned int cpu) > { > if (!cpu_has_cpufreq(cpu)) >@@ -138,8 +156,14 @@ > > if (cpufreq_thermal_reduction_pctg[cpu] >= 20) { > cpufreq_thermal_reduction_pctg[cpu] -= 20; >+ if ( cpufreq_thermal_reduction_pctg[cpu] < 20 ) >+ cpufreq_thermal_reduction_pctg[ cpu ] = 0; >+ > cpufreq_update_policy(cpu); >- return 0; >+ >+ if ( cpufreq_thermal_reduction_pctg[cpu] < 20 ) >+ return 1; >+ return 0; > } > > return -ERANGE; >@@ -238,6 +262,7 @@ > case ACPI_PROCESSOR_LIMIT_NONE: > do { > result = acpi_thermal_cpufreq_decrease(pr->id); >+ /* result == 0 means: was able to decrease and further decrease possible */ > } while (!result); > tx = 0; > break; >@@ -245,9 +270,11 @@ > case ACPI_PROCESSOR_LIMIT_INCREMENT: > /* if going up: P-states first, T-states later */ > >+ printk(KERN_INFO "throttling: %d\n", pr->flags.throttling); > result = acpi_thermal_cpufreq_increase(pr->id); >- if (!result) >- goto end; >+ printk(KERN_INFO "limit_increment: result: %d\n", result); >+ if (result >= 0) >+ return_VALUE(result); > else if (result == -ERANGE) > ACPI_DEBUG_PRINT((ACPI_DB_INFO, > "At maximum performance state\n")); >@@ -263,6 +290,7 @@ > > case ACPI_PROCESSOR_LIMIT_DECREMENT: > /* if going down: T-states first, P-states later */ >+ printk(KERN_INFO "throttling: %d\n", pr->flags.throttling); > > if (pr->flags.throttling) { > if (tx == 0) >@@ -275,9 +303,13 @@ > } > > result = acpi_thermal_cpufreq_decrease(pr->id); >- if (result == -ERANGE) >- ACPI_DEBUG_PRINT((ACPI_DB_INFO, >- "At minimum performance state\n")); >+ >+ printk(KERN_INFO "limit_decrement: result: %d\n", result); >+ if (result != 0) >+ printk(KERN_INFO >+ "At minimum performance state\n"); >+ if ( result ) >+ return_VALUE(result); > > break; > } >@@ -295,8 +327,9 @@ > ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Thermal limit now (P%d:T%d)\n", > pr->limit.thermal.px, > pr->limit.thermal.tx)); >- } else >- result = 0; >+ } >+ >+ printk(KERN_INFO "doing return %d\n", result); > > return_VALUE(result); > } >--- thermal.c.orig 2005-09-09 00:53:36.000000000 +0200 >+++ thermal.c 2005-09-09 01:41:34.000000000 +0200 >@@ -535,11 +535,11 @@ > */ > if (tz->temperature >= passive->temperature) { > trend = (passive->tc1 * (tz->temperature - tz->last_temperature)) + (passive->tc2 * (tz->temperature - passive->temperature)); >- ACPI_DEBUG_PRINT((ACPI_DB_INFO, >+ printk(KERN_INFO > "trend[%d]=(tc1[%lu]*(tmp[%lu]-last[%lu]))+(tc2[%lu]*(tmp[%lu]-psv[%lu]))\n", > trend, passive->tc1, tz->temperature, > tz->last_temperature, passive->tc2, >- tz->temperature, passive->temperature)); >+ tz->temperature, passive->temperature); > tz->trips.passive.flags.enabled = 1; > /* Heating up? */ > if (trend > 0) >@@ -563,12 +563,17 @@ > * assume symmetry. > */ > else if (tz->trips.passive.flags.enabled) { >- for (i=0; i<passive->devices.count; i++) >- result = acpi_processor_set_thermal_limit( >+ int result = 1; >+ for (i=0; i<passive->devices.count; i++) { >+ int ret = acpi_processor_set_thermal_limit( > passive->devices.handles[i], > ACPI_PROCESSOR_LIMIT_DECREMENT); >+ result &= ret; >+ printk(KERN_INFO "decrementing passive limit, ret: %d result: %d\n", ret, result); >+ } > if (result == 1) { > tz->trips.passive.flags.enabled = 0; >+ printk(KERN_INFO "disabling passive cooling\n"); > ACPI_DEBUG_PRINT((ACPI_DB_INFO, > "Disabling passive cooling (zone is cool)\n")); > } >@@ -744,8 +749,8 @@ > else if (tz->polling_frequency > 0) > sleep_time = tz->polling_frequency * 100; > >- ACPI_DEBUG_PRINT((ACPI_DB_INFO, "%s: temperature[%lu] sleep[%lu]\n", >- tz->name, tz->temperature, sleep_time)); >+ printk(KERN_INFO "%s: temperature[%lu] sleep[%lu] passive state: %d\n", >+ tz->name, tz->temperature, sleep_time,tz->state.passive); > > /* > * Schedule Next Poll
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