Only check the parent's power state if the parent has power management

capabilities. Based on a short DSDT survey, not all systems adhere to the
model noted in the comment.
This commit is contained in:
jruoho 2010-06-08 21:47:26 +00:00
parent 2f58024d26
commit 15a42e9f63

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpi_power.c,v 1.19 2010/06/08 18:38:18 jruoho Exp $ */
/* $NetBSD: acpi_power.c,v 1.20 2010/06/08 21:47:26 jruoho Exp $ */
/*-
* Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@ -56,7 +56,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: acpi_power.c,v 1.19 2010/06/08 18:38:18 jruoho Exp $");
__KERNEL_RCSID(0, "$NetBSD: acpi_power.c,v 1.20 2010/06/08 21:47:26 jruoho Exp $");
#include <sys/param.h>
#include <sys/kmem.h>
@ -400,10 +400,14 @@ acpi_power_set(ACPI_HANDLE hdl, int state)
* devices. Consequently, we cannot set the state to a lower
* (i.e. higher power) state than the parent device's state.
*/
if (ad->ad_parent != NULL && ad->ad_parent->ad_state > state) {
if ((ad->ad_parent != NULL) &&
(ad->ad_parent->ad_flags & ACPI_DEVICE_POWER) != 0) {
if (ad->ad_parent->ad_state > state) {
rv = AE_ABORT_METHOD;
goto fail;
}
}
/*
* We first sweep through the resources required for the target