Skip to content

RFC swsusp: Fix hibernation/restore code ordering

Rafael J. Wysocki linux-acpi linux-pm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 16 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4swsusp: Remove incorrect code from user.ckernel/power/user.c+4 -130 replies
1/4swsusp: Remove incorrect code from user.ckernel/power/user.c+4 -132 replies
2/4swsusp: Remove code duplication between disk.c and user.ckernel/power/disk.c kernel/power/power.h kernel/power/user.c+115 -1700 replies
2/4swsusp: Remove code duplication between disk.c and user.ckernel/power/disk.c kernel/power/power.h kernel/power/user.c+115 -1702 replies
3/4swsusp: Introduce restore platform operationsdrivers/acpi/sleep/main.c include/linux/suspend.h kernel/power/disk.c +3 more+92 -1910 replies
3/4swsusp: Introduce restore platform operationsdrivers/acpi/sleep/main.c include/linux/suspend.h kernel/power/disk.c +3 more+92 -190 replies
4/4swsusp: Fix hibernation code orderingkernel/power/disk.c+4 -40 replies
4/4swsusp: Fix hibernation code orderingkernel/power/disk.c+4 -40 replies
4/4swsusp: Fix hibernation code ordering (updated)kernel/power/disk.c+7 -72 replies
4/4swsusp: Fix hibernation code ordering (updated)kernel/power/disk.c+7 -70 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC][PATCH 0/4] swsusp: Fix hibernation/restore code ordering

Hi,

In the face of this change:

http://marc.info/?l=linux-acpi&m=117938245931603&w=2

I think we should also modify the code ordering in swsusp so that hibernation_ops->prepare() is executed after device_suspend().

However, for this purpose it seems reasonable to eliminate the code duplication between kernel/power/disk.c and kernel/power/user.c first. By eliminating it we can reduce the size of user.c quite substantially and remove the maintenance difficulty with making essentially the same changes in two different places.

Moreover, we should also remove the calls to "platform" functions from the restore code path, since it doesn't carry out any power transition of the system, but we generally need to disable the GPEs before the restore if the 'platform' hibernation mode has been used. To do this, we can introduce two new hibernation_ops to be used in the restore code.

Comments welcome.

Greetings,
Rafael

Signature · 3 lines
If you don't have the time to read,
you don't have the time or the tools to write.
		- Stephen King