|
Lines 199-205
Link Here
|
| 199 |
|
199 |
|
| 200 |
#endif |
200 |
#endif |
| 201 |
|
201 |
|
| 202 |
|
202 |
/** |
|
|
203 |
* acpi_processor_set_thermal_limit - |
| 204 |
* @handle: device handler |
| 205 |
* @type: limit inc/dec |
| 206 |
* |
| 207 |
* routine returns 0 when setting limit successfully, especial |
| 208 |
* return value 1 tells thermal module that minimum state is reached, |
| 209 |
* so we can leave passive thermal mode. |
| 210 |
*/ |
| 203 |
int |
211 |
int |
| 204 |
acpi_processor_set_thermal_limit ( |
212 |
acpi_processor_set_thermal_limit ( |
| 205 |
acpi_handle handle, |
213 |
acpi_handle handle, |
|
Lines 249-275
Link Here
|
| 249 |
|
257 |
|
| 250 |
result = acpi_thermal_cpufreq_increase(pr->id); |
258 |
result = acpi_thermal_cpufreq_increase(pr->id); |
| 251 |
if (!result) |
259 |
if (!result) |
|
|
260 |
// Handle error case properly, we need to return |
| 261 |
// 1 if we are at max freq/thrott again |
| 252 |
goto end; |
262 |
goto end; |
| 253 |
else if (result == -ERANGE) |
263 |
|
|
|
264 |
else if (result == -ERANGE){ |
| 254 |
ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
265 |
ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
| 255 |
"At maximum performance state\n")); |
266 |
"At maximum performance state\n")); |
|
|
267 |
result = 1; |
| 268 |
} |
| 256 |
|
269 |
|
| 257 |
if (pr->flags.throttling) { |
270 |
if (pr->flags.throttling) { |
| 258 |
if (tx == (pr->throttling.state_count - 1)) |
271 |
if (tx == (pr->throttling.state_count - 1)) |
| 259 |
ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
272 |
ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
| 260 |
"At maximum throttling state\n")); |
273 |
"At maximum throttling state\n")); |
| 261 |
else |
274 |
else{ |
| 262 |
tx++; |
275 |
tx++; |
|
|
276 |
result = 0; |
| 277 |
} |
| 263 |
} |
278 |
} |
|
|
279 |
// TX and PX are at maximum again. |
| 280 |
// Tell invoking func -> we can leave passive cooling mode now |
| 281 |
if (result) |
| 282 |
return_VALUE(1); |
| 283 |
|
| 264 |
break; |
284 |
break; |
| 265 |
|
285 |
|
| 266 |
case ACPI_PROCESSOR_LIMIT_DECREMENT: |
286 |
case ACPI_PROCESSOR_LIMIT_DECREMENT: |
| 267 |
/* if going down: T-states first, P-states later */ |
287 |
/* if going down: T-states first, P-states later */ |
| 268 |
|
288 |
|
| 269 |
if (pr->flags.throttling) { |
289 |
if (pr->flags.throttling) { |
| 270 |
if (tx == 0) |
290 |
if (tx == 0) { |
| 271 |
ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
291 |
ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
| 272 |
"At minimum throttling state\n")); |
292 |
"At minimum throttling state\n")); |
|
|
293 |
} |
| 273 |
else { |
294 |
else { |
| 274 |
tx--; |
295 |
tx--; |
| 275 |
goto end; |
296 |
goto end; |