2009-01-19 12:53:45

by Ferenc Wagner

[permalink] [raw]
Subject: 2.6.29-rc2 dies on startup

Hi,

I'm running 2.6.28 without problems. I decided to give 2.6.29-rc2 a
try. It crashes very early during boot, see screenshot, config and lspci
under http://apt.niif.hu/2.6.29-rc2/. CPU is AMD Athlon(tm) XP 1800+,
kernel command line: root=/dev/hda1 ro. I fixed the pcf50663 compile
error by hand, and have a small patch on /drivers/acpi/battery.c, but
that module isn't loaded on this system. I can hook up a serial
console for further info if needed.
--
Regards,
Feri.


2009-01-26 06:46:52

by Andrew Morton

[permalink] [raw]
Subject: Re: 2.6.29-rc2 dies on startup

On Mon, 19 Jan 2009 13:53:31 +0100 Ferenc Wagner <[email protected]> wrote:

> Hi,
>
> I'm running 2.6.28 without problems. I decided to give 2.6.29-rc2 a
> try. It crashes very early during boot, see screenshot, config and lspci
> under http://apt.niif.hu/2.6.29-rc2/. CPU is AMD Athlon(tm) XP 1800+,
> kernel command line: root=/dev/hda1 ro. I fixed the pcf50663 compile
> error by hand, and have a small patch on /drivers/acpi/battery.c, but
> that module isn't loaded on this system. I can hook up a serial
> console for further info if needed.

What a ghastly backtrace.

At a guess I'd say that drivers/staging/android/ram_console.c is calling
the reed-solomon code earlier than it's expecting. But that might be
totally wrong.

Please set CONFIG_STAGING=n and retest.

2009-01-27 00:30:11

by Arve Hjønnevåg

[permalink] [raw]
Subject: Re: 2.6.29-rc2 dies on startup

On Sun, Jan 25, 2009 at 10:46 PM, Andrew Morton
<[email protected]> wrote:
> At a guess I'd say that drivers/staging/android/ram_console.c is calling
> the reed-solomon code earlier than it's expecting. But that might be
> totally wrong.

Yes, but it also is trying to use a zero sized buffer at virtual
address 0 so it will not work much better if you turn off ecc.

This patch (to the android kernel tree) add some validation:
----
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 0ce27ab..b226ccc 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -525,7 +525,6 @@ menuconfig ANDROID_RAM_CONSOLE_ERROR_CORRECTION
bool "Enable error correction"
default n
depends on ANDROID_RAM_CONSOLE
- depends on !ANDROID_RAM_CONSOLE_EARLY_INIT
select REED_SOLOMON
select REED_SOLOMON_ENC8
select REED_SOLOMON_DEC8
diff --git a/drivers/misc/ram_console.c b/drivers/misc/ram_console.c
index 2a1274b..aec20f7 100644
--- a/drivers/misc/ram_console.c
+++ b/drivers/misc/ram_console.c
@@ -224,23 +224,9 @@ static int __init ram_console_init(struct
ram_console_buffer *buffer,
ram_console_buffer_size =
buffer_size - sizeof(struct ram_console_buffer);

- if (ram_console_buffer_size > buffer_size) {
- pr_err("ram_console: buffer %p, invalid size %d, datasize %d\n",
- buffer, buffer_size, ram_console_buffer_size);
- return 0;
- }
-
-
#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
ram_console_buffer_size -= (DIV_ROUND_UP(ram_console_buffer_size,
ECC_BLOCK_SIZE) + 1) * ECC_SIZE;
- if (ram_console_buffer_size > buffer_size) {
- pr_err("ram_console: buffer %p, invalid size %d, "
- "non-ecc datasize %d\n",
- buffer, buffer_size, ram_console_buffer_size);
- return 0;
- }
-
ram_console_par_buffer = buffer->data + ram_console_buffer_size;


----

--
Arve Hj?nnev?g

2009-01-27 16:53:59

by Andrew Morton

[permalink] [raw]
Subject: Re: 2.6.29-rc2 dies on startup

On Tue, 27 Jan 2009 17:10:47 +0100 Ferenc Wagner <[email protected]> wrote:

> Andrew Morton <[email protected]> writes:
>
> > On Mon, 19 Jan 2009 13:53:31 +0100 Ferenc Wagner <[email protected]> wrote:
> >
> >> I'm running 2.6.28 without problems. I decided to give 2.6.29-rc2 a
> >> try. It crashes very early during boot, see screenshot, config and lspci
> >> under http://apt.niif.hu/2.6.29-rc2/. CPU is AMD Athlon(tm) XP 1800+,
> >> kernel command line: root=/dev/hda1 ro. I fixed the pcf50663 compile
> >> error by hand, and have a small patch on /drivers/acpi/battery.c, but
> >> that module isn't loaded on this system. I can hook up a serial
> >> console for further info if needed.
> >
> > What a ghastly backtrace.
> >
> > At a guess I'd say that drivers/staging/android/ram_console.c is calling
> > the reed-solomon code earlier than it's expecting. But that might be
> > totally wrong.
> >
> > Please set CONFIG_STAGING=n and retest.
>
> Indeed, with CONFIG_STAGING unset the kernel boots up fine! Before
> testing I pulled again, set CONFIG_CLASSIC_RCU=y and
> CONFIG_FRAME_POINTER=y, but the resulting kernel still crashed (serial
> log attached). Then I unset CONFIG_STAGING and that worked.

Thanks.

> Should I also test Arve's patch?

I'm sure he'd be pleased ;)

2009-01-27 17:16:20

