All of lore.kernel.org
 help / color / mirror / Atom feed
* zaurus needs generic pxa suspend/resume routines
@ 2009-06-05 13:16 Pavel Machek
  2009-06-07 15:21 ` Russell King - ARM Linux
  0 siblings, 1 reply; 7+ messages in thread
From: Pavel Machek @ 2009-06-05 13:16 UTC (permalink / raw)
  To: rpurdie, lenz, kernel list, Russell King, Dirk, arminlitzel,
	Cyril Hrubis, thommycheck, linux-arm-kernel, dbaryshkov,
	omegamoon, patches
  Cc: linux-arm-kernel


For suspend/resume to work, spitz needs pxa_pm_suspend/resume to be
called. Otherwise PSPR is not set properly, and system will die during
resume.

Signed-off-by: Pavel Machek <pavel@ucw.cz> 

PATCH FOLLOWS
KernelVersion: 2.6.30-rc6

--- linux-rc/arch/arm.ofic/common/sharpsl_pm.c	2009-05-29 01:10:31.000000000 +0200
+++ linux-rc/arch/arm/common/sharpsl_pm.c	2009-06-02 15:33:11.000000000 +0200
@@ -553,7 +556,7 @@
 			corgi_goto_sleep(alarm_time, alarm_enable, state);
 			return 1;
 		}
-		if(sharpsl_off_charge_battery()) {
+		if (sharpsl_off_charge_battery()) {
 			dev_dbg(sharpsl_pm.dev, "Charging. Suspend...\n");
 			corgi_goto_sleep(alarm_time, alarm_enable, state);
 			return 1;
@@ -774,7 +777,9 @@
 }
 
 #ifdef CONFIG_PM
 static struct platform_suspend_ops sharpsl_pm_ops = {
+	.prepare	= pxa_pm_prepare,
+	.finish		= pxa_pm_finish,
 	.enter		= corgi_pxa_pm_enter,
 	.valid		= suspend_valid_only_mem,
 };
diff -ur linux-rc/arch/arm.ofic/mach-pxa/include/mach/pm.h linux-rc/arch/arm/mach-pxa/include/mach/pm.h
--- linux-rc/arch/arm.ofic/mach-pxa/include/mach/pm.h	2009-05-29 01:11:00.000000000 +0200
+++ linux-rc/arch/arm/mach-pxa/include/mach/pm.h	2009-06-02 15:39:50.000000000 +0200
@@ -27,6 +27,8 @@
 extern void pxa_cpu_resume(void);
 
 extern int pxa_pm_enter(suspend_state_t state);
+extern int pxa_pm_prepare(void);
+extern void pxa_pm_finish(void);
 
 /* NOTE: this is for PM debugging on Lubbock,  it's really a big
  * ugly, but let's keep the crap minimum here, instead of direct
diff -ur linux-rc/arch/arm.ofic/mach-pxa/pm.c linux-rc/arch/arm/mach-pxa/pm.c
--- linux-rc/arch/arm.ofic/mach-pxa/pm.c	2009-05-29 01:11:02.000000000 +0200
+++ linux-rc/arch/arm/mach-pxa/pm.c	2009-06-01 12:01:07.000000000 +0200
@@ -79,7 +84,7 @@
 	return -EINVAL;
 }
 
-static int pxa_pm_prepare(void)
+int pxa_pm_prepare(void)
 {
 	int ret = 0;
 
@@ -89,7 +94,7 @@
 	return ret;
 }
 
-static void pxa_pm_finish(void)
+void pxa_pm_finish(void)
 {
 	if (pxa_cpu_pm_fns && pxa_cpu_pm_fns->finish)
 		pxa_cpu_pm_fns->finish();

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: zaurus needs generic pxa suspend/resume routines
  2009-06-05 13:16 zaurus needs generic pxa suspend/resume routines Pavel Machek
@ 2009-06-07 15:21 ` Russell King - ARM Linux
  2009-06-08  6:58   ` Eric Miao
  0 siblings, 1 reply; 7+ messages in thread
From: Russell King - ARM Linux @ 2009-06-07 15:21 UTC (permalink / raw)
  To: Pavel Machek, eric miao
  Cc: rpurdie, lenz, kernel list, Dirk, arminlitzel, Cyril Hrubis,
	thommycheck, linux-arm-kernel, dbaryshkov, omegamoon

On Fri, Jun 05, 2009 at 03:16:25PM +0200, Pavel Machek wrote:
> For suspend/resume to work, spitz needs pxa_pm_suspend/resume to be
> called. Otherwise PSPR is not set properly, and system will die during
> resume.

100 points for copying lots of people.  0 points for omitting the right
person.  Add Eric.

Eric, ack?

> Signed-off-by: Pavel Machek <pavel@ucw.cz> 
> 
> PATCH FOLLOWS
> KernelVersion: 2.6.30-rc6
> 
> --- linux-rc/arch/arm.ofic/common/sharpsl_pm.c	2009-05-29 01:10:31.000000000 +0200
> +++ linux-rc/arch/arm/common/sharpsl_pm.c	2009-06-02 15:33:11.000000000 +0200
> @@ -553,7 +556,7 @@
>  			corgi_goto_sleep(alarm_time, alarm_enable, state);
>  			return 1;
>  		}
> -		if(sharpsl_off_charge_battery()) {
> +		if (sharpsl_off_charge_battery()) {
>  			dev_dbg(sharpsl_pm.dev, "Charging. Suspend...\n");
>  			corgi_goto_sleep(alarm_time, alarm_enable, state);
>  			return 1;
> @@ -774,7 +777,9 @@
>  }
>  
>  #ifdef CONFIG_PM
>  static struct platform_suspend_ops sharpsl_pm_ops = {
> +	.prepare	= pxa_pm_prepare,
> +	.finish		= pxa_pm_finish,
>  	.enter		= corgi_pxa_pm_enter,
>  	.valid		= suspend_valid_only_mem,
>  };
> diff -ur linux-rc/arch/arm.ofic/mach-pxa/include/mach/pm.h linux-rc/arch/arm/mach-pxa/include/mach/pm.h
> --- linux-rc/arch/arm.ofic/mach-pxa/include/mach/pm.h	2009-05-29 01:11:00.000000000 +0200
> +++ linux-rc/arch/arm/mach-pxa/include/mach/pm.h	2009-06-02 15:39:50.000000000 +0200
> @@ -27,6 +27,8 @@
>  extern void pxa_cpu_resume(void);
>  
>  extern int pxa_pm_enter(suspend_state_t state);
> +extern int pxa_pm_prepare(void);
> +extern void pxa_pm_finish(void);
>  
>  /* NOTE: this is for PM debugging on Lubbock,  it's really a big
>   * ugly, but let's keep the crap minimum here, instead of direct
> diff -ur linux-rc/arch/arm.ofic/mach-pxa/pm.c linux-rc/arch/arm/mach-pxa/pm.c
> --- linux-rc/arch/arm.ofic/mach-pxa/pm.c	2009-05-29 01:11:02.000000000 +0200
> +++ linux-rc/arch/arm/mach-pxa/pm.c	2009-06-01 12:01:07.000000000 +0200
> @@ -79,7 +84,7 @@
>  	return -EINVAL;
>  }
>  
> -static int pxa_pm_prepare(void)
> +int pxa_pm_prepare(void)
>  {
>  	int ret = 0;
>  
> @@ -89,7 +94,7 @@
>  	return ret;
>  }
>  
> -static void pxa_pm_finish(void)
> +void pxa_pm_finish(void)
>  {
>  	if (pxa_cpu_pm_fns && pxa_cpu_pm_fns->finish)
>  		pxa_cpu_pm_fns->finish();
> 
> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
> 
> -------------------------------------------------------------------
> List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
> FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
> Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

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

* Re: zaurus needs generic pxa suspend/resume routines
  2009-06-07 15:21 ` Russell King - ARM Linux
@ 2009-06-08  6:58   ` Eric Miao
  2009-06-08 16:19     ` Russell King - ARM Linux
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Miao @ 2009-06-08  6:58 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Pavel Machek, rpurdie, lenz, kernel list, Dirk, arminlitzel,
	Cyril Hrubis, thommycheck, linux-arm-kernel, dbaryshkov,
	omegamoon

On Sun, Jun 7, 2009 at 11:21 PM, Russell King - ARM
Linux<linux@arm.linux.org.uk> wrote:
> On Fri, Jun 05, 2009 at 03:16:25PM +0200, Pavel Machek wrote:
>> For suspend/resume to work, spitz needs pxa_pm_suspend/resume to be
>> called. Otherwise PSPR is not set properly, and system will die during
>> resume.
>
> 100 points for copying lots of people.  0 points for omitting the right
> person.  Add Eric.
>
> Eric, ack?
>

Yes, I think this is the best trade-off for the moment.

Acked-by: Eric Miao <eric.miao@marvell.com>

And Russell you may want to queue this for this -rc phase, looks
it's still -rc8-git5.

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

* Re: zaurus needs generic pxa suspend/resume routines
  2009-06-08  6:58   ` Eric Miao
@ 2009-06-08 16:19     ` Russell King - ARM Linux
  2009-06-09  1:43       ` Eric Miao
  0 siblings, 1 reply; 7+ messages in thread
From: Russell King - ARM Linux @ 2009-06-08 16:19 UTC (permalink / raw)
  To: Eric Miao
  Cc: Pavel Machek, rpurdie, lenz, kernel list, Dirk, arminlitzel,
	Cyril Hrubis, thommycheck, linux-arm-kernel, dbaryshkov,
	omegamoon

On Mon, Jun 08, 2009 at 02:58:54PM +0800, Eric Miao wrote:
> On Sun, Jun 7, 2009 at 11:21 PM, Russell King - ARM
> Linux<linux@arm.linux.org.uk> wrote:
> > On Fri, Jun 05, 2009 at 03:16:25PM +0200, Pavel Machek wrote:
> >> For suspend/resume to work, spitz needs pxa_pm_suspend/resume to be
> >> called. Otherwise PSPR is not set properly, and system will die during
> >> resume.
> >
> > 100 points for copying lots of people.  0 points for omitting the right
> > person.  Add Eric.
> >
> > Eric, ack?
> >
> 
> Yes, I think this is the best trade-off for the moment.
> 
> Acked-by: Eric Miao <eric.miao@marvell.com>
> 
> And Russell you may want to queue this for this -rc phase, looks
> it's still -rc8-git5.

I think it's missed .30, unless Linus does a -rc9.  I sent what was
probably my final pull request last night.

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

* Re: zaurus needs generic pxa suspend/resume routines
  2009-06-08 16:19     ` Russell King - ARM Linux
@ 2009-06-09  1:43       ` Eric Miao
  2009-06-09 10:50         ` Stanislav Brabec
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Miao @ 2009-06-09  1:43 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Pavel Machek, rpurdie, lenz, kernel list, Dirk, arminlitzel,
	Cyril Hrubis, thommycheck, linux-arm-kernel, dbaryshkov,
	omegamoon

On Tue, Jun 9, 2009 at 12:19 AM, Russell King - ARM
Linux<linux@arm.linux.org.uk> wrote:
> On Mon, Jun 08, 2009 at 02:58:54PM +0800, Eric Miao wrote:
>> On Sun, Jun 7, 2009 at 11:21 PM, Russell King - ARM
>> Linux<linux@arm.linux.org.uk> wrote:
>> > On Fri, Jun 05, 2009 at 03:16:25PM +0200, Pavel Machek wrote:
>> >> For suspend/resume to work, spitz needs pxa_pm_suspend/resume to be
>> >> called. Otherwise PSPR is not set properly, and system will die during
>> >> resume.
>> >
>> > 100 points for copying lots of people.  0 points for omitting the right
>> > person.  Add Eric.
>> >
>> > Eric, ack?
>> >
>>
>> Yes, I think this is the best trade-off for the moment.
>>
>> Acked-by: Eric Miao <eric.miao@marvell.com>
>>
>> And Russell you may want to queue this for this -rc phase, looks
>> it's still -rc8-git5.
>
> I think it's missed .30, unless Linus does a -rc9.  I sent what was
> probably my final pull request last night.
>

