Skip to contentSkip to conversation

kernel 2.6.23-rc6 hangs on Geode GX1

DISCUSSION Marco Tralli 5 participants 10 messages Sep 27, 2007 – Sep 28, 2007

lore
Share & tools
lore
#0 lore raw

Hello all,

I have random hangs on kernel boot or after few minutes on a NatSemi Geode GX1 based PC-104 (from Advantech) using kernel 2.6.23-rc6. The system locks, no way to use SysRq key, no usefull logs.

No problems using kernel 2.6.21 series that I was using before with same config options.

I found that commenting out "geode_configure" call in arch/i386/kernel/cpu/cyrix.c the problem is fixed.

I guess recent changes to cyrix.c that replace macros setCx86/getCx86 with inlined functions have now "activate" performance tricks in geode_configure code that previously were "inactive" due to wrong macro espansion. So not only "Suspend on Halt" function is enabled but also less or not documented geode tricks (incrementor margin, fast fpu, write-back) now broken on some GX1/GXm platform (maybe because of BIOS?)

I can further investigate on what exact geode_configure part cause my hangs, but I suggest to make a config options to explicity enable Geode performance tricks only if requested (maybe using CONFIG_MGEODEGX1) .

Regards
Marco Tralli
Snap-on Equipment

processor : 0
vendor_id : CyrixInstead
cpu family : 5
model : 9
model name : Geode(TM) Integrated Processor by National Semi stepping : 2
cpu MHz : 299.239
cache size : 16 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu tsc msr cx8 cmov mmx cxmmx
bogomips : 596.37

#1 lore raw
Quoted 5 lines · Marco Tralli

Hello all,

I have random hangs on kernel boot or after few minutes on a NatSemi Geode GX1 based PC-104 (from Advantech) using kernel 2.6.23-rc6. The system locks, no way to use SysRq key, no usefull logs.

Please see: http://bugzilla.kernel.org/show_bug.cgi?id=9086

Greetings,
Rafael

#2 lore raw
Quoted 8 lines · R. J. Wysocki
Quoted 5 lines · Marco Tralli

Hello all,

I have random hangs on kernel boot or after few minutes on a NatSemi Geode GX1 based PC-104 (from Advantech) using kernel 2.6.23-rc6. The system locks, no way to use SysRq key, no usefull logs.

Please see: http://bugzilla.kernel.org/show_bug.cgi?id=9086

Thats a different bug, I believe. The symptoms are different. Plus, that was a more modern LX processor, while this is a GX1 which doesn't share any code with the LX BIOS, so it would be a huge coincidence if they were affected by the same problem.

Jordan

Signature · 3 lines
Jordan Crouse
Systems Software Development Engineer 
Advanced Micro Devices, Inc.
#3 lore raw
Quoted 8 lines · Jordan Crouse
Quoted 7 lines · R. J. Wysocki
Quoted 5 lines · Marco Tralli

Hello all,

I have random hangs on kernel boot or after few minutes on a NatSemi Geode GX1 based PC-104 (from Advantech) using kernel 2.6.23-rc6. The system locks, no way to use SysRq key, no usefull logs.

Quoted 6 lines
Quoted 1 line

Please see: http://bugzilla.kernel.org/show_bug.cgi?id=9086

Thats a different bug, I believe. The symptoms are different. Plus, that was a more modern LX processor, while this is a GX1 which doesn't share any code with the LX BIOS, so it would be a huge coincidence if they were affected by the same problem.

Well, I'd check anyway. :-)

Greetings,
Rafael

#4 lore raw
Quoted 6 lines · Jordan Crouse
Quoted 5 lines · R. J. Wysocki
Quoted 4 lines · Marco Tralli
Quoted 3 lines

Hello all,

I have random hangs on kernel boot or after few minutes on a NatSemi

Geode

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

GX1 based PC-104 (from Advantech) using kernel 2.6.23-rc6. The

system locks,

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

no way to use SysRq key, no usefull logs.

Please see: http://bugzilla.kernel.org/show_bug.cgi?id=9086

Thats a different bug, I believe. The symptoms are different. Plus,

that

Quoted 2 lines
Quoted 2 lines

was a more modern LX processor, while this is a GX1 which doesn't share any code with the LX BIOS, so it would be a huge coincidence if they

were

Quoted 4 lines
Quoted 1 line

affected by the same problem.

Well, I'd check anyway. :-)

