Currently this hibernation solution is overcomplicated. It allows for using the ACPI S4
state. Which is a low power state potentially using slightly more power then soft off. ACPI
S4 allows the hibernating kernel to control in a fine grained manner which devices are
sufficiently alive to wake up the machine. That is great but something we should worry about
after we get a solid hibernation scheme working.
If you don't worry about ACPI S4 hibernation is much simpler. As all that is really required
of device drivers is stopping their queues and disconnecting from a device.
Then when the image is restored all you have to do is reconnect the driver to the device.
That is only the:
int (*freeze)(struct device *dev);
int (*restore)(struct device *dev);
methods of the proposed interface appear necessary.
Tansitioning to ACPI S4 (or ACPI S5 soft off) after we save the image appear all that is
I think the conversation that is starting with pm_ops is a good one.
But I really hope we look carefully at what we are asking the device drivers to do and see if
we can come up with something simple and straight forward for them to implement and maintain.
We have a lot of similarity in the hibernation ops, the hotplug ops, the driver load and
unload ops, and the reboot shutdown ops. It would be cool if we could identify some key
functionality that we are performing and reduce the work that a driver author needs to do, to
test and implement the driver.