powerpc: Make default kexec/crash_kernel ops implicit

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Sunday, December 28, 2008 - 6:05 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=77733f...
Commit:     77733f8a33488307e7d4b9077d174647ecea92e1
Parent:     2e8e4f5b80e101da588af650de0ff6b3c475d6b3
Author:     Anton Vorontsov <avorontsov@ru.mvista.com>
AuthorDate: Tue Dec 16 06:23:05 2008 +0000
Committer:  Paul Mackerras <paulus@samba.org>
CommitDate: Tue Dec 23 15:13:28 2008 +1100

    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: Anton Vorontsov <avorontsov@ru.mvista.com>
    Signed-off-by: Paul Mackerras <paulus@samba.org>
---
 arch/powerpc/kernel/machine_kexec.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c
index 037ade7..4f797c0 100644
--- a/arch/powerpc/kernel/machine_kexec.c
+++ b/arch/powerpc/kernel/machine_kexec.c
@@ -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);
 }
 
 /*
@@ -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)
@@ -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(;;);
 }
 
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
powerpc: Make default kexec/crash_kernel ops implicit, Linux Kernel Mailing ..., (Sun Dec 28, 6:05 pm)