mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Todd Poynor <tpoynor@mvista.com>
To: Greg KH <greg@kroah.com>
Cc: Todd Poynor <tpoynor@mvista.com>,
	mochel@digitalimplant.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Leave runtime suspended devices off at system resume
Date: Fri, 28 May 2004 10:52:06 -0700	[thread overview]
Message-ID: <20040528175206.GF7176@slurryseal.ddns.mvista.com> (raw)
In-Reply-To: <20040528170315.GB8192@kroah.com>

On Fri, May 28, 2004 at 10:03:15AM -0700, Greg KH wrote:
> Nice, that looks good.
> 
> Applied, thanks.

Sorry, Felipe Solana found that USB drivers tweak the power.power_state
field during suspend, so we can't rely on that field to tell what to
resume.  A new patch against 2.6.6 creates a separate field for the
original value, so driver mods to the field won't break resume.  I'll
also send a patch against the original patch to fix trees already
updated in a moment.  Thanks -- Todd

--- linux-2.6.6-orig/drivers/base/power/suspend.c	2004-05-10 11:22:58.000000000 -0700
+++ linux-2.6.6-prevstate/drivers/base/power/suspend.c	2004-05-27 13:58:01.931014888 -0700
@@ -39,7 +39,9 @@
 {
 	int error = 0;
 
-	if (dev->bus && dev->bus->suspend)
+	dev->power.prev_state = dev->power.power_state;
+
+	if (dev->bus && dev->bus->suspend && ! dev->power.power_state)
 		error = dev->bus->suspend(dev,state);
 
 	if (!error) {
--- linux-2.6.6-orig/drivers/base/power/resume.c	2004-05-10 11:22:58.000000000 -0700
+++ linux-2.6.6-prevstate/drivers/base/power/resume.c	2004-05-27 14:35:03.373304328 -0700
@@ -35,7 +35,10 @@
 		struct list_head * entry = dpm_off.next;
 		struct device * dev = to_device(entry);
 		list_del_init(entry);
-		resume_device(dev);
+
+		if (! dev->power.prev_state)
+			resume_device(dev);
+
 		list_add_tail(entry,&dpm_active);
 	}
 }
--- linux-2.6.6-orig/include/linux/pm.h	2004-05-10 11:23:56.000000000 -0700
+++ linux-2.6.6-prevstate/include/linux/pm.h	2004-05-27 14:35:37.143170528 -0700
@@ -231,6 +231,7 @@
 struct dev_pm_info {
 #ifdef	CONFIG_PM
 	u32			power_state;
+	u32			prev_state;
 	u8			* saved_state;
 	atomic_t		pm_users;
 	struct device		* pm_parent;



      reply	other threads:[~2004-05-28 17:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-26 21:43 Todd Poynor
2004-05-28 17:03 ` Greg KH
2004-05-28 17:52   ` Todd Poynor [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=20040528175206.GF7176@slurryseal.ddns.mvista.com \
    --to=tpoynor@mvista.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@digitalimplant.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

all inboxes | Powered by JetHome®