Re: [Suspend-devel] 2.6.25-rc2 System no longer powers off after suspend-to-disk. Screen becomes green.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jesse Barnes <jesse.barnes@...>
Cc: Jeff Chua <jeff.chua.linux@...>, Dave Airlie <airlied@...>, Greg KH <gregkh@...>, lkml <linux-kernel@...>, <linux-acpi@...>, Linus Torvalds <torvalds@...>, pm list <linux-pm@...>
Date: Thursday, February 21, 2008 - 6:11 pm

On Thursday, 21 of February 2008, Jesse Barnes wrote:

Below is a patch that should work around the issue.  Please try it and let me
know if it helps.

Thanks,
Rafael

---
 drivers/char/drm/i915_drv.c |    3 +++
 include/linux/suspend.h     |    2 ++
 kernel/power/disk.c         |    9 ++++++++-
 3 files changed, 13 insertions(+), 1 deletion(-)

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,11 @@ int hibernation_platform_enter(void)
 	return error;
 }
 
+bool in_hibernation_power_off(void)
+{
+	return entering_sleep_state;
+}
+
 /**
  *	power_down - Shut the machine down for hibernation.
  *
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
@@ -247,6 +247,9 @@ static int i915_suspend(struct drm_devic
 		return -ENODEV;
 	}
 
+	if (in_hibernation_power_off())
+		return 0;
+
 	pci_save_state(dev->pdev);
 	pci_read_config_byte(dev->pdev, LBB, &dev_priv->saveLBB);
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: 2.6.25-rc2 System no longer powers off after suspend-to-..., Rafael J. Wysocki, (Wed Feb 20, 7:49 pm)
Re: [Suspend-devel] 2.6.25-rc2 System no longer powers off a..., Rafael J. Wysocki, (Wed Feb 20, 9:07 pm)
Re: [Suspend-devel] 2.6.25-rc2 System no longer powers off a..., Rafael J. Wysocki, (Thu Feb 21, 12:27 pm)
Re: [Suspend-devel] 2.6.25-rc2 System no longer powers off a..., Rafael J. Wysocki, (Thu Feb 21, 6:11 pm)
Re: [Suspend-devel] 2.6.25-rc2 System no longer powers off a..., Rafael J. Wysocki, (Thu Feb 21, 8:28 pm)
Re: [Suspend-devel] 2.6.25-rc2 System no longer powers off a..., Rafael J. Wysocki, (Thu Feb 21, 4:30 pm)
Re: 2.6.25-rc2 System no longer powers off after suspend-to-..., Rafael J. Wysocki, (Wed Feb 20, 4:14 pm)
Re: [Suspend-devel] 2.6.25-rc2 System no longer powers off a..., Rafael J. Wysocki, (Wed Feb 20, 4:45 pm)
Re: [Suspend-devel] 2.6.25-rc2 System no longer powers off a..., Alexey Starikovskiy, (Wed Feb 20, 5:26 pm)
Re: 2.6.25-rc2 System no longer powers off after suspend-to-..., Rafael J. Wysocki, (Wed Feb 20, 6:36 pm)
Re: 2.6.25-rc2 System no longer powers off after suspend-to-..., Rafael J. Wysocki, (Wed Feb 20, 7:35 pm)
Re: 2.6.25-rc2 System no longer powers off after suspend-to-..., Rafael J. Wysocki, (Wed Feb 20, 8:13 pm)
Re: 2.6.25-rc2 System no longer powers off after suspend-to-..., Rafael J. Wysocki, (Wed Feb 20, 8:59 pm)
Re: 2.6.25-rc2 System no longer powers off after suspend-to-..., Rafael J. Wysocki, (Fri Feb 22, 1:02 pm)
Re: 2.6.25-rc2 System no longer powers off after suspend-to-..., Rafael J. Wysocki, (Fri Feb 22, 1:44 pm)
Re: 2.6.25-rc2 System no longer powers off after suspend-to-..., Rafael J. Wysocki, (Fri Feb 22, 7:16 pm)
Re: [Suspend-devel] 2.6.25-rc2 System no longer powers off a..., Rafael J. Wysocki, (Fri Feb 22, 12:10 pm)
Re: [Suspend-devel] 2.6.25-rc2 System no longer powers off a..., Rafael J. Wysocki, (Thu Feb 21, 8:31 pm)
Re: [Suspend-devel] 2.6.25-rc2 System no longer powers off a..., Rafael J. Wysocki, (Thu Feb 21, 8:54 pm)
i915 hibernation patch (was: Re: [Suspend-devel] 2.6.25-rc2 ..., Rafael J. Wysocki, (Fri Feb 22, 7:31 pm)
Re: i915 hibernation patch (was: Re: [Suspend-devel] 2.6.25-..., Rafael J. Wysocki, (Fri Feb 22, 9:55 pm)
[PATCH] PM: Introduce PM_EVENT_HIBERNATE (was: Re: i915 hibe..., Rafael J. Wysocki, (Sat Feb 23, 2:13 pm)
Re: [PATCH] PM: Introduce PM_EVENT_HIBERNATE (was: Re: i915 ..., Rafael J. Wysocki, (Sun Feb 24, 7:11 am)
Re: [PATCH] PM: Introduce PM_EVENT_HIBERNATE (was: Re: i915 ..., Rafael J. Wysocki, (Sun Feb 24, 7:25 am)
Re: [Suspend-devel] 2.6.25-rc2 System no longer powers off a..., Rafael J. Wysocki, (Thu Feb 21, 9:06 pm)