A minimal patch route sounds good.
Tricky, and I expect unnecessary.
We should be able to just have relocate_new_kernel return?
Ugh. No. Not sharing the shutdown methods with reboot and
the normal kexec path looks like a recipe for failure to me.
This looks like where we really need to have the conversation.
What methods do we use to shutdown the system.
My take on the situation is this. For proper handling we
need driver device_detach and device_reattach methods.
With the following semantics. The device_detach methods
will disable DMA and place the hardware in a sane state
from which the device driver can reclaim and reinitialize it,
but the hardware will not be touched.
device_reattach reattaches the driver to the hardware.
So looking at this patch I see two very productive directions
we can go.
1) A patch that just fixes up the kexec infrastructure code
so it implements the swap page and provides the kernel
reentry point. And doesn't handle the upper layer
user interface portion.
2) A patch that renames device_shutdown to device_detach.
And starts implementing the driver hooks needed from
a resumable kexec.
Then we have the question what do we do with devices in the
kernel that don't have a device_reattach method, when we
expect to come back from a kexec. The two choices are:
(a) fail the operations before we commit to anything.
(b) hotunplug/hotreplug the device.
With respect to device methods. I don't think any of
the current power saving methods make sense. Certainly
nothing that prepares the way for using weird ACPI states.
I don't think there is not enough difference between
device_detach and device_shutdown for us to maintain two
separate methods, and that seems to place an unreasonable
maintenance burden on device driver developers.
Eric
--