Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] RBTX4927: linux-2.6.24-rc4 hang on boot
@ 2007-12-11 15:16 Frank Rowand
  2007-12-14  0:03 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Frank Rowand @ 2007-12-11 15:16 UTC (permalink / raw)
  To: linux-mips; +Cc: frank.rowand

In linux-2.6.24-rc4 the Toshiba RBTX4927 hangs on boot.

The cause is that plat_time_init() from arch/mips/tx4927/common/tx4927_setup.c
does not override the __weak plat_time_init() from arch/mips/kernel/time.c.
This is due to a compiler bug in gcc 4.1.1.  The bug is reported to not exist
in earlier versions of gcc, and to be fixed in 4.1.2.  The problem is that
the __weak plat_time_init() is empty and thus gets optimized out of
existence (thus the linker is never given the option to replace the
__weak function).

For more info on the gcc bug see

   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27781

The attached patch is one workaround.  Another possible workaround
would be to change the __weak plat_time_init() to be a non-empty
function.


Signed-off-by: Frank Rowand <frank.rowand@am.sony.com>

---
 arch/mips/kernel/Makefile |    4 	4 +	0 -	0 !
 1 files changed, 4 insertions(+)

Index: linux-2.6.24-rc4/arch/mips/kernel/Makefile
===================================================================
--- linux-2.6.24-rc4.orig/arch/mips/kernel/Makefile
+++ linux-2.6.24-rc4/arch/mips/kernel/Makefile
@@ -83,6 +83,10 @@ obj-$(CONFIG_EARLY_PRINTK)	+= early_prin
 
 CFLAGS_cpu-bugs64.o	= $(shell if $(CC) $(KBUILD_CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
 
+# workaround for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27781,
+# which impacts plat_time_init() for tx4927, gcc 4.1.1
+CFLAGS_time.o			+= -fno-unit-at-a-time
+
 obj-$(CONFIG_HAVE_STD_PC_SERIAL_PORT)	+= 8250-platform.o
 
 EXTRA_CFLAGS += -Werror

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

* Re: [PATCH] RBTX4927: linux-2.6.24-rc4 hang on boot
  2007-12-11 15:16 [PATCH] RBTX4927: linux-2.6.24-rc4 hang on boot Frank Rowand
@ 2007-12-14  0:03 ` Ralf Baechle
  0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2007-12-14  0:03 UTC (permalink / raw)
  To: Frank Rowand; +Cc: linux-mips

On Tue, Dec 11, 2007 at 10:16:27AM -0500, Frank Rowand wrote:

> In linux-2.6.24-rc4 the Toshiba RBTX4927 hangs on boot.
> 
> The cause is that plat_time_init() from arch/mips/tx4927/common/tx4927_setup.c
> does not override the __weak plat_time_init() from arch/mips/kernel/time.c.
> This is due to a compiler bug in gcc 4.1.1.  The bug is reported to not exist
> in earlier versions of gcc, and to be fixed in 4.1.2.  The problem is that
> the __weak plat_time_init() is empty and thus gets optimized out of
> existence (thus the linker is never given the option to replace the
> __weak function).

You meant the call to plat_time_init() from time_init() gets optimized away.

> For more info on the gcc bug see
> 
>    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27781
> 
> The attached patch is one workaround.  Another possible workaround
> would be to change the __weak plat_time_init() to be a non-empty
> function.

The __weak definition of plat_time_init was only ever meant to be a
migration helper to keep platforms that don't have a plat_time_init
compiling.  A few greps says that all platforms now supply their own
plat_time_init() so the weak definition is no longer needed.  So I
instead delete it.

  Ralf

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

end of thread, other threads:[~2007-12-14 12:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-11 15:16 [PATCH] RBTX4927: linux-2.6.24-rc4 hang on boot Frank Rowand
2007-12-14  0:03 ` Ralf Baechle

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