From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Jeff Chua <jeff.chua.linux@gmail.com>
Cc: Jesse Barnes <jesse.barnes@intel.com>,
Romano Giannetti <romano@dea.icai.upcomillas.es>,
Linus Torvalds <torvalds@linux-foundation.org>,
suspend-devel List <suspend-devel@lists.sourceforge.net>,
Dave Airlie <airlied@linux.ie>, Greg KH <gregkh@suse.de>,
lkml <linux-kernel@vger.kernel.org>,
linux-acpi@vger.kernel.org
Subject: Re: [Suspend-devel] 2.6.25-rc2 System no longer powers off aftersuspend-to-disk. Screen becomes green.
Date: Fri, 22 Feb 2008 01:31:08 +0100 [thread overview]
Message-ID: <200802220131.09525.rjw@sisk.pl> (raw)
In-Reply-To: <b6a2187b0802211620q47f6601fuf7e88395d89b90c8@mail.gmail.com>
On Friday, 22 of February 2008, Jeff Chua wrote:
> On Fri, Feb 22, 2008 at 5:02 AM, Jesse Barnes <jesse.barnes@intel.com> wrote:
> > On Thursday, February 21, 2008 11:43 am Romano Giannetti wrote:
> > > > > Let's try to narrow it down to what the interaction is. Are you using
> > > > > something like acpi_sleep=s3_bios or similar?
> > > >
> > > > No. Not additional command line option except for resume=/dev/sda3
> > > > reboot=bios
> > >
> > > My laptop (a Toshiba satellite U305, intel 945GM chipset, used to need
> > > s2ram -f -p -m to STR correctly. In 2.6.25-rc2 I can simply STR with
> > > echo mem > /sys/power/state.
> >
> > Cool, glad to hear at least one success report. :)
>
> STR is always working on my X60s. No green screen, no hang. Both s2ram
> and "echo mem > /sys/power/state". It's STD that's having problem.
>
> But strange thing is I could even restore console after STD even
> without agp and i915 module loaded, so I don't know how the console
> vga got saved and restored.
Jeff, can you please test hibernation with the patch I've just sent to Jesse
(reproduced below for convenience)?
Thanks,
Rafael
---
drivers/char/drm/i915_drv.c | 5 +++--
include/linux/suspend.h | 2 ++
kernel/power/disk.c | 10 +++++++++-
3 files changed, 14 insertions(+), 3 deletions(-)
Index: linux-2.6/drivers/char/drm/i915_drv.c
===================================================================
--- linux-2.6.orig/drivers/char/drm/i915_drv.c
+++ linux-2.6/drivers/char/drm/i915_drv.c
@@ -27,6 +27,7 @@
*
*/
+#include <linux/suspend.h>
#include "drmP.h"
#include "drm.h"
#include "i915_drm.h"
@@ -222,6 +223,7 @@ static void i915_restore_vga(struct drm_
dev_priv->saveGR[0x18]);
/* Attribute controller registers */
+ inb(st01); /* switch back to index mode */
for (i = 0; i < 20; i++)
i915_write_ar(st01, i, dev_priv->saveAR[i], 0);
inb(st01); /* switch back to index mode */
@@ -366,9 +368,8 @@ static int i915_suspend(struct drm_devic
i915_save_vga(dev);
- if (state.event == PM_EVENT_SUSPEND) {
+ if (state.event == PM_EVENT_SUSPEND && !in_hibernation_power_off()) {
/* Shut down the device */
- pci_disable_device(dev->pdev);
pci_set_power_state(dev->pdev, PCI_D3hot);
}
Index: linux-2.6/include/linux/suspend.h
===================================================================
--- linux-2.6.orig/include/linux/suspend.h
+++ linux-2.6/include/linux/suspend.h
@@ -209,6 +209,7 @@ extern unsigned long get_safe_page(gfp_t
extern void hibernation_set_ops(struct platform_hibernation_ops *ops);
extern int hibernate(void);
+extern bool in_hibernation_power_off(void);
#else /* CONFIG_HIBERNATION */
static inline int swsusp_page_is_forbidden(struct page *p) { return 0; }
static inline void swsusp_set_page_free(struct page *p) {}
@@ -216,6 +217,7 @@ static inline void swsusp_unset_page_fre
static inline void hibernation_set_ops(struct platform_hibernation_ops *ops) {}
static inline int hibernate(void) { return -ENOSYS; }
+static inline bool in_hibernation_power_off(void) { return false; }
#endif /* CONFIG_HIBERNATION */
#ifdef CONFIG_PM_SLEEP
Index: linux-2.6/kernel/power/disk.c
===================================================================
--- linux-2.6.orig/kernel/power/disk.c
+++ linux-2.6/kernel/power/disk.c
@@ -24,7 +24,7 @@
#include "power.h"
-
+static bool entering_sleep_state;
static int noresume = 0;
static char resume_file[256] = CONFIG_PM_STD_PARTITION;
dev_t swsusp_resume_device;
@@ -381,6 +381,7 @@ int hibernation_platform_enter(void)
if (!hibernation_ops)
return -ENOSYS;
+ entering_sleep_state = true;
/*
* We have cancelled the power transition by running
* hibernation_ops->finish() before saving the image, so we should let
@@ -412,6 +413,7 @@ int hibernation_platform_enter(void)
}
local_irq_enable();
+ entering_sleep_state = false;
/*
* We don't need to reenable the nonboot CPUs or resume consoles, since
* the system is going to be halted anyway.
@@ -427,6 +429,12 @@ int hibernation_platform_enter(void)
return error;
}
+bool in_hibernation_power_off(void)
+{
+ return entering_sleep_state;
+}
+EXPORT_SYMBOL(in_hibernation_power_off);
+
/**
* power_down - Shut the machine down for hibernation.
*
next prev parent reply other threads:[~2008-02-22 0:32 UTC|newest]
Thread overview: 111+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-20 17:17 2.6.25-rc2 System no longer powers off after suspend-to-disk. Screen becomes green Jeff Chua
2008-02-20 17:19 ` Jeff Chua
2008-02-20 17:28 ` Linus Torvalds
2008-02-20 17:37 ` Jeff Chua
2008-02-20 17:52 ` Linus Torvalds
2008-02-20 18:02 ` Jeff Chua
2008-02-21 19:43 ` [Suspend-devel] 2.6.25-rc2 System no longer powers off aftersuspend-to-disk. " Romano Giannetti
2008-02-21 21:02 ` Jesse Barnes
2008-02-22 0:20 ` [Suspend-devel] " Jeff Chua
2008-02-22 0:23 ` Jesse Barnes
2008-02-22 0:42 ` Jeff Chua
2008-02-22 0:46 ` [Suspend-devel] " Jesse Barnes
2008-02-22 0:52 ` Jeff Chua
2008-02-22 1:02 ` Jesse Barnes
2008-02-22 1:27 ` Jeff Chua
2008-02-22 1:28 ` Linus Torvalds
2008-02-22 1:35 ` [Suspend-devel] " Jesse Barnes
2008-02-22 10:37 ` Matthew Garrett
2008-02-22 13:06 ` Ingo Molnar
2008-02-22 16:10 ` Rafael J. Wysocki
2008-02-22 16:50 ` Linus Torvalds
2008-02-22 18:01 ` Matthew Garrett
2008-02-23 11:17 ` Ingo Molnar
2008-02-22 0:31 ` Rafael J. Wysocki [this message]
2008-02-22 0:42 ` Jeff Chua
2008-02-22 1:01 ` Jeff Chua
2008-02-22 1:06 ` Rafael J. Wysocki
2008-02-22 0:46 ` Linus Torvalds
2008-02-22 0:54 ` Rafael J. Wysocki
2008-02-22 1:13 ` [Suspend-devel] " Jesse Barnes
2008-02-22 1:44 ` Jesse Barnes
2008-02-22 23:31 ` i915 hibernation patch (was: Re: [Suspend-devel] 2.6.25-rc2 System no longer powers off aftersuspend-to-disk. Screen becomes green.) Rafael J. Wysocki
2008-02-23 1:00 ` Linus Torvalds
2008-02-23 1:55 ` Rafael J. Wysocki
2008-02-23 2:07 ` Linus Torvalds
2008-02-23 4:36 ` Jeff Chua
2008-02-23 18:13 ` [PATCH] PM: Introduce PM_EVENT_HIBERNATE (was: Re: i915 hibernation patch (was: Re: 2.6.25-rc2 System no longer ...)) Rafael J. Wysocki
2008-02-23 18:43 ` Linus Torvalds
2008-02-24 8:29 ` Pavel Machek
2008-02-24 15:21 ` Jeff Chua
2008-02-24 4:16 ` Mirco Tischler
2008-02-24 11:11 ` Rafael J. Wysocki
2008-02-24 11:25 ` Rafael J. Wysocki
2008-02-23 11:17 ` i915 hibernation patch (was: Re: [Suspend-devel] 2.6.25-rc2 System no longer powers off aftersuspend-to-disk. Screen becomes green.) Pavel Machek
2008-02-20 17:54 ` 2.6.25-rc2 System no longer powers off after suspend-to-disk. Screen becomes green Jeff Chua
2008-02-20 18:37 ` Linus Torvalds
2008-02-18 6:31 ` [Suspend-devel] " Pavel Machek
2008-02-20 18:49 ` Jeff Chua
2008-02-20 19:25 ` Matthew Garrett
2008-02-20 18:57 ` Jesse Barnes
2008-02-20 17:50 ` Jesse Barnes
2008-02-20 18:29 ` Jeff Chua
2008-02-20 18:53 ` Jesse Barnes
2008-02-20 19:10 ` Jeff Chua
2008-02-20 19:18 ` Jesse Barnes
2008-02-20 20:09 ` Jesse Barnes
2008-02-20 20:14 ` Rafael J. Wysocki
2008-02-20 20:29 ` Linus Torvalds
2008-02-20 20:33 ` Pablo Sanchez
2008-02-20 20:41 ` Jesse Barnes
2008-02-20 21:13 ` Linus Torvalds
2008-02-20 21:44 ` Jesse Barnes
2008-02-20 22:22 ` Linus Torvalds
2008-02-21 8:30 ` david
2008-02-22 16:56 ` Mark Lord
2008-02-22 17:02 ` Rafael J. Wysocki
2008-02-22 17:32 ` Mark Lord
2008-02-22 17:44 ` Rafael J. Wysocki
2008-02-22 19:23 ` david
2008-02-22 23:16 ` Rafael J. Wysocki
2008-02-20 22:36 ` Rafael J. Wysocki
2008-02-20 23:13 ` Linus Torvalds
2008-02-20 23:35 ` Rafael J. Wysocki
2008-02-21 0:00 ` Linus Torvalds
2008-02-21 0:13 ` Rafael J. Wysocki
2008-02-21 0:25 ` Linus Torvalds
2008-02-21 0:59 ` Rafael J. Wysocki
2008-02-22 16:54 ` Mark Lord
2008-02-20 22:45 ` Nigel Cunningham
2008-02-21 0:13 ` Matthew Garrett
2008-02-21 0:40 ` Nigel Cunningham
2008-02-21 0:46 ` Greg KH
2008-02-21 1:17 ` Nigel Cunningham
2008-02-21 4:43 ` Greg KH
2008-02-21 6:05 ` Nigel Cunningham
2008-02-21 6:37 ` Greg KH
2008-02-21 1:10 ` Matthew Garrett
2008-02-21 1:25 ` Nigel Cunningham
2008-02-20 20:45 ` Rafael J. Wysocki
2008-02-20 21:26 ` [Suspend-devel] " Alexey Starikovskiy
2008-02-20 21:37 ` Jesse Barnes
2008-02-21 0:35 ` Jeff Chua
2008-02-21 0:39 ` Jesse Barnes
2008-02-21 1:19 ` Jeff Chua
2008-02-21 1:21 ` Jesse Barnes
2008-02-21 1:49 ` Jeff Chua
2008-02-21 2:00 ` Jeff Chua
2008-02-21 16:27 ` [Suspend-devel] " Rafael J. Wysocki
2008-02-21 18:34 ` Jesse Barnes
2008-02-21 20:30 ` Rafael J. Wysocki
2008-02-21 22:11 ` Rafael J. Wysocki
2008-02-21 23:45 ` Jesse Barnes
2008-02-22 0:28 ` Rafael J. Wysocki
2008-02-22 0:48 ` Jeff Chua
2008-02-20 22:32 ` Jesse Barnes
2008-02-20 23:03 ` Jesse Barnes
2008-02-20 23:34 ` Jesse Barnes
2008-02-20 23:49 ` Rafael J. Wysocki
2008-02-21 0:17 ` Jesse Barnes
2008-02-21 1:07 ` [Suspend-devel] " Rafael J. Wysocki
2008-02-20 18:47 ` Mark Lord
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=200802220131.09525.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=airlied@linux.ie \
--cc=gregkh@suse.de \
--cc=jeff.chua.linux@gmail.com \
--cc=jesse.barnes@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=romano@dea.icai.upcomillas.es \
--cc=suspend-devel@lists.sourceforge.net \
--cc=torvalds@linux-foundation.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