aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2009-05-21 19:28:53 -0400
committerLen Brown <len.brown@intel.com>2009-05-27 21:45:53 -0400
commitbdf43bbf2e19952d82995a50e00cb4b66afa4f0c (patch)
treea7e7f84117f6c26c3a0f22439664fb9b4645cbcc /drivers/acpi
parentcd86a536c81e9300d984327517548ca0652eebf9 (diff)
ACPI: don't check power state after _ON/_OFF
We used to evaluate _STA to check the power state of a device after running _ON or _OFF. But as far as I can tell, there's no benefit to evaluating _STA, and sometimes we trip over bugs when BIOSes don't implement _STA correctly. Yakui says Windows XP doesn't evaluate _STA during power transition. So let's skip it in Linux, too. It's conceivable that we'll need to check _STA in the future for some reason, but until we do, I don't see a reason to clutter this code path. References: http://bugzilla.kernel.org/show_bug.cgi?id=13243 http://marc.info/?l=linux-acpi&m=124166053803753&w=2 http://marc.info/?l=linux-acpi&m=124175761408256&w=2 http://marc.info/?l=linux-acpi&m=124210593114061&w=2 Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Acked-by: Matthew Garrett <mjg59@srcf.ucam.org> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/power.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 56665a63bf19..d74365d4a6e7 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -194,7 +194,7 @@ static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state)
194 194
195static int acpi_power_on(acpi_handle handle, struct acpi_device *dev) 195static int acpi_power_on(acpi_handle handle, struct acpi_device *dev)
196{ 196{
197 int result = 0, state; 197 int result = 0;
198 int found = 0; 198 int found = 0;
199 acpi_status status = AE_OK; 199 acpi_status status = AE_OK;
200 struct acpi_power_resource *resource = NULL; 200 struct acpi_power_resource *resource = NULL;
@@ -236,18 +236,6 @@ static int acpi_power_on(acpi_handle handle, struct acpi_device *dev)
236 if (ACPI_FAILURE(status)) 236 if (ACPI_FAILURE(status))
237 return -ENODEV; 237 return -ENODEV;
238 238
239 if (!acpi_power_nocheck) {
240 /*
241 * If acpi_power_nocheck is set, it is unnecessary to check
242 * the power state after power transition.
243 */
244 result = acpi_power_get_state(resource->device->handle,
245 &state);
246 if (result)
247 return result;
248 if (state != ACPI_POWER_RESOURCE_STATE_ON)
249 return -ENOEXEC;
250 }
251 /* Update the power resource's _device_ power state */ 239 /* Update the power resource's _device_ power state */
252 resource->device->power.state = ACPI_STATE_D0; 240 resource->device->power.state = ACPI_STATE_D0;
253 241
@@ -258,7 +246,7 @@ static int acpi_power_on(acpi_handle handle, struct acpi_device *dev)
258 246
259static int acpi_power_off_device(acpi_handle handle, struct acpi_device *dev) 247static int acpi_power_off_device(acpi_handle handle, struct acpi_device *dev)
260{ 248{
261 int result = 0, state; 249 int result = 0;
262 acpi_status status = AE_OK; 250 acpi_status status = AE_OK;
263 struct acpi_power_resource *resource = NULL; 251 struct acpi_power_resource *resource = NULL;
264 struct list_head *node, *next; 252 struct list_head *node, *next;
@@ -293,18 +281,6 @@ static int acpi_power_off_device(acpi_handle handle, struct acpi_device *dev)
293 if (ACPI_FAILURE(status)) 281 if (ACPI_FAILURE(status))
294 return -ENODEV; 282 return -ENODEV;
295 283
296 if (!acpi_power_nocheck) {
297 /*
298 * If acpi_power_nocheck is set, it is unnecessary to check
299 * the power state after power transition.
300 */
301 result = acpi_power_get_state(handle, &state);
302 if (result)
303 return result;
304 if (state != ACPI_POWER_RESOURCE_STATE_OFF)
305 return -ENOEXEC;
306 }
307
308 /* Update the power resource's _device_ power state */ 284 /* Update the power resource's _device_ power state */
309 resource->device->power.state = ACPI_STATE_D3; 285 resource->device->power.state = ACPI_STATE_D3;
310 286