* [PATCH -mm] console: console_drivers not initialized
@ 2006-09-25 21:07 dwalker
2006-09-25 21:11 ` Russell King
0 siblings, 1 reply; 6+ messages in thread
From: dwalker @ 2006-09-25 21:07 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel
I was doing -rt stuff on a PPC PowerBook G4. It would always reboot
itself when it hit console_init() .
I noticed that the console code seems to want console_drivers = NULL,
but it never actually sets it that way. Once I added this, the reboot
issue was gone..
Signed-Off-By: Daniel Walker <dwalker@mvista.com>
Index: linux-2.6.18/kernel/printk.c
===================================================================
--- linux-2.6.18.orig/kernel/printk.c
+++ linux-2.6.18/kernel/printk.c
@@ -68,7 +68,7 @@ EXPORT_SYMBOL(oops_in_progress);
*/
static DECLARE_MUTEX(console_sem);
static DECLARE_MUTEX(secondary_console_sem);
-struct console *console_drivers;
+struct console *console_drivers = NULL;
/*
* This is used for debugging the mess that is the VT code by
* keeping track if we have the console semaphore held. It's
--
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -mm] console: console_drivers not initialized
2006-09-25 21:07 [PATCH -mm] console: console_drivers not initialized dwalker
@ 2006-09-25 21:11 ` Russell King
2006-09-25 21:26 ` Daniel Walker
0 siblings, 1 reply; 6+ messages in thread
From: Russell King @ 2006-09-25 21:11 UTC (permalink / raw)
To: dwalker; +Cc: akpm, linux-kernel
On Mon, Sep 25, 2006 at 02:07:10PM -0700, dwalker@mvista.com wrote:
> I was doing -rt stuff on a PPC PowerBook G4. It would always reboot
> itself when it hit console_init() .
>
> I noticed that the console code seems to want console_drivers = NULL,
> but it never actually sets it that way. Once I added this, the reboot
> issue was gone..
It's a BSS variable, it _should_ be zeroed by the architecture's BSS
initialisation. If not, it suggests there's something very _very_
wrong in the architecture's C runtime initialisation code.
As such, this patch is merely a band-aid, not a correct fix.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -mm] console: console_drivers not initialized
2006-09-25 21:11 ` Russell King
@ 2006-09-25 21:26 ` Daniel Walker
2006-09-25 21:30 ` Russell King
2006-09-25 21:42 ` Andrew Morton
0 siblings, 2 replies; 6+ messages in thread
From: Daniel Walker @ 2006-09-25 21:26 UTC (permalink / raw)
To: Russell King; +Cc: akpm, linux-kernel
On Mon, 2006-09-25 at 22:11 +0100, Russell King wrote:
> On Mon, Sep 25, 2006 at 02:07:10PM -0700, dwalker@mvista.com wrote:
> > I was doing -rt stuff on a PPC PowerBook G4. It would always reboot
> > itself when it hit console_init() .
> >
> > I noticed that the console code seems to want console_drivers = NULL,
> > but it never actually sets it that way. Once I added this, the reboot
> > issue was gone..
>
> It's a BSS variable, it _should_ be zeroed by the architecture's BSS
> initialisation. If not, it suggests there's something very _very_
> wrong in the architecture's C runtime initialisation code.
>
> As such, this patch is merely a band-aid, not a correct fix.
It happens on two different compilers gcc 4.1 and 3.3 .. I was using
arch/powerpc/ which is fairly new .. However, If stuff was suppose to be
zero'd and wasn't, I'd imagine this machine would be rebooting _a lot_
more often.
Daniel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -mm] console: console_drivers not initialized
2006-09-25 21:26 ` Daniel Walker
@ 2006-09-25 21:30 ` Russell King
2006-09-25 21:42 ` Andrew Morton
1 sibling, 0 replies; 6+ messages in thread
From: Russell King @ 2006-09-25 21:30 UTC (permalink / raw)
To: Daniel Walker; +Cc: akpm, linux-kernel
On Mon, Sep 25, 2006 at 02:26:21PM -0700, Daniel Walker wrote:
> On Mon, 2006-09-25 at 22:11 +0100, Russell King wrote:
> > On Mon, Sep 25, 2006 at 02:07:10PM -0700, dwalker@mvista.com wrote:
> > > I was doing -rt stuff on a PPC PowerBook G4. It would always reboot
> > > itself when it hit console_init() .
> > >
> > > I noticed that the console code seems to want console_drivers = NULL,
> > > but it never actually sets it that way. Once I added this, the reboot
> > > issue was gone..
> >
> > It's a BSS variable, it _should_ be zeroed by the architecture's BSS
> > initialisation. If not, it suggests there's something very _very_
> > wrong in the architecture's C runtime initialisation code.
> >
> > As such, this patch is merely a band-aid, not a correct fix.
>
> It happens on two different compilers gcc 4.1 and 3.3 ..
The zeroing of the BSS is not a function of the compiler, but the C startup
code, which might be written in assembly or c.
> I was using
> arch/powerpc/ which is fairly new .. However, If stuff was suppose to be
> zero'd and wasn't, I'd imagine this machine would be rebooting _a lot_
> more often.
The alternative explaination is that explicitly changing a variable from
the BSS to have an explicit initialisation moves it into the data segment,
which results in quite a bit of data moving around. So it might not even
be related to this - maybe a data structure alignment issue somewhere?
Shrug - but it's for powerpc folk to investigate.
Suggest you report it to powerpc folk as a bug.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -mm] console: console_drivers not initialized
2006-09-25 21:26 ` Daniel Walker
2006-09-25 21:30 ` Russell King
@ 2006-09-25 21:42 ` Andrew Morton
2006-09-26 5:13 ` Paul Mackerras
1 sibling, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2006-09-25 21:42 UTC (permalink / raw)
To: Daniel Walker; +Cc: Russell King, linux-kernel
On Mon, 25 Sep 2006 14:26:21 -0700
Daniel Walker <dwalker@mvista.com> wrote:
> On Mon, 2006-09-25 at 22:11 +0100, Russell King wrote:
> > On Mon, Sep 25, 2006 at 02:07:10PM -0700, dwalker@mvista.com wrote:
> > > I was doing -rt stuff on a PPC PowerBook G4. It would always reboot
> > > itself when it hit console_init() .
> > >
> > > I noticed that the console code seems to want console_drivers = NULL,
> > > but it never actually sets it that way. Once I added this, the reboot
> > > issue was gone..
> >
> > It's a BSS variable, it _should_ be zeroed by the architecture's BSS
> > initialisation. If not, it suggests there's something very _very_
> > wrong in the architecture's C runtime initialisation code.
> >
> > As such, this patch is merely a band-aid, not a correct fix.
>
> It happens on two different compilers gcc 4.1 and 3.3 .. I was using
> arch/powerpc/ which is fairly new .. However, If stuff was suppose to be
> zero'd and wasn't, I'd imagine this machine would be rebooting _a lot_
> more often.
>
What Russell said. If the arch startup code isn't correctly zeroing bss
then that's pretty badly busted.
The other possibility is that something is accidentally overwriting this
variable. The explicit initialisation will cause the compiler to move this
variable into a different linker section, so now some other variable will
be getting corrupted.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -mm] console: console_drivers not initialized
2006-09-25 21:42 ` Andrew Morton
@ 2006-09-26 5:13 ` Paul Mackerras
0 siblings, 0 replies; 6+ messages in thread
From: Paul Mackerras @ 2006-09-26 5:13 UTC (permalink / raw)
To: Andrew Morton; +Cc: Daniel Walker, Russell King, linux-kernel
Andrew Morton writes:
> What Russell said. If the arch startup code isn't correctly zeroing bss
> then that's pretty badly busted.
Indeed. We do actually zero the BSS on startup. :)
Paul.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-09-26 5:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-25 21:07 [PATCH -mm] console: console_drivers not initialized dwalker
2006-09-25 21:11 ` Russell King
2006-09-25 21:26 ` Daniel Walker
2006-09-25 21:30 ` Russell King
2006-09-25 21:42 ` Andrew Morton
2006-09-26 5:13 ` Paul Mackerras
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.