aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2009-12-17 03:02:08 -0500
committerLen Brown <len.brown@intel.com>2009-12-28 21:47:29 -0500
commit0c99c5288eb9b1bbc9684b0ec0fd7efc578749b3 (patch)
tree67261962e0ed40fe0d4d84d703d820edd53c254f
parent6b7b284958d47b77d06745b36bc7f36dab769d9b (diff)
ACPI: Disable explicit power state retrieval on fans
If the ACPI power state can be got both directly and indirectly, we prefer to get it indirectly. https://bugzilla.redhat.com/show_bug.cgi?id=531916 describes a system with a _PSC method for the fan that always returns "on". There's no benefit in us always requesting the state of the fan when performing transitions - we want to do everything we can to ensure that the fan turns on when it should do, not risk hardware damage by believing the hardware when it tells us the fan is already on. Given that the Leading Other OS(tm) works fine on this machine, it seems likely that it behaves in much this way. inspired-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/acpi/bus.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index cf761b904e4a..ae9226de93a6 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -190,16 +190,16 @@ int acpi_bus_get_power(acpi_handle handle, int *state)
190 * Get the device's power state either directly (via _PSC) or 190 * Get the device's power state either directly (via _PSC) or
191 * indirectly (via power resources). 191 * indirectly (via power resources).
192 */ 192 */
193 if (device->power.flags.explicit_get) { 193 if (device->power.flags.power_resources) {
194 result = acpi_power_get_inferred_state(device);
195 if (result)
196 return result;
197 } else if (device->power.flags.explicit_get) {
194 status = acpi_evaluate_integer(device->handle, "_PSC", 198 status = acpi_evaluate_integer(device->handle, "_PSC",
195 NULL, &psc); 199 NULL, &psc);
196 if (ACPI_FAILURE(status)) 200 if (ACPI_FAILURE(status))
197 return -ENODEV; 201 return -ENODEV;
198 device->power.state = (int)psc; 202 device->power.state = (int)psc;
199 } else if (device->power.flags.power_resources) {
200 result = acpi_power_get_inferred_state(device);
201 if (result)
202 return result;
203 } 203 }
204 204
205 *state = device->power.state; 205 *state = device->power.state;