mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-18 14:36:06 +07:00
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>
This commit is contained in:
parent
5133375bb4
commit
ddc150f7a3
@ -306,6 +306,12 @@ int acpi_device_set_power(struct acpi_device *device, int state)
|
|||||||
* a lower-powered state.
|
* a lower-powered state.
|
||||||
*/
|
*/
|
||||||
if (state < device->power.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) {
|
if (device->power.flags.power_resources) {
|
||||||
result = acpi_power_transition(device, state);
|
result = acpi_power_transition(device, state);
|
||||||
if (result)
|
if (result)
|
||||||
|
Loading…
Reference in New Issue
Block a user