Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336700
b: refs/heads/master
c: 261cba2
h: refs/heads/master
v: v3
  • Loading branch information
Zhang Rui authored and Rafael J. Wysocki committed Nov 27, 2012
1 parent 3a18964 commit 93b32b8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 05bce79e6d24ee6eb2beddf0f6314358404d472f
refs/heads/master: 261cba2deb7d3bebd180c35d5dbf8961f6e9afc4
34 changes: 34 additions & 0 deletions trunk/drivers/acpi/thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,38 @@ static void acpi_thermal_notify(struct acpi_device *device, u32 event)
}
}

/*
* On some platforms, the AML code has dependency about
* the evaluating order of _TMP and _CRT/_HOT/_PSV/_ACx.
* 1. On HP Pavilion G4-1016tx, _TMP must be invoked after
* /_CRT/_HOT/_PSV/_ACx, or else system will be power off.
* 2. On HP Compaq 6715b/6715s, the return value of _PSV is 0
* if _TMP has never been evaluated.
*
* As this dependency is totally transparent to OS, evaluate
* all of them once, in the order of _CRT/_HOT/_PSV/_ACx,
* _TMP, before they are actually used.
*/
static void acpi_thermal_aml_dependency_fix(struct acpi_thermal *tz)
{
acpi_handle handle = tz->device->handle;
unsigned long long value;
int i;

acpi_evaluate_integer(handle, "_CRT", NULL, &value);
acpi_evaluate_integer(handle, "_HOT", NULL, &value);
acpi_evaluate_integer(handle, "_PSV", NULL, &value);
for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) {
char name[5] = { '_', 'A', 'C', ('0' + i), '\0' };
acpi_status status;

status = acpi_evaluate_integer(handle, name, NULL, &value);
if (status == AE_NOT_FOUND)
break;
}
acpi_evaluate_integer(handle, "_TMP", NULL, &value);
}

static int acpi_thermal_get_info(struct acpi_thermal *tz)
{
int result = 0;
Expand All @@ -992,6 +1024,8 @@ static int acpi_thermal_get_info(struct acpi_thermal *tz)
if (!tz)
return -EINVAL;

acpi_thermal_aml_dependency_fix(tz);

/* Get trip points [_CRT, _PSV, etc.] (required) */
result = acpi_thermal_get_trip_points(tz);
if (result)
Expand Down

0 comments on commit 93b32b8

Please sign in to comment.