Skip to contentSkip to conversation

boot: small change of halt method

PATCH In review Andrew Brukhov 4 participants 7 messages Aug 24, 2006 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 boot: small change of halt method

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

usr/src/linux-2.6.17.11/arch/i386/boot/compressed/misc.c renamed from linux-2.6.17.11/arch/i386/boot/compressed/misc.c +2 -2
@@ -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

#1 lore raw
Quoted 22 lines · Andrew Brukhov

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

usr/src/linux-2.6.17.11/arch/i386/boot/compressed/misc.c renamed from linux-2.6.17.11/arch/i386/boot/compressed/misc.c +2 -2
@@ -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" );
 }
 
Quoted 2 lines

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

#2 lore raw
Quoted 4 lines · H. Peter Anvin
Quoted 2 lines · Andrew Brukhov

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

...

Quoted 2 lines
Quoted 2 lines

+ * Small fix of halt method Andrew Brukhov, Aug. 2006 */

<http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt>

Quoted 6 lines
    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.

Signature · 3 lines
-o--=O`C  /. .\  (yep) (+)                                    /o-o\
 #oo'L O      o         |                                     *.
<___=E M    ^--         |  (you're barking up the wrong tree) =--'
#3 lore raw
Quoted 12 lines · Oleg Verych
Quoted 4 lines · H. Peter Anvin
Quoted 2 lines · Andrew Brukhov

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

...

Quoted 3 lines
Quoted 3 lines

+ * Small fix of halt method Andrew Brukhov, Aug. 2006 */

<http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt>

Quoted 1 line
Quoted 7 lines
Quoted 5 lines
     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

#4 lore raw
In reply to Oleg Verych
Quoted 4 lines · Oleg Verych
Quoted 1 line

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

#5 lore raw
Quoted 9 lines · H. Peter Anvin
Quoted 4 lines · Oleg Verych
Quoted 1 line

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 ?

Signature · 3 lines
-o--=O`C  /. .\
 #oo'L O      o
<___=E M    ^--
#6 lore raw
Quoted 3 lines · Oleg Verych

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

It could, yes, with some work.

-hpa