All of lore.kernel.org
 help / color / mirror / Atom feed
* ARM: CONFIG_FRAME_POINTER
@ 2009-05-12 21:46 Hunter, Jon
  2009-05-12 23:33 ` Kevin Hilman
  0 siblings, 1 reply; 12+ messages in thread
From: Hunter, Jon @ 2009-05-12 21:46 UTC (permalink / raw)
  To: linux-omap

Hi All,

I have been doing some testing with the latest linux-omap kernel on the 3430sdp and the kernel appeared to hang on start-up during the delay loop calibration. 

After debugging this I found that this was being caused because there was a difference in the compilation flags being used when compiling this kernel version and an earlier kernel version. Please note that I am using the code sourcery arm2007q3 compiler version (gcc 4.2.1) which is old I know!

Investigating further I noticed that the source of the different kernel compilation flags was due to the fact that kernel option "CONFIG_FRAME_POINTER" was missing from the .config. Although this is declared in the defconfig for the 3430sdp but it was not getting copied over to the .config.

Looking at the lib/Kconfig.debug it appears that there is a new option added back in January called "ARCH_WANT_FRAME_POINTERS" [1]. And only if this new option is defined in the ARCH Kconfig will CONFIG_FRAME_POINTER be used. Today this is not defined for ARM. 

I know this is the linux-omap list and not linux-arm but wanted to see if anyone had any comments/inputs about this and whether I should be using a newer compiler. 

[1] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=64dec40ddee9d36d7b83f8a0513fdeaffe260a0e;hp=a3c6018e565dc07cf3738ace6bbe412f97b1bba8 

Cheers
Jon 

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

* Re: ARM: CONFIG_FRAME_POINTER
  2009-05-12 21:46 ARM: CONFIG_FRAME_POINTER Hunter, Jon
@ 2009-05-12 23:33 ` Kevin Hilman
  2009-05-13  3:09   ` Woodruff, Richard
  2009-05-13 15:42   ` Hunter, Jon
  0 siblings, 2 replies; 12+ messages in thread
From: Kevin Hilman @ 2009-05-12 23:33 UTC (permalink / raw)
  To: Hunter, Jon; +Cc: linux-omap

"Hunter, Jon" <jon-hunter@ti.com> writes:

> I have been doing some testing with the latest linux-omap kernel on
> the 3430sdp and the kernel appeared to hang on start-up during the
> delay loop calibration.
>
> After debugging this I found that this was being caused because
> there was a difference in the compilation flags being used when
> compiling this kernel version and an earlier kernel version. Please
> note that I am using the code sourcery arm2007q3 compiler version
> (gcc 4.2.1) which is old I know!

There was a thread a few weeks back where various folks had noticed
this as well and we discovered using CodeSourcery 2008q3 fixed the
problem, but AFAIK, nobody went much farther in the debugging as you
did.

> Investigating further I noticed that the source of the different
> kernel compilation flags was due to the fact that kernel option
> "CONFIG_FRAME_POINTER" was missing from the .config. Although this
> is declared in the defconfig for the 3430sdp but it was not getting
> copied over to the .config.
>
> Looking at the lib/Kconfig.debug it appears that there is a new
> option added back in January called "ARCH_WANT_FRAME_POINTERS"
> [1]. And only if this new option is defined in the ARCH Kconfig will
> CONFIG_FRAME_POINTER be used. Today this is not defined for ARM.
>
> I know this is the linux-omap list and not linux-arm but wanted to
> see if anyone had any comments/inputs about this and whether I
> should be using a newer compiler.
>
> [1] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=64dec40ddee9d36d7b83f8a0513fdeaffe260a0e;hp=a3c6018e565dc07cf3738ace6bbe412f97b1bba8 

Did a similar patch for ARM get you a booting kernel using 2007q3?

Kevin

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

* RE: ARM: CONFIG_FRAME_POINTER
  2009-05-12 23:33 ` Kevin Hilman
@ 2009-05-13  3:09   ` Woodruff, Richard
  2009-05-13 15:48     ` Hunter, Jon
  2009-05-13 15:42   ` Hunter, Jon
  1 sibling, 1 reply; 12+ messages in thread
