Re: [PATCH 4/5] MIPS: Malta: hang on halt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 07, 2014 at 12:20:59PM +0100, Paul Burton wrote:

> When the system is halted it makes little sense to reset it. Instead,
> hang by executing an infinite loop.
> 
> Suggested-by: Maciej W. Rozycki <macro@xxxxxxxxxxxxxx>
> Signed-off-by: Paul Burton <paul.burton@xxxxxxxxxx>
> ---
>  arch/mips/mti-malta/malta-reset.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/mips/mti-malta/malta-reset.c b/arch/mips/mti-malta/malta-reset.c
> index d627d4b..4471dea 100644
> --- a/arch/mips/mti-malta/malta-reset.c
> +++ b/arch/mips/mti-malta/malta-reset.c
> @@ -24,17 +24,20 @@ static void mips_machine_restart(char *command)
>  
>  static void mips_machine_halt(void)
>  {
> -	unsigned int __iomem *softres_reg =
> -		ioremap(SOFTRES_REG, sizeof(unsigned int));
> +	pr_info("Halting\n");
> +	while (true);
> +}

I don't think this should print anything - communication with the user
is up to userland.

while (true) is going to burn lots of power - undesirable on a virtualized
system in particular.  How about something like while (cpu_wait()); instead?
The invocation of cpu_wait() is a little tricky however in this case I think
it's ok if the CPU goes terminally goes to sleep which simplifies things
over the idle loop :-)

  Ralf


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux