Bug 9394 - Suspend to RAM resume hangs with charging
Suspend to RAM resume hangs with charging
Status: CLOSED CODE_FIX
Product: Power Management
Classification: Unclassified
Component: Hibernation/Suspend
All Linux
: P1 normal
Assigned To: power-management_other
:
Depends on:
Blocks: 7216
  Show dependency treegraph
 
Reported: 2007-11-15 22:57 UTC by Sergey Smirnov
Modified: 2008-12-08 10:49 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.23
Tree: Mainline
Regression: Yes


Attachments

Description Sergey Smirnov 2007-11-15 22:57:06 UTC
Most recent kernel where this bug did not occur: 2.6.22
Distribution: Debian armel
Hardware Environment: ARM XScale-PXA255 (Zaurus C750)
Software Environment: Debian
Problem Description: PDA hangs if AC power pluged while suspend.
Steps to reproduce: Suspend while charging.

If HIGH_RES_TIMERS and NO_HZ PDA are set PDA always hangs while suspend.
If HIGH_RES_TIMERS and NO_HZ  aren't set PDA hangs with charge on while suspend.
Comment 1 Anonymous Emailer 2007-11-15 23:17:59 UTC
Reply-To: akpm@linux-foundation.org


(switched to email.  Please reply via emailed reply-to-all, not via the
bugzilla web interface)

(cc'ed linux-arm-kernel.  If you're not subscribed you'll get annoying
you're-not-a-subscriber messages.  Don't worry, the email will go through).


On Thu, 15 Nov 2007 22:57:06 -0800 (PST) bugme-daemon@bugzilla.kernel.org wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=9394
> 
>            Summary: Suspend to RAM resume hangs with charging
>            Product: Power Management
>            Version: 2.5
>      KernelVersion: 2.6.23
>           Platform: All
>         OS/Version: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: Hibernation/Suspend
>         AssignedTo: power-management_other@kernel-bugs.osdl.org
>         ReportedBy: svs1957@gmail.com
> 
> 
> Most recent kernel where this bug did not occur: 2.6.22
> Distribution: Debian armel
> Hardware Environment: ARM XScale-PXA255 (Zaurus C750)
> Software Environment: Debian
> Problem Description: PDA hangs if AC power pluged while suspend.
> Steps to reproduce: Suspend while charging.
> 
> If HIGH_RES_TIMERS and NO_HZ PDA are set PDA always hangs while suspend.
> If HIGH_RES_TIMERS and NO_HZ  aren't set PDA hangs with charge on while
> suspend.
> 


Comment 2 Anonymous Emailer 2007-11-16 11:56:28 UTC
Reply-To: linux@arm.linux.org.uk

On Thu, Nov 15, 2007 at 11:17:02PM -0800, Andrew Morton wrote:
> On Thu, 15 Nov 2007 22:57:06 -0800 (PST) bugme-daemon@bugzilla.kernel.org wrote:
> > http://bugzilla.kernel.org/show_bug.cgi?id=9394
> > 
> >            Summary: Suspend to RAM resume hangs with charging
> >            Product: Power Management
> >            Version: 2.5
> >      KernelVersion: 2.6.23
> >           Platform: All
> >         OS/Version: Linux
> >               Tree: Mainline
> >             Status: NEW
> >           Severity: normal
> >           Priority: P1
> >          Component: Hibernation/Suspend
> >         AssignedTo: power-management_other@kernel-bugs.osdl.org
> >         ReportedBy: svs1957@gmail.com
> > 
> > 
> > Most recent kernel where this bug did not occur: 2.6.22
> > Distribution: Debian armel
> > Hardware Environment: ARM XScale-PXA255 (Zaurus C750)
> > Software Environment: Debian
> > Problem Description: PDA hangs if AC power pluged while suspend.
> > Steps to reproduce: Suspend while charging.
> > 
> > If HIGH_RES_TIMERS and NO_HZ PDA are set PDA always hangs while suspend.
> > If HIGH_RES_TIMERS and NO_HZ  aren't set PDA hangs with charge on while
> > suspend.

Okay, thanks for entering this as a new report in bugzilla.  Can bug
#9229 be closed now?

Richard, any ideas how this can be debugged?

Comment 3 Richard Purdie 2007-11-18 14:50:31 UTC
On Fri, 2007-11-16 at 19:55 +0000, Russell King - ARM Linux wrote:
> On Thu, Nov 15, 2007 at 11:17:02PM -0800, Andrew Morton wrote:
> > On Thu, 15 Nov 2007 22:57:06 -0800 (PST) bugme-daemon@bugzilla.kernel.org wrote:
> > > http://bugzilla.kernel.org/show_bug.cgi?id=9394
> > > 
> > >            Summary: Suspend to RAM resume hangs with charging
> > >            Product: Power Management
> > >            Version: 2.5
> > >      KernelVersion: 2.6.23
> > >           Platform: All
> > >         OS/Version: Linux
> > >               Tree: Mainline
> > >             Status: NEW
> > >           Severity: normal
> > >           Priority: P1
> > >          Component: Hibernation/Suspend
> > >         AssignedTo: power-management_other@kernel-bugs.osdl.org
> > >         ReportedBy: svs1957@gmail.com
> > > 
> > > 
> > > Most recent kernel where this bug did not occur: 2.6.22
> > > Distribution: Debian armel
> > > Hardware Environment: ARM XScale-PXA255 (Zaurus C750)
> > > Software Environment: Debian
> > > Problem Description: PDA hangs if AC power pluged while suspend.
> > > Steps to reproduce: Suspend while charging.
> > > 
> > > If HIGH_RES_TIMERS and NO_HZ PDA are set PDA always hangs while suspend.
> > > If HIGH_RES_TIMERS and NO_HZ  aren't set PDA hangs with charge on while
> > > suspend.
> 
> Okay, thanks for entering this as a new report in bugzilla.  Can bug
> #9229 be closed now?
> 
> Richard, any ideas how this can be debugged?

Suspend/Resume is a pain to debug on the Zaurus. If you have a serial
lead for the device, you can hack the serial driver so its the last to
suspend and first to resume which will show if its some kernel fault
before the framebuffer resumes. It will also let you turn on debug for
the sharpsl power management code which is quite verbose/useful. Is a
serial lead available?

When charging the device will partially resume and then suspend again
periodically (every 10 minutes iirc). The question is when is it
suspending and resuming and at which point does it stop responding?

Beyond the serial output, I've resorted to turning LEDs on/off at
various code points to show where execution gets to in the past...

Is this a totally standard kernel or are you applying patches? Is so,
which ones?

FWIW, I've not been able to reproduce this on a pxa270 based zaurus
(spitz), I'll try and test my c760 which is a closer match to the
c750...

Richard


Comment 4 Richard Purdie 2007-11-18 17:18:56 UTC
On Fri, 2007-11-16 at 19:55 +0000, Russell King - ARM Linux wrote:
> On Thu, Nov 15, 2007 at 11:17:02PM -0800, Andrew Morton wrote:
> > On Thu, 15 Nov 2007 22:57:06 -0800 (PST) bugme-daemon@bugzilla.kernel.org wrote:
> > > http://bugzilla.kernel.org/show_bug.cgi?id=9394
> > > 
> > >            Summary: Suspend to RAM resume hangs with charging
> > >            Product: Power Management
> > >            Version: 2.5
> > >      KernelVersion: 2.6.23
> > >           Platform: All
> > >         OS/Version: Linux
> > >               Tree: Mainline
> > >             Status: NEW
> > >           Severity: normal
> > >           Priority: P1
> > >          Component: Hibernation/Suspend
> > >         AssignedTo: power-management_other@kernel-bugs.osdl.org
> > >         ReportedBy: svs1957@gmail.com
> > > 
> > > 
> > > Most recent kernel where this bug did not occur: 2.6.22
> > > Distribution: Debian armel
> > > Hardware Environment: ARM XScale-PXA255 (Zaurus C750)
> > > Software Environment: Debian
> > > Problem Description: PDA hangs if AC power pluged while suspend.
> > > Steps to reproduce: Suspend while charging.
> > > 
> > > If HIGH_RES_TIMERS and NO_HZ PDA are set PDA always hangs while suspend.
> > > If HIGH_RES_TIMERS and NO_HZ  aren't set PDA hangs with charge on while
> > > suspend.
> 
> Okay, thanks for entering this as a new report in bugzilla.  Can bug
> #9229 be closed now?
> 
> Richard, any ideas how this can be debugged?

