public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Driver Core fixes for 2.6.7-rc1
Date: Fri, 28 May 2004 14:25:55 -0700	[thread overview]
Message-ID: <10857795552653@kroah.com> (raw)
In-Reply-To: <10857795552945@kroah.com>

ChangeSet 1.1717.7.5, 2004/05/28 10:04:44-07:00, tpoynor@mvista.com

[PATCH] Leave runtime suspended devices off at system resume

Currently all devices are resumed at system resume time, including any
that were individually powered off ("at runtime") prior to the system
suspend.  In certain cases it can be nice to force back on individually
suspended devices, such as the display, but hopefully this policy can be
left up to userspace power managers; the kernel should probably honor
the settings previously made by userspace/drivers.  This seems
preferable to requiring a power-conscious system to re-suspend devices
after a system resume; furthermore, for certain platforms (such as
XScale PXA27X) there can be disastrous consequences of powering up
devices when the system is in a state incompatible with operation of the
device.

Suggested patch does this:

(1) At system resume, checks power_state to see if the device was
suspended prior to system suspend, and skips powering on the device if
so.

(2) Does not re-suspend an already-suspended device at system suspend
(using a different method than is currently employed, which reorders the
list, see #3).

(3) Preserves the active/off device list order despite the above changes
to suspend/resume behavior, to avoid dependency problems that tend to
occur when the list is reordered.

Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 drivers/base/power/resume.c  |    5 ++++-
 drivers/base/power/suspend.c |    2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)


diff -Nru a/drivers/base/power/resume.c b/drivers/base/power/resume.c
--- a/drivers/base/power/resume.c	Fri May 28 14:18:10 2004
+++ b/drivers/base/power/resume.c	Fri May 28 14:18:10 2004
@@ -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.power_state)
+			resume_device(dev);
+
 		list_add_tail(entry,&dpm_active);
 	}
 }
diff -Nru a/drivers/base/power/suspend.c b/drivers/base/power/suspend.c
--- a/drivers/base/power/suspend.c	Fri May 28 14:18:10 2004
+++ b/drivers/base/power/suspend.c	Fri May 28 14:18:10 2004
@@ -39,7 +39,7 @@
 {
 	int error = 0;
 
-	if (dev->bus && dev->bus->suspend)
+	if (dev->bus && dev->bus->suspend && !dev->power.power_state)
 		error = dev->bus->suspend(dev,state);
 
 	return error;


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

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-28 21:25 [BK PATCH] Driver Core fixes for 2.6.7-rc1 Greg KH
2004-05-28 21:25 ` [PATCH] " Greg KH
2004-05-28 21:25   ` Greg KH
2004-05-28 21:25     ` Greg KH
2004-05-28 21:25       ` Greg KH
2004-05-28 21:25         ` Greg KH [this message]
2004-05-28 21:25           ` Greg KH
2004-05-28 21:25             ` Greg KH
2004-05-28 21:25               ` Greg KH
2004-06-04 12:25             ` Pavel Machek
2004-06-04 16:26               ` Greg KH
2004-06-04 18:26                 ` Pavel Machek
2004-06-04 18:42                   ` Greg KH

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=10857795552653@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.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