public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] boot: small change of halt method
@ 2006-08-24 18:44 Andrew Brukhov
  2006-08-24 19:08 ` H. Peter Anvin
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Brukhov @ 2006-08-24 18:44 UTC (permalink / raw)
  To: linux-kernel

I'm new here.
After reading boot code i'm immidiatly change this string:

--- ./linux-2.6.17.11/arch/i386/boot/compressed/misc.c	2006-08-24 01:16:33.000000000 +0400
+++ /usr/src/linux-2.6.17.11/arch/i386/boot/compressed/misc.c	2006-08-24 22:36:10.000000000 +0400
@@ -7,6 +7,7 @@
  * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
  * puts by Nick Holloway 1993, better puts by Martin Mares 1995
  * High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996
+ * Small fix of halt method Andrew Brukhov, Aug. 2006               
  */
 
 #include <linux/linkage.h>
@@ -289,8 +290,7 @@ static void error(char *x)
 	putstr("\n\n");
 	putstr(x);
 	putstr("\n\n -- System halted");
-
-	while(1);	/* Halt */
+      	asm( "hlt" );
 }

It's becouse this code is platform depended and therefore there is no resons to write infinity cycle.

--------------
Andrew Brukhov

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] boot: small change of halt method
  2006-08-24 18:44 [PATCH] boot: small change of halt method Andrew Brukhov
@ 2006-08-24 19:08 ` H. Peter Anvin
  2006-08-24 22:03   ` Oleg Verych
  0 siblings, 1 reply; 7+ messages in thread
From: H. Peter Anvin @ 2006-08-24 19:08 UTC (permalink / raw)
  To: Andrew Brukhov; +Cc: linux-kernel

Andrew Brukhov wrote:
> I'm new here.
> After reading boot code i'm immidiatly change this string:
> 
> --- ./linux-2.6.17.11/arch/i386/boot/compressed/misc.c	2006-08-24 01:16:33.000000000 +0400
> +++ /usr/src/linux-2.6.17.11/arch/i386/boot/compressed/misc.c	2006-08-24 22:36:10.000000000 +0400
> @@ -7,6 +7,7 @@
>   * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
>   * puts by Nick Holloway 1993, better puts by Martin Mares 1995
>   * High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996
> + * Small fix of halt method Andrew Brukhov, Aug. 2006               
>   */
>  
>  #include <linux/linkage.h>
> @@ -289,8 +290,7 @@ static void error(char *x)
>  	putstr("\n\n");
>  	putstr(x);
>  	putstr("\n\n -- System halted");
> -
> -	while(1);	/* Halt */
> +      	asm( "hlt" );
>  }
> 
> It's becouse this code is platform depended and therefore there is no resons to write infinity cycle.
> 

Wrong.

You need to:

	while (1)
		asm volatile("hlt");

... since HLT only pauses until interrupt.

	-hpa

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] boot: small change of halt method
  2006-08-24 22:03   ` Oleg Verych
@ 2006-08-24 21:14     ` Grzegorz Kulewski
  2006-08-24 21:25     ` H. Peter Anvin
  1 sibling, 0 replies; 7+ messages in thread
From: Grzegorz Kulewski @ 2006-08-24 21:14 UTC (permalink / raw)
  To: Oleg Verych; +Cc: linux-kernel, pingved

On Fri, 25 Aug 2006, Oleg Verych wrote:
> H. Peter Anvin wrote:
>>  Andrew Brukhov wrote:
>> 
>> >  I'm new here.
>> >  After reading boot code i'm immidiatly change this string:
> ...
>> >  + * Small fix of halt method Andrew Brukhov, Aug. 2006 
>> >  */
>> > 
> <http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt>
>
>>
>>      while (1)
>>          asm volatile("hlt");
>>
>>  ... since HLT only pauses until interrupt.
>> 
> Why not to have a reboot here?
> Testing and getting such errors on my laptop, it needs a power cycle.

And what if hlt is buggy? I have at least one pIII tualatin based server 
that has some strange mainboard problem and will work only if nohlt is 
passed to the kernel.


Thanks,

Grzegorz Kulewski


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] boot: small change of halt method
  2006-08-24 22:03   ` Oleg Verych
  2006-08-24 21:14     ` Grzegorz Kulewski
@ 2006-08-24 21:25     ` H. Peter Anvin
  2006-08-24 22:56       ` Oleg Verych
  1 sibling, 1 reply; 7+ messages in thread
From: H. Peter Anvin @ 2006-08-24 21:25 UTC (permalink / raw)
  To: Oleg Verych; +Cc: linux-kernel, pingved

Oleg Verych wrote:
>>
> Why not to have a reboot here?
> Testing and getting such errors on my laptop, it needs a power cycle.
> 

It makes it harder to debug, mostly.

	-hpa

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] boot: small change of halt method
  2006-08-24 19:08 ` H. Peter Anvin
@ 2006-08-24 22:03   ` Oleg Verych
  2006-08-24 21:14     ` Grzegorz Kulewski
  2006-08-24 21:25     ` H. Peter Anvin
  0 siblings, 2 replies; 7+ messages in thread
From: Oleg Verych @ 2006-08-24 22:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kernel, pingved

H. Peter Anvin wrote:
> Andrew Brukhov wrote:
> 
>> I'm new here.
>> After reading boot code i'm immidiatly change this string:
...
>> + * Small fix of halt method Andrew Brukhov, Aug. 2006                 */
>>  
<http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt>

> 
>     while (1)
>         asm volatile("hlt");
> 
> ... since HLT only pauses until interrupt.
> 
Why not to have a reboot here?
Testing and getting such errors on my laptop, it needs a power cycle.

-- 
-o--=O`C  /. .\  (yep) (+)                                    /o-o\
  #oo'L O      o         |                                     *.
<___=E M    ^--         |  (you're barking up the wrong tree) =--'


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] boot: small change of halt method
  2006-08-24 22:56       ` Oleg Verych
@ 2006-08-24 22:20         ` H. Peter Anvin
  0 siblings, 0 replies; 7+ messages in thread
From: H. Peter Anvin @ 2006-08-24 22:20 UTC (permalink / raw)
  To: Oleg Verych; +Cc: linux-kernel, pingved

Oleg Verych wrote:
> 
> then maybe "panic=timeout" could be applied here ?
> 

It could, yes, with some work.

	-hpa

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] boot: small change of halt method
  2006-08-24 21:25     ` H. Peter Anvin
@ 2006-08-24 22:56       ` Oleg Verych
  2006-08-24 22:20         ` H. Peter Anvin
  0 siblings, 1 reply; 7+ messages in thread
From: Oleg Verych @ 2006-08-24 22:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kernel, pingved

H. Peter Anvin wrote:
> Oleg Verych wrote:
> 
>>>
>> Why not to have a reboot here?
>> Testing and getting such errors on my laptop, it needs a power cycle.
>>
> 
> It makes it harder to debug, mostly.
> 

then maybe "panic=timeout" could be applied here ?

-- 
-o--=O`C  /. .\
  #oo'L O      o
<___=E M    ^--


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-08-24 22:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-24 18:44 [PATCH] boot: small change of halt method Andrew Brukhov
2006-08-24 19:08 ` H. Peter Anvin
2006-08-24 22:03   ` Oleg Verych
2006-08-24 21:14     ` Grzegorz Kulewski
2006-08-24 21:25     ` H. Peter Anvin
2006-08-24 22:56       ` Oleg Verych
2006-08-24 22:20         ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox