linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* PowerMac: force only suspend-to-disk to be valid
@ 2006-05-02  9:31 Johannes Berg
  2006-05-25 10:05 ` Johannes Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2006-05-02  9:31 UTC (permalink / raw)
  To: linuxppc-dev list

This patch adds the .valid callback to pm_ops on PowerMac so that only the
suspend to disk state can be entered. Note that just returning 0 would
suffice since the upper layers don't pass PM_SUSPEND_DISK down, but I think
they ought to be passing it down since they do really need support (or
am I mistaken again?) so we handle it there regardless.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>

--- wireless-dev.orig/arch/powerpc/platforms/powermac/setup.c	2006-05-02 10:57:32.101509438 +0200
+++ wireless-dev/arch/powerpc/platforms/powermac/setup.c	2006-05-02 10:58:44.491509438 +0200
@@ -463,11 +463,23 @@ static int pmac_pm_finish(suspend_state_
 	return 0;
 }
 
+static int pmac_pm_valid(suspend_state_t state)
+{
+	switch (state) {
+	case PM_SUSPEND_DISK:
+		return 1;
+	/* can't do any other states via generic mechanism yet */
+	default:
+		return 0;
+	}
+}
+
 static struct pm_ops pmac_pm_ops = {
 	.pm_disk_mode	= PM_DISK_SHUTDOWN,
 	.prepare	= pmac_pm_prepare,
 	.enter		= pmac_pm_enter,
 	.finish		= pmac_pm_finish,
+	.valid		= pmac_pm_valid,
 };
 
 #endif /* CONFIG_SOFTWARE_SUSPEND */

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

* Re: PowerMac: force only suspend-to-disk to be valid
  2006-05-02  9:31 PowerMac: force only suspend-to-disk to be valid Johannes Berg
@ 2006-05-25 10:05 ` Johannes Berg
  2006-05-25 14:05   ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2006-05-25 10:05 UTC (permalink / raw)
  To: linuxppc-dev list; +Cc: Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 1446 bytes --]

On Tue, 2006-05-02 at 11:31 +0200, Johannes Berg wrote:
> This patch adds the .valid callback to pm_ops on PowerMac so that only the
> suspend to disk state can be entered. Note that just returning 0 would
> suffice since the upper layers don't pass PM_SUSPEND_DISK down, but I think
> they ought to be passing it down since they do really need support (or
> am I mistaken again?) so we handle it there regardless.

No one ever seemed to care about this patch, can we queue it up for
2.6.18? I suppose it's too late now for 2.6.17 even if it fixes the
long-standing but that on ppc, /sys/power/state kills the machine.

[quoted patch for reference]

> --- wireless-dev.orig/arch/powerpc/platforms/powermac/setup.c	2006-05-02 10:57:32.101509438 +0200
> +++ wireless-dev/arch/powerpc/platforms/powermac/setup.c	2006-05-02 10:58:44.491509438 +0200
> @@ -463,11 +463,23 @@ static int pmac_pm_finish(suspend_state_
>  	return 0;
>  }
>  
> +static int pmac_pm_valid(suspend_state_t state)
> +{
> +	switch (state) {
> +	case PM_SUSPEND_DISK:
> +		return 1;
> +	/* can't do any other states via generic mechanism yet */
> +	default:
> +		return 0;
> +	}
> +}
> +
>  static struct pm_ops pmac_pm_ops = {
>  	.pm_disk_mode	= PM_DISK_SHUTDOWN,
>  	.prepare	= pmac_pm_prepare,
>  	.enter		= pmac_pm_enter,
>  	.finish		= pmac_pm_finish,
> +	.valid		= pmac_pm_valid,
>  };
>  
>  #endif /* CONFIG_SOFTWARE_SUSPEND */


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]

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

* Re: PowerMac: force only suspend-to-disk to be valid
  2006-05-25 10:05 ` Johannes Berg
@ 2006-05-25 14:05   ` Andrew Morton
  2006-05-25 14:10     ` Andrew Morton
  2006-05-25 23:11     ` Benjamin Herrenschmidt
  0 siblings, 2 replies; 6+ messages in thread
From: Andrew Morton @ 2006-05-25 14:05 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linuxppc-dev

Johannes Berg <johannes@sipsolutions.net> wrote:
>
> On Tue, 2006-05-02 at 11:31 +0200, Johannes Berg wrote:
> > This patch adds the .valid callback to pm_ops on PowerMac so that only the
> > suspend to disk state can be entered. Note that just returning 0 would
> > suffice since the upper layers don't pass PM_SUSPEND_DISK down, but I think
> > they ought to be passing it down since they do really need support (or
> > am I mistaken again?) so we handle it there regardless.
> 
> No one ever seemed to care about this patch,

