2005-11-03 09:10:43

by Patrizio Bassi

[permalink] [raw]
Subject: 2.6.14-git4 suspend fails: kernel NULL pointer dereference

echo shutdown > /sys/power/disk
echo disk > /sys/power/state

Unable to handle kernel NULL pointer dereference at virtual address 00000004
printing eip:
c0132a5e
*pde = 00000000
Oops: 0000 [#1]
Modules linked in:
CPU: 0
EIP: 0060:[<c0132a5e>] Not tainted VLI
EFLAGS: 00010286 (2.6.14-git4)
EIP is at enter_state+0xe/0x90
eax: 00000000 ebx: c03b1178 ecx: ffffffff edx: d1c25000
esi: 00000004 edi: c03b117c ebp: 00000004 esp: ddf09ef0
ds: 007b es: 007b ss: 0068
Process bash (pid: 21862, threadinfo=ddf08000 task=dcf9b540)
Stack: c03e82cc c03b1178 d1c25004 c0132c4c 00000004 00000004 00000000
00000001
c03e7de0 c03e7e34 ddf09fa4 b7d4c000 c018c6d7 c03e7de0 d1c25000
00000005
c03eb460 c018c97e c03e7df0 c03e7e34 d1c25000 00000005 d62d4c60
d3ef8980
Call Trace:
[<c0132c4c>] state_store+0x9c/0xaf
[<c018c6d7>] subsys_attr_store+0x37/0x40
[<c018c97e>] flush_write_buffer+0x3e/0x50
[<c018c9e9>] sysfs_write_file+0x59/0x80
[<c0155f8c>] vfs_write+0x14c/0x160
[<c0156071>] sys_write+0x51/0x80
[<c0102cbf>] sysenter_past_esp+0x54/0x75
Code: ff 50 10 e8 75 04 00 00 58 5b e9 ce 05 00 00 8d b4 26 00 00 00 00
8d bc 27 00 00 00 00 56 53 83 ec 04 a1 00 e0 48 c0 8b 74 24 10 <8b> 58
04 85 db 75 52 ff 0d a0 7d 3e c0 0f 88 0e 02 00 00 31 c0



i had 2.6.14-rc2-git4 working, didn't try other rc releases.


2005-11-07 17:10:31

by Pavel Machek

[permalink] [raw]
Subject: Re: 2.6.14-git4 suspend fails: kernel NULL pointer dereference

Hi!

> echo shutdown > /sys/power/disk
> echo disk > /sys/power/state
>
> Unable to handle kernel NULL pointer dereference at virtual address 00000004
> printing eip:
> EIP: 0060:[<c0132a5e>] Not tainted VLI
> EFLAGS: 00010286 (2.6.14-git4)
> EIP is at enter_state+0xe/0x90

It works for me, with pretty recent tree. But I see a potential
problem there, you are not using ACPI, right?

I think it is caused by this commit:

commit eb9289eb20df6b54214c45ac7c6bf5179a149026
tree dac51cecdd94e0c7273c990259ddd800057311b9
parent 0245b3e787dc3267a915e1f56419e7e9c197e148
author Shaohua Li <[email protected]> Sun, 30 Oct 2005 15:00:01
-0800
committer Linus Torvalds <[email protected]> Sun, 30 Oct 2005
17:37:15 -0800

[PATCH] introduce .valid callback for pm_ops

Add pm_ops.valid callback, so only the available pm states show in
/sys/power/state. And this also makes an earlier states error
report at
enter_state before we do actual suspend/resume.

Try this patch.

Pavel

diff --git a/kernel/power/main.c b/kernel/power/main.c
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -167,7 +167,7 @@ static int enter_state(suspend_state_t s
{
int error;

- if (pm_ops->valid && !pm_ops->valid(state))
+ if (pm_ops && pm_ops->valid && !pm_ops->valid(state))
return -ENODEV;
if (down_trylock(&pm_sem))
return -EBUSY;


--
Thanks, Sharp!

2005-11-07 18:04:24

by Patrizio Bassi

[permalink] [raw]
Subject: Re: 2.6.14-git4 suspend fails: kernel NULL pointer dereference

Pavel Machek ha scritto:

>Hi!
>
>
>
>>echo shutdown > /sys/power/disk
>>echo disk > /sys/power/state
>>
>>Unable to handle kernel NULL pointer dereference at virtual address 00000004
>> printing eip:
>>EIP: 0060:[<c0132a5e>] Not tainted VLI
>>EFLAGS: 00010286 (2.6.14-git4)
>>EIP is at enter_state+0xe/0x90
>>
>>
>
>It works for me, with pretty recent tree. But I see a potential
>problem there, you are not using ACPI, right?
>
>I think it is caused by this commit:
>
>commit eb9289eb20df6b54214c45ac7c6bf5179a149026
>tree dac51cecdd94e0c7273c990259ddd800057311b9
>parent 0245b3e787dc3267a915e1f56419e7e9c197e148
>author Shaohua Li <[email protected]> Sun, 30 Oct 2005 15:00:01
>-0800
>committer Linus Torvalds <[email protected]> Sun, 30 Oct 2005
>17:37:15 -0800
>
> [PATCH] introduce .valid callback for pm_ops
>
> Add pm_ops.valid callback, so only the available pm states show in
> /sys/power/state. And this also makes an earlier states error
>report at
> enter_state before we do actual suspend/resume.
>
>Try this patch.
>
> Pavel
>
>diff --git a/kernel/power/main.c b/kernel/power/main.c
>--- a/kernel/power/main.c
>+++ b/kernel/power/main.c
>@@ -167,7 +167,7 @@ static int enter_state(suspend_state_t s
> {
> int error;
>
>- if (pm_ops->valid && !pm_ops->valid(state))
>+ if (pm_ops && pm_ops->valid && !pm_ops->valid(state))
> return -ENODEV;
> if (down_trylock(&pm_sem))
> return -EBUSY;
>
>
>
>


i'm using ACPI.
i'?ll try the patch and report asap.

Patrizio

2005-11-07 18:07:23

by Pavel Machek

[permalink] [raw]
Subject: Re: 2.6.14-git4 suspend fails: kernel NULL pointer dereference

Hi!

> >diff --git a/kernel/power/main.c b/kernel/power/main.c
> >--- a/kernel/power/main.c
> >+++ b/kernel/power/main.c
> >@@ -167,7 +167,7 @@ static int enter_state(suspend_state_t s
> > {
> > int error;
> >
> >- if (pm_ops->valid && !pm_ops->valid(state))
> >+ if (pm_ops && pm_ops->valid && !pm_ops->valid(state))
> > return -ENODEV;
> > if (down_trylock(&pm_sem))
> > return -EBUSY;
> >
> >
> >
> >
>
>
> i'm using ACPI.
> i'?ll try the patch and report asap.

ok, not sure what is going on, then. Fill enter_state() with printks()
so that we know where it fails... then kill klogd before attempting
suspend.
Pavel
--
Thanks, Sharp!

2005-11-08 00:51:05

by Shaohua Li

[permalink] [raw]
Subject: Re: 2.6.14-git4 suspend fails: kernel NULL pointer dereference

On Mon, 2005-11-07 at 17:47 +0100, Pavel Machek wrote:
> Hi!
>
> > echo shutdown > /sys/power/disk
> > echo disk > /sys/power/state
> >
> > Unable to handle kernel NULL pointer dereference at virtual address 00000004
> > printing eip:
> > EIP: 0060:[<c0132a5e>] Not tainted VLI
> > EFLAGS: 00010286 (2.6.14-git4)
> > EIP is at enter_state+0xe/0x90
>
> It works for me, with pretty recent tree. But I see a potential
> problem there, you are not using ACPI, right?
>
It's my bad. Thanks for fixing this, Pavel. Maybe patrizio didn't enable
ACPI sleep.

Thanks,
Shaohua

2005-11-08 07:50:27

by Patrizio Bassi

[permalink] [raw]
Subject: Re: 2.6.14-git4 suspend fails: kernel NULL pointer dereference

Pavel Machek ha scritto:

>Hi!
>
>
>
>>>diff --git a/kernel/power/main.c b/kernel/power/main.c
>>>--- a/kernel/power/main.c
>>>+++ b/kernel/power/main.c
>>>@@ -167,7 +167,7 @@ static int enter_state(suspend_state_t s
>>>{
>>> int error;
>>>
>>>- if (pm_ops->valid && !pm_ops->valid(state))
>>>+ if (pm_ops && pm_ops->valid && !pm_ops->valid(state))
>>> return -ENODEV;
>>> if (down_trylock(&pm_sem))
>>> return -EBUSY;
>>>
>>>
>>>
>>>
>>>
>>>
>>i'm using ACPI.
>>i'?ll try the patch and report asap.
>>
>>
>
>ok, not sure what is going on, then. Fill enter_state() with printks()
>so that we know where it fails... then kill klogd before attempting
>suspend.
> Pavel
>
>
that **seems** to be fixed, even if i run ACPI.

now i have

Stopping tasks:
===============================================================|
Freeing memory... done (42120 pages freed)
usbfs 2-2:1.0: no suspend?
Could not suspend device 2-2: error -16
Some devices failed to suspend
Restarting tasks... done

this was fixed by a patch Len Brown gave me privatly.
it's due to a pci-usb card.
it seems has not been applied yet.
can you notify him? he knows :)

good job.

Patrizio

2005-11-08 07:53:05

by Patrizio Bassi

[permalink] [raw]
Subject: Re: 2.6.14-git4 suspend fails: kernel NULL pointer dereference

Shaohua Li ha scritto:

>On Mon, 2005-11-07 at 17:47 +0100, Pavel Machek wrote:
>
>
>>Hi!
>>
>>
>>
>>>echo shutdown > /sys/power/disk
>>>echo disk > /sys/power/state
>>>
>>>Unable to handle kernel NULL pointer dereference at virtual address 00000004
>>> printing eip:
>>>EIP: 0060:[<c0132a5e>] Not tainted VLI
>>>EFLAGS: 00010286 (2.6.14-git4)
>>>EIP is at enter_state+0xe/0x90
>>>
>>>
>>It works for me, with pretty recent tree. But I see a potential
>>problem there, you are not using ACPI, right?
>>
>>
>>
>It's my bad. Thanks for fixing this, Pavel. Maybe patrizio didn't enable
>ACPI sleep.
>
>Thanks,
>Shaohua
>
>
>
>
no i hadn't.

#
# ACPI (Advanced Configuration and Power Interface) Support
#
CONFIG_ACPI=y
# CONFIG_ACPI_SLEEP is not set
# CONFIG_ACPI_AC is not set
# CONFIG_ACPI_BATTERY is not set
CONFIG_ACPI_BUTTON=y
# CONFIG_ACPI_VIDEO is not set
# CONFIG_ACPI_HOTKEY is not set
# CONFIG_ACPI_FAN is not set
# CONFIG_ACPI_PROCESSOR is not set
# CONFIG_ACPI_ASUS is not set
# CONFIG_ACPI_IBM is not set
# CONFIG_ACPI_TOSHIBA is not set
# CONFIG_ACPI_CUSTOM_DSDT is not set
CONFIG_ACPI_BLACKLIST_YEAR=0
# CONFIG_ACPI_DEBUG is not set
CONFIG_ACPI_EC=y
CONFIG_ACPI_POWER=y
CONFIG_ACPI_SYSTEM=y
# CONFIG_X86_PM_TIMER is not set
# CONFIG_ACPI_CONTAINER is not set

#
# APM (Advanced Power Management) BIOS Support
#
# CONFIG_APM is not set


2005-11-08 09:13:09

by Pavel Machek

[permalink] [raw]
Subject: Re: 2.6.14-git4 suspend fails: kernel NULL pointer dereference

Hi!

> > > echo shutdown > /sys/power/disk
> > > echo disk > /sys/power/state
> > >
> > > Unable to handle kernel NULL pointer dereference at virtual address 00000004
> > > printing eip:
> > > EIP: 0060:[<c0132a5e>] Not tainted VLI
> > > EFLAGS: 00010286 (2.6.14-git4)
> > > EIP is at enter_state+0xe/0x90
> >
> > It works for me, with pretty recent tree. But I see a potential
> > problem there, you are not using ACPI, right?

> It's my bad. Thanks for fixing this, Pavel. Maybe patrizio didn't enable
> ACPI sleep.

Will you take care of pushing that patch to mainline?
Pavel
--
Thanks, Sharp!

2005-11-08 15:20:04

by Patrizio Bassi

[permalink] [raw]
Subject: Re: 2.6.14-git4 suspend fails: kernel NULL pointer dereference

Pavel Machek ha scritto:

>Hi!
>
>
>
>>>>echo shutdown > /sys/power/disk
>>>>echo disk > /sys/power/state
>>>>
>>>>Unable to handle kernel NULL pointer dereference at virtual address 00000004
>>>> printing eip:
>>>>EIP: 0060:[<c0132a5e>] Not tainted VLI
>>>>EFLAGS: 00010286 (2.6.14-git4)
>>>>EIP is at enter_state+0xe/0x90
>>>>
>>>>
>>>It works for me, with pretty recent tree. But I see a potential
>>>problem there, you are not using ACPI, right?
>>>
>>>
>
>
>
>>It's my bad. Thanks for fixing this, Pavel. Maybe patrizio didn't enable
>>ACPI sleep.
>>
>>
>
>Will you take care of pushing that patch to mainline?
> Pavel
>
>
i'm so sorry, had a hd problem, i've only got the compiled vmlinux

:(((

infact i seached to apply to vanilla kernel.

however Len Brown told me he would have applied such patch for 2.6.15

please contact him

Patrizio

2005-11-09 14:24:38

by Pavel Machek

[permalink] [raw]
Subject: Re: 2.6.14-git4 suspend fails: kernel NULL pointer dereference

Hi!

> >>It's my bad. Thanks for fixing this, Pavel. Maybe patrizio didn't enable
> >>ACPI sleep.
> >>
> >>
> >
> >Will you take care of pushing that patch to mainline?

> i'm so sorry, had a hd problem, i've only got the compiled vmlinux
>
> :(((

That's okay, I was talking to Shaohua. It has already been taken
care of.
Pavel
--
Thanks, Sharp!

2005-11-09 15:48:36

by Patrizio Bassi

[permalink] [raw]
Subject: Re: 2.6.14-git4 suspend fails: kernel NULL pointer dereference

Pavel Machek ha scritto:

>Hi!
>
>
>
>>>>It's my bad. Thanks for fixing this, Pavel. Maybe patrizio didn't enable
>>>>ACPI sleep.
>>>>
>>>>
>>>>
>>>>
>>>Will you take care of pushing that patch to mainline?
>>>
>>>
>
>
>
>>i'm so sorry, had a hd problem, i've only got the compiled vmlinux
>>
>>:(((
>>
>>
>
>That's okay, I was talking to Shaohua. It has already been taken
>care of.
> Pavel
>
>
ok,

please notice me when it gets merged in a git release, so i can test.

Patrizio