That should be fine. There are some other changes in my
'sharpsl_pm' branch, so I'd queue this patch for the next
merge window and make some adjustment.

-- 
Cheers
- eric

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

* Re: zaurus needs generic pxa suspend/resume routines
  2009-06-09  1:43       ` Eric Miao
@ 2009-06-09 10:50         ` Stanislav Brabec
  2009-06-09 22:09           ` Pavel Machek
  0 siblings, 1 reply; 7+ messages in thread
From: Stanislav Brabec @ 2009-06-09 10:50 UTC (permalink / raw)
  To: Eric Miao
  Cc: Russell King - ARM Linux, Pavel Machek, rpurdie, lenz,
	kernel list, Dirk, arminlitzel, Cyril Hrubis, thommycheck,
	linux-arm-kernel, dbaryshkov, omegamoon

Eric Miao wrote:

> >> Yes, I think this is the best trade-off for the moment.
> >>
> >> Acked-by: Eric Miao <eric.miao@marvell.com>
> >>

However resume still does not work with this patch on top of yesterday's
Linus tree snapshot (SL-C3200, ccc0d38). It seems to go to resume for
~300 milliseconds (orange LED lights for a moment, power consumption
increases) and then runs back to the sleep. It seems that it disables
offline charging, too. When battery cover switch is open it goes to
resume just for ~50 milliseconds (orange LED does not light).

The last Pavel's hack from last week at least fixed resume at cost of
breaking offline charging (and broken serial after resume).

-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                          e-mail: sbrabec@suse.cz
Lihovarská 1060/12           tel: +420 284 028 966, +49 911 740538747
190 00 Praha 9                                  fax: +420 284 028 951
Czech Republic                                    http://www.suse.cz/


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

* Re: zaurus needs generic pxa suspend/resume routines
  2009-06-09 10:50         ` Stanislav Brabec
@ 2009-06-09 22:09           ` Pavel Machek
  0 siblings, 0 replies; 7+ messages in thread
From: Pavel Machek @ 2009-06-09 22:09 UTC (permalink / raw)
  To: Stanislav Brabec
  Cc: Eric Miao, Russell King - ARM Linux, rpurdie, lenz, kernel list,
	Dirk, arminlitzel, Cyril Hrubis, thommycheck, linux-arm-kernel,
	dbaryshkov, omegamoon

On Tue 2009-06-09 12:50:00, Stanislav Brabec wrote:
> Eric Miao wrote:
> 
> > >> Yes, I think this is the best trade-off for the moment.
> > >>
> > >> Acked-by: Eric Miao <eric.miao@marvell.com>
> > >>
> 
> However resume still does not work with this patch on top of yesterday's
> Linus tree snapshot (SL-C3200, ccc0d38). It seems to go to resume for
> ~300 milliseconds (orange LED lights for a moment, power consumption
> increases) and then runs back to the sleep. It seems that it disables
> offline charging, too. When battery cover switch is open it goes to
> resume just for ~50 milliseconds (orange LED does not light).

Yes, the patch fixes just the "cpu registers not set correctly"
problem. Problem with charging remains. Unfortunately, I do have
patch to fix that, yet. (Yes, it can be worked around by disabling
offline charge, but that is not a fix).

> The last Pavel's hack from last week at least fixed resume at cost of
> breaking offline charging (and broken serial after resume).

Hmm, do you have a serial cable? :-).
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

end of thread, other threads:[~2009-06-09 22:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-05 13:16 zaurus needs generic pxa suspend/resume routines Pavel Machek
2009-06-07 15:21 ` Russell King - ARM Linux
2009-06-08  6:58   ` Eric Miao
2009-06-08 16:19     ` Russell King - ARM Linux
2009-06-09  1:43       ` Eric Miao
2009-06-09 10:50         ` Stanislav Brabec
2009-06-09 22:09           ` Pavel Machek

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.