I don't recall having seen it before.

> can we queue it up for
> 2.6.18? I suppose it's too late now for 2.6.17 even if it fixes the
> long-standing but that on ppc, /sys/power/state kills the machine.
> 
> [quoted patch for reference]
> 
> > --- wireless-dev.orig/arch/powerpc/platforms/powermac/setup.c	2006-05-02 10:57:32.101509438 +0200
> > +++ wireless-dev/arch/powerpc/platforms/powermac/setup.c	2006-05-02 10:58:44.491509438 +0200
> > @@ -463,11 +463,23 @@ static int pmac_pm_finish(suspend_state_
> >  	return 0;
> >  }
> >  
> > +static int pmac_pm_valid(suspend_state_t state)
> > +{
> > +	switch (state) {
> > +	case PM_SUSPEND_DISK:
> > +		return 1;
> > +	/* can't do any other states via generic mechanism yet */
> > +	default:
> > +		return 0;
> > +	}
> > +}
> > +
> >  static struct pm_ops pmac_pm_ops = {
> >  	.pm_disk_mode	= PM_DISK_SHUTDOWN,
> >  	.prepare	= pmac_pm_prepare,
> >  	.enter		= pmac_pm_enter,
> >  	.finish		= pmac_pm_finish,
> > +	.valid		= pmac_pm_valid,
> >  };
> >  
> >  #endif /* CONFIG_SOFTWARE_SUSPEND */
> 

It looks like a 2.6.17 patch to me.  If someone wants to send it over with
changelog, signed-off-by, etc I can take care of it.

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

* Re: PowerMac: force only suspend-to-disk to be valid
  2006-05-25 14:05   ` Andrew Morton
@ 2006-05-25 14:10     ` Andrew Morton
  2006-05-25 14:13       ` Johannes Berg
  2006-05-25 23:11     ` Benjamin Herrenschmidt
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2006-05-25 14:10 UTC (permalink / raw)
  To: johannes, linuxppc-dev, benh

Andrew Morton <akpm@osdl.org> wrote:
>
> > > +static int pmac_pm_valid(suspend_state_t state)
>  > > +{
>  > > +	switch (state) {
>  > > +	case PM_SUSPEND_DISK:
>  > > +		return 1;
>  > > +	/* can't do any other states via generic mechanism yet */
>  > > +	default:
>  > > +		return 0;
>  > > +	}
>  > > +}
>  > > +
>  > >  static struct pm_ops pmac_pm_ops = {
>  > >  	.pm_disk_mode	= PM_DISK_SHUTDOWN,
>  > >  	.prepare	= pmac_pm_prepare,
>  > >  	.enter		= pmac_pm_enter,
>  > >  	.finish		= pmac_pm_finish,
>  > > +	.valid		= pmac_pm_valid,
>  > >  };
>  > >  
>  > >  #endif /* CONFIG_SOFTWARE_SUSPEND */
>  > 
> 
>  It looks like a 2.6.17 patch to me.  If someone wants to send it over with
>  changelog, signed-off-by, etc I can take care of it.
> 

Please also explain whether this fix is needed in 2.6.16.x.

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

* Re: PowerMac: force only suspend-to-disk to be valid
  2006-05-25 14:10     ` Andrew Morton
@ 2006-05-25 14:13       ` Johannes Berg
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2006-05-25 14:13 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 319 bytes --]

On Thu, 2006-05-25 at 07:10 -0700, Andrew Morton wrote:

> Please also explain whether this fix is needed in 2.6.16.x.

Well, for a very long time, echoing 'standby' or 'mem'
into /sys/power/state has killed the machine on powerpc. This patch
fixes that. So I guess yes, it is applicable to 2.6.16.x

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]

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

* Re: PowerMac: force only suspend-to-disk to be valid
  2006-05-25 14:05   ` Andrew Morton
  2006-05-25 14:10     ` Andrew Morton
@ 2006-05-25 23:11     ` Benjamin Herrenschmidt
  1 sibling, 0 replies; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2006-05-25 23:11 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linuxppc-dev, Johannes Berg


> It looks like a 2.6.17 patch to me.  If someone wants to send it over with
> changelog, signed-off-by, etc I can take care of it.

Yup, it's good, I must have forgotten to ack it (too much travel & other
things lately)

Ben.

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

end of thread, other threads:[~2006-05-25 23:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-02  9:31 PowerMac: force only suspend-to-disk to be valid Johannes Berg
2006-05-25 10:05 ` Johannes Berg
2006-05-25 14:05   ` Andrew Morton
2006-05-25 14:10     ` Andrew Morton
2006-05-25 14:13       ` Johannes Berg
2006-05-25 23:11     ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).