|
Lines 516-522
Link Here
|
| 516 |
acpi_thermal_passive ( |
516 |
acpi_thermal_passive ( |
| 517 |
struct acpi_thermal *tz) |
517 |
struct acpi_thermal *tz) |
| 518 |
{ |
518 |
{ |
| 519 |
int result = 0; |
519 |
int result = 1; |
| 520 |
struct acpi_thermal_passive *passive = NULL; |
520 |
struct acpi_thermal_passive *passive = NULL; |
| 521 |
int trend = 0; |
521 |
int trend = 0; |
| 522 |
int i = 0; |
522 |
int i = 0; |
|
Lines 542-548
Link Here
|
| 542 |
trend, passive->tc1, tz->temperature, |
542 |
trend, passive->tc1, tz->temperature, |
| 543 |
tz->last_temperature, passive->tc2, |
543 |
tz->last_temperature, passive->tc2, |
| 544 |
tz->temperature, passive->temperature)); |
544 |
tz->temperature, passive->temperature)); |
| 545 |
tz->trips.passive.flags.enabled = 1; |
545 |
passive->flags.enabled = 1; |
| 546 |
/* Heating up? */ |
546 |
/* Heating up? */ |
| 547 |
if (trend > 0) |
547 |
if (trend > 0) |
| 548 |
for (i=0; i<passive->devices.count; i++) |
548 |
for (i=0; i<passive->devices.count; i++) |
|
Lines 552-560
Link Here
|
| 552 |
/* Cooling off? */ |
552 |
/* Cooling off? */ |
| 553 |
else if (trend < 0) |
553 |
else if (trend < 0) |
| 554 |
for (i=0; i<passive->devices.count; i++) |
554 |
for (i=0; i<passive->devices.count; i++) |
| 555 |
acpi_processor_set_thermal_limit( |
555 |
// assume that we are on highest freq/lowest thrott |
| 556 |
passive->devices.handles[i], |
556 |
// and can leave passive mode, even in error case |
| 557 |
ACPI_PROCESSOR_LIMIT_DECREMENT); |
557 |
if (!acpi_processor_set_thermal_limit( |
|
|
558 |
passive->devices.handles[i], |
| 559 |
ACPI_PROCESSOR_LIMIT_DECREMENT)) |
| 560 |
result = 0; |
| 561 |
// Leave cooling mode, even we the temp might higher than trip point. |
| 562 |
// This is because some machines might have long thermal polling frequencies |
| 563 |
// (tsp) defined. We will fall back into passive mode in next cycle (probably quicker) |
| 564 |
if (result){ |
| 565 |
passive->flags.enabled = 0; |
| 566 |
ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
| 567 |
"Disabling passive cooling, still above threshold, but we cooled down\n")); |
| 568 |
} |
| 558 |
} |
569 |
} |
| 559 |
|
570 |
|
| 560 |
/* |
571 |
/* |
|
Lines 564-576
Link Here
|
| 564 |
* and avoid thrashing around the passive trip point. Note that we |
575 |
* and avoid thrashing around the passive trip point. Note that we |
| 565 |
* assume symmetry. |
576 |
* assume symmetry. |
| 566 |
*/ |
577 |
*/ |
| 567 |
else if (tz->trips.passive.flags.enabled) { |
578 |
else if (passive->flags.enabled) { |
| 568 |
for (i=0; i<passive->devices.count; i++) |
579 |
for (i=0; i<passive->devices.count; i++) |
| 569 |
result = acpi_processor_set_thermal_limit( |
580 |
if (!acpi_processor_set_thermal_limit( |
| 570 |
passive->devices.handles[i], |
581 |
passive->devices.handles[i], |
| 571 |
ACPI_PROCESSOR_LIMIT_DECREMENT); |
582 |
ACPI_PROCESSOR_LIMIT_DECREMENT)) |
| 572 |
if (result == 1) { |
583 |
result = 0; |
| 573 |
tz->trips.passive.flags.enabled = 0; |
584 |
if (result) { |
|
|
585 |
passive->flags.enabled = 0; |
| 574 |
ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
586 |
ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
| 575 |
"Disabling passive cooling (zone is cool)\n")); |
587 |
"Disabling passive cooling (zone is cool)\n")); |
| 576 |
} |
588 |
} |
|
Lines 722-736
Link Here
|
| 722 |
* Again, separated from the above two to allow independent policy |
734 |
* Again, separated from the above two to allow independent policy |
| 723 |
* decisions. |
735 |
* decisions. |
| 724 |
*/ |
736 |
*/ |
| 725 |
if (tz->trips.critical.flags.enabled) |
737 |
tz->state.critical = tz->trips.critical.flags.enabled; |
| 726 |
tz->state.critical = 1; |
738 |
tz->state.hot = tz->trips.hot.flags.enabled; |
| 727 |
if (tz->trips.hot.flags.enabled) |
739 |
tz->state.passive = tz->trips.passive.flags.enabled; |
| 728 |
tz->state.hot = 1; |
740 |
tz->state.active = 0; |
| 729 |
if (tz->trips.passive.flags.enabled) |
|
|
| 730 |
tz->state.passive = 1; |
| 731 |
for (i=0; i<ACPI_THERMAL_MAX_ACTIVE; i++) |
741 |
for (i=0; i<ACPI_THERMAL_MAX_ACTIVE; i++) |
| 732 |
if (tz->trips.active[i].flags.enabled) |
742 |
tz->state.active |= tz->trips.active[i].flags.enabled; |
| 733 |
tz->state.active = 1; |
743 |
|
| 734 |
|
744 |
|
| 735 |
/* |
745 |
/* |
| 736 |
* Calculate Sleep Time |
746 |
* Calculate Sleep Time |