On Monday, 16 July 2007 16:42, Huang, Ying wrote:On Mon, 2007-07-16 at 14:17 +0200, Rafael J. Wysocki wrote:is this a matter of running some test to find out, or is this a question
for the kexec implemantors?
Actually, I'd like someone to tell me. ;-)
I've browsed the kexec code, but haven't found anything related to the devices
in it. Perhaps I didn't know where to look ...
There are two stages for kexec. For "normal" kexec, first the
sys_kexe_load is called to load the kernel image, then
sys_reboot(LINUX_REBOOT_CMD_KEXEC) is called to boot the new kernel.
OK, thanks. This is the information that I was missing.
The call chain is as follow:
sys_reboot(LINUX_REBOOT_CMD_KEXEC)
kernel_kexec
kernel_restart_prepare
device_shutdown
machine_shutdown
machine_kexec
In device_shutdown, the dev->bus->shutdown or dev->driver->shutdown of
every device is called to put device in quiescent state. In
machine_kexec, the new kernel is booted.
Yes.
So, for normal kexec, there is no code path for device state saving and
restoring.
Exactly.
State of device can be restore after shutdown? I don't think so.
No, it can't, but we need something like this for hibernation and
device_shutdown() is not appropriate for this purpose IMO.