From: Woodruff, Richard @ 2009-05-13  3:09 UTC (permalink / raw)
  To: Kevin Hilman, Hunter, Jon; +Cc: linux-omap


> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
> owner@vger.kernel.org] On Behalf Of Kevin Hilman
> Sent: Tuesday, May 12, 2009 6:33 PM
> To: Hunter, Jon

> There was a thread a few weeks back where various folks had noticed
> this as well and we discovered using CodeSourcery 2008q3 fixed the
> problem, but AFAIK, nobody went much farther in the debugging as you
> did.

I did take a quick look at generated code and found parameters were destroyed to tick code.  This caused the timer interrupts to not come.  This resulted in the hang.

If you follow the link and look at attached png you clearly see compiler issue.  I also provided a hack which allowed it to work.  Probably FRAME pointer changes code generation to get rid of issue.

http://marc.info/?l=linux-omap&m=124027585911690&w=2

Regards,
Richard W.

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

* RE: ARM: CONFIG_FRAME_POINTER
  2009-05-12 23:33 ` Kevin Hilman
  2009-05-13  3:09   ` Woodruff, Richard
@ 2009-05-13 15:42   ` Hunter, Jon
  2009-05-13 16:37     ` Kevin Hilman
  1 sibling, 1 reply; 12+ messages in thread
From: Hunter, Jon @ 2009-05-13 15:42 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: linux-omap

Hi Kevin,
 
> Did a similar patch for ARM get you a booting kernel using 2007q3?

Yes, the changes needed are the following to get it booting with 2007q3 on the omap3430sdp were the following. Unfortunately it took 4 hours to figure this out and so wanted to share. 

Do you think that the below change should be incorporate in the arch/arm/Kconfig?

Cheers
Jon


diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 079aa6a..c61bafb 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -18,6 +18,7 @@ config ARM
        select HAVE_KRETPROBES if (HAVE_KPROBES)
        select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
        select HAVE_GENERIC_DMA_COHERENT
+       select ARCH_WANT_FRAME_POINTERS
        help
          The ARM series is a line of low-power-consumption RISC chip designs
          licensed by ARM Ltd and targeted at embedded applications and
diff --git a/arch/arm/configs/omap_3430sdp_defconfig b/arch/arm/configs/omap_3430sdp_defconfig
index b686f34..1bff450 100644
--- a/arch/arm/configs/omap_3430sdp_defconfig
+++ b/arch/arm/configs/omap_3430sdp_defconfig
@@ -1387,6 +1387,7 @@ CONFIG_DEBUG_INFO=y
 # CONFIG_DEBUG_MEMORY_INIT is not set
 # CONFIG_DEBUG_LIST is not set
 # CONFIG_DEBUG_SG is not set
+CONFIG_ARCH_WANT_FRAME_POINTERS=y
 CONFIG_FRAME_POINTER=y
 # CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set

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

* RE: ARM: CONFIG_FRAME_POINTER
  2009-05-13  3:09   ` Woodruff, Richard
@ 2009-05-13 15:48     ` Hunter, Jon
  2009-05-13 15:55       ` Woodruff, Richard
  0 siblings, 1 reply; 12+ messages in thread
From: Hunter, Jon @ 2009-05-13 15:48 UTC (permalink / raw)
  To: Woodruff, Richard, Kevin Hilman; +Cc: linux-omap

Hi Richard,

> If you follow the link and look at attached png you clearly see compiler
> issue.  I also provided a hack which allowed it to work.  Probably FRAME
> pointer changes code generation to get rid of issue.

Right, with CONFIG_FRAME_POINTER defined the following compiler flags are defined in the top-level Makefile. 

ifdef CONFIG_FRAME_POINTER
KBUILD_CFLAGS   += -fno-omit-frame-pointer -fno-optimize-sibling-calls
else
KBUILD_CFLAGS   += -fomit-frame-pointer
Endif

I believe that this was the difference. 

Cheers
Jon

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

* RE: ARM: CONFIG_FRAME_POINTER
  2009-05-13 15:48     ` Hunter, Jon