A further update, 2.6.23 refuses to properly resume on my c760
regardless of charging state.

With HIGH_RES_TIMERS and NO_HZ enabled,
http://www.rpsys.net/openzaurus/patches/archive/sharpsl_pm_debug-r0.patch applied for debugging purposes, DEBUG defined for various sharpsl power management code and CONFIG_DISABLE_CONSOLE_SUSPEND enabled, I see:

sharpsl-pm sharpsl-pm: SharpSL suspending for first time.
sharpsl-pm sharpsl-pm: Time is: 4740bf61
sharpsl-pm sharpsl-pm: Offline Charge Activate = 0
sharpsl-pm sharpsl-pm: No alarms set.
sharpsl-pm sharpsl-pm: Corgi woken up from suspend: 00000001
sharpsl-pm sharpsl-pm: GPLR0 = 8d5f5b2a,1
sharpsl-pm sharpsl-pm: is_resume: 1
sharpsl-pm sharpsl-pm: sharpsl_fatal_check entered
sharpsl-pm sharpsl-pm: Average: 221 from values: 222, 221, 221, 221, 221
sharpsl-pm sharpsl-pm: sharpsl_fatal_check: acin: 1, discharge voltage:
221, no discharge: 221
sharpsl-pm sharpsl-pm: SharpSL resuming...
Resuming System Devices
Resuming type 'cpu':
 cpu0

which is from sysdev_resume() in drivers/base/sys.c. I put some printks
into the __sysdev_resume function and I never see them. I replaced the
pr_debug that prints "cpu0" with another printk and I see that instead,
if I add a bank of printks I only see the first one.

So the device resumes and executes code but eventually crashes after a
finite time. Interrupts are disabled at this point, I don't know if
that's significant?

I need some sleep, if anyone has anything they want me to test, let me
know. 

Also, I just tried with HIGH_RES_TIMERS and NO_HZ disabled and I see the
same problem...

Richard


Comment 5 Rafael J. Wysocki 2007-12-12 16:19:21 UTC
I have some patches against the current mainline that may help debug this problem.  The previous version is at:
http://www.sisk.pl/kernel/hibernation_and_suspend/2.6.24-rc4-git6/patches/
(patches 01-09 are the relevant ones).

After applying that there will be /sys/power/pm_test allowing you to test various stages of suspend/resume.
Comment 6 Sergey Smirnov 2007-12-13 07:04:22 UTC
Rafael, 
I install your patches on 2.6.24-rc5. But CONFIG_DISABLE_CONSOLE_SUSPEND was removed. I can't see anything because PDA doesn't resume.
Comment 7 Rafael J. Wysocki 2008-01-08 13:11:24 UTC
There is the kernel command line option 'no_console_suspend' instead of CONFIG_DISABLE_CONSOLE_SUSPEND.  Please use it.

Also, please build the kernel with CONFIG_PM_DEBUG set and (instead of suspending) do:

# echo core > /sys/power/pm_test
# echo mem > /sys/power/state

Instead of suspending, this will only make your box busy-wait for 5 sec. after doing all suspend preparations.
Comment 8 Zhang Rui 2008-11-19 23:12:04 UTC
ping Sergey,
please do the test in comment #7.
BTW, you'd better try 2.6.27 kernel first.
Comment 9 ykzhao 2008-12-04 01:18:39 UTC
It seems that this issue is related with the ARM platform. 
As it can work well on 2.6.22 kernel, will you please use git-bisect to identify which commit causes the regression?
Thanks.
Comment 10 ykzhao 2008-12-04 01:20:32 UTC
Hi, Sergey
    Will you please confirm whether the issue still exists on the latest kernel?
    
    If it still exists, please do the test as mentioned in comment #7,#9.
    thanks.
Comment 11 Sergey Smirnov 2008-12-08 10:35:10 UTC
Long time I didn't use my Zaurus. Sorry for delying.
I tested Zaurus SL-750 suspend with kernel 2.6.26.
Suspend while changing works.
I think the bus should be close.
--
Sergey

Note You need to log in before you can comment on or make changes to this bug.