Module Name: src Committed By: jruoho Date: Tue Jun 8 21:47:27 UTC 2010
Modified Files: src/sys/dev/acpi: acpi_power.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/dev/acpi/acpi_power.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/acpi/acpi_power.c diff -u src/sys/dev/acpi/acpi_power.c:1.19 src/sys/dev/acpi/acpi_power.c:1.20 --- src/sys/dev/acpi/acpi_power.c:1.19 Tue Jun 8 18:38:18 2010 +++ src/sys/dev/acpi/acpi_power.c Tue Jun 8 21:47:26 2010 @@ -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,9 +400,13 @@ * 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) { - rv = AE_ABORT_METHOD; - goto fail; + 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; + } } /*