diff options
author | Lv Zheng <lv.zheng@intel.com> | 2012-11-16 05:46:28 +0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2012-11-16 05:46:28 +0400 |
commit | ddc150f7a33ae0c9cb16eaac3641abc00f56316f (patch) | |
tree | d1b2cdfee5e7055e1dfa18d4fbb3dc16f22576ee /drivers/acpi/bus.c | |
parent | 5133375bb46a0d6c3fba07097caed7aa5e629ccd (diff) | |
download | linux-ddc150f7a33ae0c9cb16eaac3641abc00f56316f.tar.xz |
ACPI / PM: Add check preventing transitioning to non-D0 state from D3.
No power transitioning from D3 state up to a non-D0 state is allowed
so make acpi_device_set_power() fail and complain if such a transition
is attempted.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/bus.c')
-rw-r--r-- | drivers/acpi/bus.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 07a20ee3e690..1f0d457ecbcf 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -306,6 +306,12 @@ int acpi_device_set_power(struct acpi_device *device, int state) * a lower-powered state. */ if (state < device->power.state) { + if (device->power.state >= ACPI_STATE_D3_HOT && + state != ACPI_STATE_D0) { + printk(KERN_WARNING PREFIX + "Cannot transition to non-D0 state from D3\n"); + return -ENODEV; + } if (device->power.flags.power_resources) { result = acpi_power_transition(device, state); if (result) |