Skip to content

Commit b155175

Browse files
nathanlynchgregkh
authored andcommitted
powerpc/pseries/hibernation: drop pseries_suspend_begin() from suspend ops
[ Upstream commit 52719fc ] There are three ways pseries_suspend_begin() can be reached: 1. When "mem" is written to /sys/power/state: kobj_attr_store() -> state_store() -> pm_suspend() -> suspend_devices_and_enter() -> pseries_suspend_begin() This never works because there is no way to supply a valid stream id using this interface, and H_VASI_STATE is called with a stream id of zero. So this call path is useless at best. 2. When a stream id is written to /sys/devices/system/power/hibernate. pseries_suspend_begin() is polled directly from store_hibernate() until the stream is in the "Suspending" state (i.e. the platform is ready for the OS to suspend execution): dev_attr_store() -> store_hibernate() -> pseries_suspend_begin() 3. When a stream id is written to /sys/devices/system/power/hibernate (continued). After #2, pseries_suspend_begin() is called once again from the pm core: dev_attr_store() -> store_hibernate() -> pm_suspend() -> suspend_devices_and_enter() -> pseries_suspend_begin() This is redundant because the VASI suspend state is already known to be Suspending. The begin() callback of platform_suspend_ops is optional, so we can simply remove that assignment with no loss of function. Fixes: 32d8ad4 ("powerpc/pseries: Partition hibernation support") Signed-off-by: Nathan Lynch <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sasha Levin <[email protected]>
1 parent 40a281c commit b155175

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

arch/powerpc/platforms/pseries/suspend.c

-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ static struct bus_type suspend_subsys = {
187187

188188
static const struct platform_suspend_ops pseries_suspend_ops = {
189189
.valid = suspend_valid_only_mem,
190-
.begin = pseries_suspend_begin,
191190
.prepare_late = pseries_prepare_late,
192191
.enter = pseries_suspend_enter,
193192
};

0 commit comments

Comments
 (0)