lkml.org 
[lkml]   [2008]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86: call machine_shutdown and stop all CPUs in native_machine_halt
On Mon, Oct 20, 2008 at 02:13:07PM +0200, Ivan Vecera wrote:
> Function machine_halt (resp. native_machine_halt) is empty for x86
> architectures. When command 'halt -f' is invoked, the message
> "System halted." is displayed but this is not really true because
> all CPUs are still running.
> There are also similar inconsistencies for other arches (some uses
> power-off for halt or forever-loop with IRQs enabled/disabled).
> IMO there should be used the same approach for all architectures
> OR what does the message "System halted" really mean?
>
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
> ---
> arch/x86/kernel/reboot.c | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
> index f4c93f1..15ad949 100644
> --- a/arch/x86/kernel/reboot.c
> +++ b/arch/x86/kernel/reboot.c
> @@ -465,6 +465,14 @@ static void native_machine_restart(char *__unused)
>
> static void native_machine_halt(void)
> {
> + /* stop other cpus and apics */
> + machine_shutdown();
> +
> + /* stop this cpu */
> + local_irq_disable();
> + if (hlt_works(smp_processor_id()))
> + for (;;) halt();
> + for (;;);
> }
>
> static void native_machine_power_off(void)
> --
> 1.5.6.3
>

Acked-by: Neil Horman <nhorman@tuxdriver.com>

--
/***************************************************
*Neil Horman
*Senior Software Engineer
*Red Hat, Inc.
*nhorman@redhat.com
*gpg keyid: 1024D / 0x92A74FA1
*http://pgp.mit.edu
***************************************************/


\
 
 \ /
  Last update: 2008-10-20 16:43    [W:0.515 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site