by Ferenc Wagner

[permalink] [raw]
Subject: Re: 2.6.29-rc2 dies on startup

Arve Hjønnevåg <[email protected]> writes:

> On Sun, Jan 25, 2009 at 10:46 PM, Andrew Morton
> <[email protected]> wrote:
>
>> At a guess I'd say that drivers/staging/android/ram_console.c is calling
>> the reed-solomon code earlier than it's expecting. But that might be
>> totally wrong.
>
> Yes, but it also is trying to use a zero sized buffer at virtual
> address 0 so it will not work much better if you turn off ecc.

This sounds understandable given that the defaults are

CONFIG_ANDROID_RAM_CONSOLE_EARLY_ADDR=0x0
CONFIG_ANDROID_RAM_CONSOLE_EARLY_SIZE=0x0

> This patch (to the android kernel tree) add some validation:

Compiling it now (on the vanilla tree).
--
Regards,
Feri.

2009-01-28 11:34:22

by Ferenc Wagner

[permalink] [raw]
Subject: Re: 2.6.29-rc2 dies on startup

Ferenc Wagner <[email protected]> writes:

> Arve Hjønnevåg <[email protected]> writes:
>
>> On Sun, Jan 25, 2009 at 10:46 PM, Andrew Morton
>> <[email protected]> wrote:
>>
>>> At a guess I'd say that drivers/staging/android/ram_console.c is calling
>>> the reed-solomon code earlier than it's expecting. But that might be
>>> totally wrong.
>>
>> Yes, but it also is trying to use a zero sized buffer at virtual
>> address 0 so it will not work much better if you turn off ecc.
>
> This sounds understandable given that the defaults are
>
> CONFIG_ANDROID_RAM_CONSOLE_EARLY_ADDR=0x0
> CONFIG_ANDROID_RAM_CONSOLE_EARLY_SIZE=0x0
>
>> This patch (to the android kernel tree) add some validation:
>
> Compiling it now (on the vanilla tree).

Fine, this patch helps. Instead of

[ 0.000000] Detected 1536.828 MHz processor.
[ 0.004000] Console: colour VGA+ 80x25
[ 0.004000] console [ttyS0] enabled
[ 0.004000] BUG: unable to handle kernel paging request at f000e816
[ 0.004000] IP: [<c0190b5c>] kmem_cache_alloc+0x2d/0x95
[...]

now I get

[ 0.000000] Detected 1537.027 MHz processor.
[ 0.004000] Console: colour VGA+ 80x25
[ 0.004000] console [tty0] enabled
[ 0.004000] ram_console: buffer (null), invalid size 0, datasize -12
[ 0.004000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[...]
--
Thanks,
Feri.

2009-01-31 03:42:19

by Greg KH

[permalink] [raw]
Subject: Re: 2.6.29-rc2 dies on startup

On Mon, Jan 26, 2009 at 04:29:55PM -0800, Arve Hj?nnev?g wrote:
> On Sun, Jan 25, 2009 at 10:46 PM, Andrew Morton
> <[email protected]> wrote:
> > At a guess I'd say that drivers/staging/android/ram_console.c is calling
> > the reed-solomon code earlier than it's expecting. But that might be
> > totally wrong.
>
> Yes, but it also is trying to use a zero sized buffer at virtual
> address 0 so it will not work much better if you turn off ecc.
>
> This patch (to the android kernel tree) add some validation:

<snip>

Care to redo this for the current tree so that I can apply it?

thanks,

greg k-h

2009-01-31 04:21:27

by Arve Hjønnevåg

[permalink] [raw]
Subject: [PATCH] ram_console: Disable ECC when early init is enabled and validate buffer size

Signed-off-by: Arve Hjønnevåg <[email protected]>
---
drivers/staging/android/Kconfig | 1 +
drivers/staging/android/ram_console.c | 14 ++++++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
index 6b996db..604bd1e 100644
--- a/drivers/staging/android/Kconfig
+++ b/drivers/staging/android/Kconfig
@@ -27,6 +27,7 @@ menuconfig ANDROID_RAM_CONSOLE_ERROR_CORRECTION
bool "Android RAM Console Enable error correction"
default n
depends on ANDROID_RAM_CONSOLE
+ depends on !ANDROID_RAM_CONSOLE_EARLY_INIT
select REED_SOLOMON
select REED_SOLOMON_ENC8
select REED_SOLOMON_DEC8
diff --git a/drivers/staging/android/ram_console.c b/drivers/staging/android/ram_console.c
index bf00685..643ac5c 100644
--- a/drivers/staging/android/ram_console.c
+++ b/drivers/staging/android/ram_console.c
@@ -224,9 +224,23 @@ static int __init ram_console_init(struct ram_console_buffer *buffer,
ram_console_buffer_size =
buffer_size - sizeof(struct ram_console_buffer);

+ if (ram_console_buffer_size > buffer_size) {
+ pr_err("ram_console: buffer %p, invalid size %d, datasize %d\n",
+ buffer, buffer_size, ram_console_buffer_size);
+ return 0;
+ }
+
#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
ram_console_buffer_size -= (DIV_ROUND_UP(ram_console_buffer_size,
ECC_BLOCK_SIZE) + 1) * ECC_SIZE;
+
+ if (ram_console_buffer_size > buffer_size) {
+ pr_err("ram_console: buffer %p, invalid size %d, "
+ "non-ecc datasize %d\n",
+ buffer, buffer_size, ram_console_buffer_size);
+ return 0;
+ }
+
ram_console_par_buffer = buffer->data + ram_console_buffer_size;


--
1.6.1