Skip to content

Commit

Permalink
powerpc: Make default kexec/crash_kernel ops implicit
Browse files Browse the repository at this point in the history
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: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Anton Vorontsov authored and Paul Mackerras committed Dec 23, 2008
1 parent 2e8e4f5 commit 77733f8
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions arch/powerpc/kernel/machine_kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ void machine_crash_shutdown(struct pt_regs *regs)
{
if (ppc_md.machine_crash_shutdown)
ppc_md.machine_crash_shutdown(regs);
else
default_machine_crash_shutdown(regs);
}

/*
Expand All @@ -33,11 +35,8 @@ int machine_kexec_prepare(struct kimage *image)
{
if (ppc_md.machine_kexec_prepare)
return ppc_md.machine_kexec_prepare(image);
/*
* Fail if platform doesn't provide its own machine_kexec_prepare
* implementation.
*/
return -ENOSYS;
else
return default_machine_kexec_prepare(image);
}

void machine_kexec_cleanup(struct kimage *image)
Expand All @@ -54,13 +53,11 @@ void machine_kexec(struct kimage *image)
{
if (ppc_md.machine_kexec)
ppc_md.machine_kexec(image);
else {
/*
* Fall back to normal restart if platform doesn't provide
* its own kexec function, and user insist to kexec...
*/
machine_restart(NULL);
}
else
default_machine_kexec(image);

/* Fall back to normal restart if we're still alive. */
machine_restart(NULL);
for(;;);
}

Expand Down

0 comments on commit 77733f8

Please sign in to comment.