I confirm that 2.6.23-rc8-git2 does not solve my problem with Geode GX1 boot messages shows the same BIOS-E820 maps
after few second or sometime one minute from boot it hangs the system

Again disabling specific performance tricks for GX1/GXm (geode_configure in cyrix.c) fix my problem.

Please note that I'm using a very minimal embedded PC with minimal (no swap, no modules, etc..) kernel configuration, no other sw is running other than statically linked bash.

Thanks
Marco

#5 lore raw
In reply to Jordan Crouse
Quoted 5 lines · R. J. Wysocki
Quoted 4 lines · Marco Tralli
Quoted 3 lines

Hello all,

I have random hangs on kernel boot or after few minutes on a NatSemi

Geode

Quoted 1 line
Quoted 1 line
Quoted 1 line

GX1 based PC-104 (from Advantech) using kernel 2.6.23-rc6. The system

locks,

Quoted 9 lines
Quoted 3 lines
Quoted 1 line

no way to use SysRq key, no usefull logs.

Please see: http://bugzilla.kernel.org/show_bug.cgi?id=9086

Thats a different bug, I believe. The symptoms are different. Plus, that was a more modern LX processor, while this is a GX1 which doesn't share any code with the LX BIOS, so it would be a huge coincidence if they were affected by the same problem.

The same 2.6.23-rc6 kernel does not hang on Geode LX based PC-104 from Advantech

I'm checking with 2.6.23-rc8-git2 and I'll let you know

Marco

#6 lore raw
In reply to Marco Tralli

Hi AMrco,

Quoted 10 lines · Marco Tralli

I have random hangs on kernel boot or after few minutes on a NatSemi Geode GX1 based PC-104 (from Advantech) using kernel 2.6.23-rc6. The system locks, no way to use SysRq key, no usefull logs.

No problems using kernel 2.6.21 series that I was using before with same config options.

I found that commenting out "geode_configure" call in arch/i386/kernel/cpu/cyrix.c the problem is fixed.

Quoted 6 lines

I guess recent changes to cyrix.c that replace macros setCx86/getCx86 with inlined functions have now "activate" performance tricks in geode_configure code that previously were "inactive" due to wrong macro espansion. So not only "Suspend on Halt" function is enabled but also less or not documented geode tricks (incrementor margin, fast fpu, write-back) now broken on some GX1/GXm platform (maybe because of BIOS?)

Seems so.

Quoted 3 lines

I can further investigate on what exact geode_configure part cause my hangs, but I suggest to make a config options to explicity enable Geode performance tricks only if requested (maybe using CONFIG_MGEODEGX1) .

That's my system:

root@morgan:~ uname -a
Linux morgan 2.6.22.8-cfs-v22-Igel316 #1 PREEMPT Wed Sep 26 15:09:46 CEST 2007 i586 unknown

root@morgan:~ cat /proc/cpuinfo
processor : 0
vendor_id : Geode by NSC
cpu family : 5
model : 9
model name : Geode(TM) Integrated Processor by National Semi
stepping : 2
cache size : 16 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu msr cx8 cmov mmx cxmmx
bogomips : 99.94
clflush size : 32

It runs stable on 5 different GX1 systems.

But I do not use a standard BIOS. I'm using LinuxBIOS instead. But I'm also using these patches.

For documentation only:

arch/i386/kernel/cpu/cyrix.c +17 -0
Index: linux-2.6.22/arch/i386/kernel/cpu/cyrix.c
===================================================================
@@ -139,6 +139,23 @@ static void __cpuinit set_cx86_memwb(voi
 	setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x14 );
 }
 
+/*
+ * Setup the chipset specific Performance Control Incrementer
+ *
+ * The Performance Control Incrementer seems to be a delay line to control data
+ * setup time for DRAM access or it controls jitter. Its setting depends on CPU
+ * and DRAM clock (CPU and DRAM clock are coupled through a simple clock
+ * divider. For a 300 MHz CPU the divider is 3.0 to get a DRAM clock of 100MHz)
+ * There is an application note how to setup it:
+ *  "AMD Geode GX1 Processor Memory Timings for Maximum Performance."
+ * Values for various CPUs:
+ * 1-0 for processor speed 200...266MHz
+ * 1-1 for processor speed 300 and 333MHz
+ *
+ * Note: If your system runs unstable after setting new values here,
+ * try with other values or leave the value as the BIOS setup it.
+ * The setting depends also on physical layout!
+ */
 static void __cpuinit set_cx86_inc(void)
 {
 	unsigned char ccr3;

And here I'm using an incrementer value for my 300MHz CPU:

arch/i386/kernel/cpu/cyrix.c +1 -1
Index: linux-2.6.22/arch/i386/kernel/cpu/cyrix.c
===================================================================
@@ -169,7 +169,7 @@ static void __cpuinit set_cx86_inc(void)
 	setCx86(CX86_PCR1, getCx86(CX86_PCR1) | 0x02);
 	/* PCR0 -- Performance Control */
 	/* Incrementor Margin 10 */
-	setCx86(CX86_PCR0, getCx86(CX86_PCR0) | 0x04);
+	setCx86(CX86_PCR0, getCx86(CX86_PCR0) | 0x05);	/* 300MHz CPU */
 	setCx86(CX86_CCR3, ccr3);	/* disable MAPEN */
 }
 

