2007-09-27 15:11:24

by Marco Tralli

[permalink] [raw]
Subject: kernel 2.6.23-rc6 hangs on Geode GX1

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


2007-09-27 15:26:39

by R. J. Wysocki

[permalink] [raw]
Subject: Re: kernel 2.6.23-rc6 hangs on Geode GX1

On Thursday, 27 September 2007 16:44, Marco Tralli wrote:
> 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

2007-09-27 15:26:51

by Jordan Crouse

[permalink] [raw]
Subject: Re: kernel 2.6.23-rc6 hangs on Geode GX1

On 27/09/07 17:30 +0200, R. J. Wysocki wrote:
> On Thursday, 27 September 2007 16:44, Marco Tralli wrote:
> > 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

--
Jordan Crouse
Systems Software Development Engineer
Advanced Micro Devices, Inc.


2007-09-27 15:50:56

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: kernel 2.6.23-rc6 hangs on Geode GX1

On Thursday, 27 September 2007 17:22, Jordan Crouse wrote:
> On 27/09/07 17:30 +0200, R. J. Wysocki wrote:
> > On Thursday, 27 September 2007 16:44, Marco Tralli wrote:
> > > 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.

Well, I'd check anyway. :-)

Greetings,
Rafael

2007-09-27 16:09:29

by Marco Tralli

[permalink] [raw]
Subject: Re: kernel 2.6.23-rc6 hangs on Geode GX1

> On 27/09/07 17:30 +0200, R. J. Wysocki wrote:
> > On Thursday, 27 September 2007 16:44, Marco Tralli wrote:
> > > 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.
>


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

2007-09-27 16:13:38

by Juergen Beisert

[permalink] [raw]
Subject: Re: kernel 2.6.23-rc6 hangs on Geode GX1

Hi AMrco,

On Thursday 27 September 2007 16:44, Marco Tralli wrote:
> 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?)

Seems so.

> 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:

Index: linux-2.6.22/arch/i386/kernel/cpu/cyrix.c
===================================================================
--- linux-2.6.22.orig/arch/i386/kernel/cpu/cyrix.c
+++ 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:

Index: linux-2.6.22/arch/i386/kernel/cpu/cyrix.c
===================================================================
--- linux-2.6.22.orig/arch/i386/kernel/cpu/cyrix.c
+++ 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

2007-09-27 16:22:37

by Marco Tralli

[permalink] [raw]
Subject: Re: kernel 2.6.23-rc6 hangs on Geode GX1

> On Thursday, 27 September 2007 17:22, Jordan Crouse wrote:
> > On 27/09/07 17:30 +0200, R. J. Wysocki wrote:
> > > On Thursday, 27 September 2007 16:44, Marco Tralli wrote:
> > > > 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.
>
> 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

2007-09-27 16:35:18

by Marco Tralli

[permalink] [raw]
Subject: Re: kernel 2.6.23-rc6 hangs on Geode GX1

Thanks Juergen,

> 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.
>

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!


> --- linux-2.6.22.orig/arch/i386/kernel/cpu/cyrix.c
> +++ 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 */
> }
>

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

2007-09-28 08:34:07

by Juergen Beisert

[permalink] [raw]
Subject: *SPAM* Re: kernel 2.6.23-rc6 hangs on Geode GX1

On Thursday 27 September 2007 18:13, Juergen Beisert wrote:
> Index: linux-2.6.22/arch/i386/kernel/cpu/cyrix.c
> ===================================================================
> --- linux-2.6.22.orig/arch/i386/kernel/cpu/cyrix.c
> +++ 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.

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

2007-09-28 08:36:25

by Marco Tralli

[permalink] [raw]
Subject: Re: kernel 2.6.23-rc6 hangs on Geode GX1

> Index: linux-2.6.22/arch/i386/kernel/cpu/cyrix.c
> ===================================================================
> --- linux-2.6.22.orig/arch/i386/kernel/cpu/cyrix.c
> +++ 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
>

Your patch fix my issue
Thank you

Marco