@ 2009-05-13 15:55       ` Woodruff, Richard
  2009-05-13 16:06         ` Hunter, Jon
  0 siblings, 1 reply; 12+ messages in thread
From: Woodruff, Richard @ 2009-05-13 15:55 UTC (permalink / raw)
  To: Hunter, Jon, Kevin Hilman; +Cc: linux-omap

Hi Jon,

> From: Hunter, Jon
> Sent: Wednesday, May 13, 2009 10:48 AM

> KBUILD_CFLAGS   += -fno-omit-frame-pointer -fno-optimize-sibling-calls

Ok so -fno-optimize-sibling-calls is busted in older compiler.

I wonder if there are other reasons for the exclusion of this optimization in kernel code.  Would be interesting to google and see.  There might be 3 other reasons it is needed in addition to one we tripped over.

Regards,
Richard W.

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

* RE: ARM: CONFIG_FRAME_POINTER
  2009-05-13 15:55       ` Woodruff, Richard
@ 2009-05-13 16:06         ` Hunter, Jon
  2009-05-13 16:10           ` Woodruff, Richard
  0 siblings, 1 reply; 12+ messages in thread
From: Hunter, Jon @ 2009-05-13 16:06 UTC (permalink / raw)
  To: Woodruff, Richard, Kevin Hilman; +Cc: linux-omap

Hi Richard,

> Ok so -fno-optimize-sibling-calls is busted in older compiler.

I am not sure that -fno-optimize-sibling-calls is busted as it appears that with this option it worked with the old compiler. 

However, I should note that I never confirmed if the issue was caused by having -fno-omit-frame-pointer versus -fomit-frame-pointer or the omission of the option -fno-optimize-sibling-calls. 

So basically, I am saying that having the following allows it to work.

KBUILD_CFLAGS   += -fno-omit-frame-pointer -fno-optimize-sibling-calls

Cheers
Jon

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

* RE: ARM: CONFIG_FRAME_POINTER
  2009-05-13 16:06         ` Hunter, Jon
@ 2009-05-13 16:10           ` Woodruff, Richard
  0 siblings, 0 replies; 12+ messages in thread
From: Woodruff, Richard @ 2009-05-13 16:10 UTC (permalink / raw)
  To: Hunter, Jon, Kevin Hilman; +Cc: linux-omap

> > Ok so -fno-optimize-sibling-calls is busted in older compiler.
>
> I am not sure that -fno-optimize-sibling-calls is busted as it appears that
> with this option it worked with the old compiler.

I wrote poorly.  The optimize-sibling-calls optimization probably is busted for this compiler.  By shutting off optimization with -no<xyz> good code is generated.

I still wonder if there were other points in addition to parameter destruction.

Thanks.
Richard W.

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

* Re: ARM: CONFIG_FRAME_POINTER
  2009-05-13 15:42   ` Hunter, Jon
@ 2009-05-13 16:37     ` Kevin Hilman
  2009-05-13 18:05       ` Hunter, Jon
  0 siblings, 1 reply; 12+ messages in thread
From: Kevin Hilman @ 2009-05-13 16:37 UTC (permalink / raw)
  To: Hunter, Jon; +Cc: linux-omap

"Hunter, Jon" <jon-hunter@ti.com> writes:

> Hi Kevin,
>  
>> Did a similar patch for ARM get you a booting kernel using 2007q3?
>
> Yes, the changes needed are the following to get it booting with 2007q3 on the omap3430sdp were the following. Unfortunately it took 4 hours to figure this out and so wanted to share. 
>
> Do you think that the below change should be incorporate in the arch/arm/Kconfig?
>

Yes.  Do you mind sending a patch to linux-arm-kernel?

Kevin

