Commit 77733f8a authored by Anton Vorontsov's avatar Anton Vorontsov Committed by Paul Mackerras

powerpc: Make default kexec/crash_kernel ops implicit

This removes the need for each platform to specify default kexec and
crash kernel ops, thus effectively adds a working kexec support for
most 6xx/7xx/7xxx-based boards.

Platforms that can't cope with default ops will explode in some weird
way (a hang or reboot is most likely), which means that the board's
kexec support should be fixed or blacklisted via dummy _prepare
callback returning -ENOSYS.
Signed-off-by: default avatarAnton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 2e8e4f5b
...@@ -22,6 +22,8 @@ void machine_crash_shutdown(struct pt_regs *regs) ...@@ -22,6 +22,8 @@ void machine_crash_shutdown(struct pt_regs *regs)
{ {
if (ppc_md.machine_crash_shutdown) if (ppc_md.machine_crash_shutdown)
ppc_md.machine_crash_shutdown(regs); ppc_md.machine_crash_shutdown(regs);
else
default_machine_crash_shutdown(regs);
} }
/* /*
...@@ -33,11 +35,8 @@ int machine_kexec_prepare(struct kimage *image) ...@@ -33,11 +35,8 @@ int machine_kexec_prepare(struct kimage *image)
{ {
if (ppc_md.machine_kexec_prepare) if (ppc_md.machine_kexec_prepare)
return ppc_md.machine_kexec_prepare(image); return ppc_md.machine_kexec_prepare(image);
/* else
* Fail if platform doesn't provide its own machine_kexec_prepare return default_machine_kexec_prepare(image);
* implementation.
*/
return -ENOSYS;
} }
void machine_kexec_cleanup(struct kimage *image) void machine_kexec_cleanup(struct kimage *image)
...@@ -54,13 +53,11 @@ void machine_kexec(struct kimage *image) ...@@ -54,13 +53,11 @@ void machine_kexec(struct kimage *image)
{ {
if (ppc_md.machine_kexec) if (ppc_md.machine_kexec)
ppc_md.machine_kexec(image); ppc_md.machine_kexec(image);
else { else
/* default_machine_kexec(image);
* Fall back to normal restart if platform doesn't provide
* its own kexec function, and user insist to kexec... /* Fall back to normal restart if we're still alive. */
*/
machine_restart(NULL); machine_restart(NULL);
}
for(;;); for(;;);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment