]> git.baikalelectronics.ru Git - kernel.git/commit
PM / sleep: Fix test_suspend= command line option
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 2 Sep 2014 23:21:03 +0000 (01:21 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 2 Sep 2014 23:21:03 +0000 (01:21 +0200)
commit0422c26243b6ee98b070d6a4ee45f4c0ff3d478c
tree1b308b37ad78c2a8edd31934bc99f74066fa6430
parent2e5c8ca83cd8c7326618ad75fd27258ed226d7b9
PM / sleep: Fix test_suspend= command line option

After commit 08838554fdaa (PM / sleep: Simplify sleep states sysfs
interface code) the pm_states[] array is not populated initially,
which causes setup_test_suspend() to always fail and the suspend
testing during boot doesn't work any more.

Fix the problem by using pm_labels[] instead of pm_states[] in
setup_test_suspend() and storing a pointer to the label of the
sleep state to test rather than the number representing it,
because the connection between the state numbers and labels is
only established by suspend_set_ops().

Fixes: 08838554fdaa (PM / sleep: Simplify sleep states sysfs interface code)
Reported-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/power/power.h
kernel/power/suspend.c
kernel/power/suspend_test.c