linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Andrew Morton <akpm@osdl.org>,
	linuxppc-dev list <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH] PowerMac: force only suspend-to-disk to be valid
Date: Fri, 26 May 2006 09:12:32 +1000	[thread overview]
Message-ID: <1148598752.10832.2.camel@localhost.localdomain> (raw)
In-Reply-To: <1148566305.11759.35.camel@johannes.berg>

On Thu, 2006-05-25 at 16:11 +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 we
> handle it there regardless just in case that changes.
> 
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

> --- 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 */
> 

      parent reply	other threads:[~2006-05-25 23:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-25 14:11 [PATCH] PowerMac: force only suspend-to-disk to be valid Johannes Berg
2006-05-25 14:41 ` Andrew Morton
2006-05-25 23:12 ` Benjamin Herrenschmidt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1148598752.10832.2.camel@localhost.localdomain \
    --to=benh@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=johannes@sipsolutions.net \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).