summaryrefslogtreecommitdiffstats
path: root/kernel/power
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-10-19 20:55:04 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-10-19 20:59:02 +0200
commitc1bfc598181bf04b371131df9ea77162079d710e (patch)
tree489f2bc155ad44eff39dda16504d9be7170079f2 /kernel/power
parentPM: hibernate: Remove blk_status_to_errno in hib_wait_io (diff)
downloadlinux-c1bfc598181bf04b371131df9ea77162079d710e.tar.xz
linux-c1bfc598181bf04b371131df9ea77162079d710e.zip
Revert "PM: sleep: Do not assume that "mem" is always present"
Revert commit bfcc1e67ff1e ("PM: sleep: Do not assume that "mem" is always present"), because it breaks compatibility with user space utilities assuming that "mem" will always be present in /sys/power/state. Fixes: bfcc1e67ff1e ("PM: sleep: Do not assume that "mem" is always present") Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/suspend.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 02e306ad8db8..eb75f394a059 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -171,7 +171,8 @@ static bool valid_state(suspend_state_t state)
void __init pm_states_init(void)
{
- /* "freeze" is always present in /sys/power/state. */
+ /* "mem" and "freeze" are always present in /sys/power/state. */
+ pm_states[PM_SUSPEND_MEM] = pm_labels[PM_SUSPEND_MEM];
pm_states[PM_SUSPEND_TO_IDLE] = pm_labels[PM_SUSPEND_TO_IDLE];
/*
* Suspend-to-idle should be supported even without any suspend_ops,
@@ -213,7 +214,6 @@ void suspend_set_ops(const struct platform_suspend_ops *ops)
}
if (valid_state(PM_SUSPEND_MEM)) {
mem_sleep_states[PM_SUSPEND_MEM] = mem_sleep_labels[PM_SUSPEND_MEM];
- pm_states[PM_SUSPEND_MEM] = pm_labels[PM_SUSPEND_MEM];
if (mem_sleep_default >= PM_SUSPEND_MEM)
mem_sleep_current = PM_SUSPEND_MEM;
}