ARM: restart: move reboot failure handing into machine_restart()
[pandora-kernel.git] / arch / arm / kernel / process.c
index e68d251..20a42a7 100644 (file)
@@ -114,19 +114,8 @@ void arm_machine_restart(char mode, const char *cmd)
        /* Push out any further dirty data, and ensure cache is empty */
        flush_cache_all();
 
-       /*
-        * Now call the architecture specific reboot code.
-        */
+       /* Now call the architecture specific reboot code. */
        arch_reset(mode, cmd);
-
-       /*
-        * Whoops - the architecture was unable to reboot.
-        * Tell the user!
-        */
-       mdelay(1000);
-       printk("Reboot failed -- System halted\n");
-       local_irq_disable();
-       while (1);
 }
 
 /*
@@ -255,7 +244,16 @@ void machine_power_off(void)
 void machine_restart(char *cmd)
 {
        machine_shutdown();
+
        arm_pm_restart(reboot_mode, cmd);
+
+       /* Give a grace period for failure to restart of 1s */
+       mdelay(1000);
+
+       /* Whoops - the platform was unable to reboot. Tell the user! */
+       printk("Reboot failed -- System halted\n");
+       local_irq_disable();
+       while (1);
 }
 
 void __show_regs(struct pt_regs *regs)