This should be done at runtime in relation to the real CPU clock.

Hope it helps
Juergen

#7 lore raw

Thanks Juergen,

Quoted 3 lines

It runs stable on 5 different GX1 systems.

But I do not use a standard BIOS. I'm using LinuxBIOS instead. But I'm

also using

Quoted 2 lines

these patches.

set_cx86_inc was one of performance trick called by geode_configure I didn't find any documentation about "incrementor margin" before.

But since I'm running on 300MHz GX1 the default kernel is now broken for me!

arch/i386/kernel/cpu/cyrix.c static void __cpuinit set_cx86_inc(void) · line 175

Quoted 11 lines
arch/i386/kernel/cpu/cyrix.c +1 -1
@@ -169,7 +169,7 @@ static void __cpuinit set_cx86_inc(void)
  setCx86(CX86_PCR1, getCx86(CX86_PCR1) | 0x02);
  /* PCR0 -- Performance Control */
  /* Incrementor Margin 10 */
- setCx86(CX86_PCR0, getCx86(CX86_PCR0) | 0x04);
+ setCx86(CX86_PCR0, getCx86(CX86_PCR0) | 0x05); /* 300MHz CPU */
  setCx86(CX86_CCR3, ccr3); /* disable MAPEN */
 }
 

I will try your patch

But again, if those tricks are so system dependent I suggest to kernel people to let disable it in default configuration.

Marco

#8 lore raw

*SPAM* Re: kernel 2.6.23-rc6 hangs on Geode GX1

In reply to Juergen Beisert
Quoted 13 lines · Juergen Beisert

Index: linux-2.6.22/arch/i386/kernel/cpu/cyrix.c
===================================================================

arch/i386/kernel/cpu/cyrix.c +1 -1
@@ -169,7 +169,7 @@ static void __cpuinit set_cx86_inc(void)
 	setCx86(CX86_PCR1, getCx86(CX86_PCR1) | 0x02);
 	/* PCR0 -- Performance Control */
 	/* Incrementor Margin 10 */
-	setCx86(CX86_PCR0, getCx86(CX86_PCR0) | 0x04);
+	setCx86(CX86_PCR0, getCx86(CX86_PCR0) | 0x05);	/* 300MHz CPU */
 	setCx86(CX86_CCR3, ccr3);	/* disable MAPEN */
 }
 
Quoted 1 line

This should be done at runtime in relation to the real CPU clock.

Has someone an idea how I can read back CPUs clock while I'm in arch/i386/kernel/cpu/cyrix.c:set_cx86_inc() ? This incrementer setting must be done in relation to processor's clock. We could remove this tweaking as Marco suggested, or we must fix it to use the correct value.

Juergen

#9 lore raw
In reply to Juergen Beisert
Quoted 15 lines

Index: linux-2.6.22/arch/i386/kernel/cpu/cyrix.c
===================================================================

arch/i386/kernel/cpu/cyrix.c +1 -1
@@ -169,7 +169,7 @@ static void __cpuinit set_cx86_inc(void)
  setCx86(CX86_PCR1, getCx86(CX86_PCR1) | 0x02);
  /* PCR0 -- Performance Control */
  /* Incrementor Margin 10 */
- setCx86(CX86_PCR0, getCx86(CX86_PCR0) | 0x04);
+ setCx86(CX86_PCR0, getCx86(CX86_PCR0) | 0x05); /* 300MHz CPU */
  setCx86(CX86_CCR3, ccr3); /* disable MAPEN */
 }
 

This should be done at runtime in relation to the real CPU clock.

Quoted 3 lines

Hope it helps
Juergen

Your patch fix my issue
Thank you

Marco