>
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 079aa6a..c61bafb 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -18,6 +18,7 @@ config ARM
>         select HAVE_KRETPROBES if (HAVE_KPROBES)
>         select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
>         select HAVE_GENERIC_DMA_COHERENT
> +       select ARCH_WANT_FRAME_POINTERS
>         help
>           The ARM series is a line of low-power-consumption RISC chip designs
>           licensed by ARM Ltd and targeted at embedded applications and
> diff --git a/arch/arm/configs/omap_3430sdp_defconfig b/arch/arm/configs/omap_3430sdp_defconfig
> index b686f34..1bff450 100644
> --- a/arch/arm/configs/omap_3430sdp_defconfig
> +++ b/arch/arm/configs/omap_3430sdp_defconfig
> @@ -1387,6 +1387,7 @@ CONFIG_DEBUG_INFO=y
>  # CONFIG_DEBUG_MEMORY_INIT is not set
>  # CONFIG_DEBUG_LIST is not set
>  # CONFIG_DEBUG_SG is not set
> +CONFIG_ARCH_WANT_FRAME_POINTERS=y
>  CONFIG_FRAME_POINTER=y
>  # CONFIG_BOOT_PRINTK_DELAY is not set
>  # CONFIG_RCU_TORTURE_TEST is not set

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

* RE: ARM: CONFIG_FRAME_POINTER
  2009-05-13 16:37     ` Kevin Hilman
@ 2009-05-13 18:05       ` Hunter, Jon
  2009-05-13 18:09         ` Kevin Hilman
  0 siblings, 1 reply; 12+ messages in thread
From: Hunter, Jon @ 2009-05-13 18:05 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: linux-omap

Hi Kevin,

> Yes.  Do you mind sending a patch to linux-arm-kernel?

Sure. Does Russell King maintain a git tree for linux-arm or do you have any advice which tree I should use to base a patch on for the linux-arm folks? 

Cheers
Jon

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

* Re: ARM: CONFIG_FRAME_POINTER
  2009-05-13 18:05       ` Hunter, Jon
@ 2009-05-13 18:09         ` Kevin Hilman
  2009-05-13 19:16           ` Hunter, Jon
  0 siblings, 1 reply; 12+ messages in thread
From: Kevin Hilman @ 2009-05-13 18:09 UTC (permalink / raw)
  To: Hunter, Jon; +Cc: linux-omap

"Hunter, Jon" <jon-hunter@ti.com> writes:

> Hi Kevin,
>
>> Yes.  Do you mind sending a patch to linux-arm-kernel?
>
> Sure. Does Russell King maintain a git tree for linux-arm or do you
> have any advice which tree I should use to base a patch on for the
> linux-arm folks?

Just base it at Linus' master branch or the latest -rc tag.

Kevin

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

* RE: ARM: CONFIG_FRAME_POINTER
  2009-05-13 18:09         ` Kevin Hilman
@ 2009-05-13 19:16           ` Hunter, Jon
  0 siblings, 0 replies; 12+ messages in thread
From: Hunter, Jon @ 2009-05-13 19:16 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: linux-omap

Hi Kevin,

> Just base it at Linus' master branch or the latest -rc tag.

Thanks. Patch sent. My post appears to be in a holding location as I am not a member of the linux-arm mailing list. I will let you know if I get any feedback. 

By the way, I found out that the real culprit of this problem was the following change:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=64dec40ddee9d36d7b83f8a0513fdeaffe260a0e;hp=a3c6018e565dc07cf3738ace6bbe412f97b1bba8

Cheers
Jon 

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

end of thread, other threads:[~2009-05-13 19:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-12 21:46 ARM: CONFIG_FRAME_POINTER Hunter, Jon
2009-05-12 23:33 ` Kevin Hilman
2009-05-13  3:09   ` Woodruff, Richard
2009-05-13 15:48     ` Hunter, Jon
2009-05-13 15:55       ` Woodruff, Richard
2009-05-13 16:06         ` Hunter, Jon
2009-05-13 16:10           ` Woodruff, Richard
2009-05-13 15:42   ` Hunter, Jon
2009-05-13 16:37     ` Kevin Hilman
2009-05-13 18:05       ` Hunter, Jon
2009-05-13 18:09         ` Kevin Hilman
2009-05-13 19:16           ` Hunter, Jon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.