提交 ddc150f7 编写于 作者: L Lv Zheng 提交者: Rafael J. Wysocki

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: NLv Zheng <lv.zheng@intel.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 5133375b
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册