]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ACPI: Disable explicit power state retrieval on fans
authorZhang Rui <rui.zhang@intel.com>
Thu, 17 Dec 2009 08:02:08 +0000 (16:02 +0800)
committerLen Brown <len.brown@intel.com>
Tue, 29 Dec 2009 02:47:29 +0000 (21:47 -0500)
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>
drivers/acpi/bus.c

index cf761b904e4a2821d4cb09977182783c973a442f..ae9226de93a6d12f111e7aa683d834c8a9e21af3 100644 (file)
@@ -190,16 +190,16 @@ int acpi_bus_get_power(acpi_handle handle, int *state)
                 * Get the device's power state either directly (via _PSC) or
                 * indirectly (via power resources).
                 */
-               if (device->power.flags.explicit_get) {
+               if (device->power.flags.power_resources) {
+                       result = acpi_power_get_inferred_state(device);
+                       if (result)
+                               return result;
+               } else if (device->power.flags.explicit_get) {
                        status = acpi_evaluate_integer(device->handle, "_PSC",
                                                       NULL, &psc);
                        if (ACPI_FAILURE(status))
                                return -ENODEV;
                        device->power.state = (int)psc;
-               } else if (device->power.flags.power_resources) {
-                       result = acpi_power_get_inferred_state(device);
-                       if (result)
-                               return result;
                }
 
                *state = device->power.state;