]> err.no Git - linux-2.6/commitdiff
[PATCH] revert "swsusp add check for suspension of X controlled devices"
authorAndrew Morton <akpm@osdl.org>
Wed, 31 May 2006 04:26:03 +0000 (21:26 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 31 May 2006 23:27:11 +0000 (16:27 -0700)
From: Andrew Morton <akpm@osdl.org>

Revert commit ff4da2e262d2509fe1bacff70dd00934be569c66.

It broke APM suspend, probably because APM doesn't switch back to a VT
when suspending.

Tracked down by Matt Mackall <mpm@selenic.com>

Rafael sayeth:
  "It only fixed the theoretical issue that a quick-handed user could
   switch to X after processes have been frozen and before the devices
   are suspended.

   With the current userland suspend tools it shouldn't be necessary."

Cc: Pavel Machek <pavel@ucw.cz>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/base/power/suspend.c
drivers/char/vt.c
include/linux/vt_kern.h

index 662209d3f42d6a551c7001ab5adb62406abfcfb0..2a769cc6f5f9f8181580b6657c0d0625e9c937dd 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/vt_kern.h>
 #include <linux/device.h>
 #include <linux/kallsyms.h>
 #include <linux/pm.h>
@@ -66,6 +65,7 @@ int suspend_device(struct device * dev, pm_message_t state)
        return error;
 }
 
+
 /**
  *     device_suspend - Save state and stop all devices in system.
  *     @state:         Power state to put each device in.
@@ -85,9 +85,6 @@ int device_suspend(pm_message_t state)
 {
        int error = 0;
 
-       if (!is_console_suspend_safe())
-               return -EINVAL;
-
        down(&dpm_sem);
        down(&dpm_list_sem);
        while (!list_empty(&dpm_active) && error == 0) {
index acc5d47844eb49a53578f688949f04e039c04962..6c94879e0b99b6f6a369d69a188b347436abe550 100644 (file)
@@ -3238,14 +3238,6 @@ void vcs_scr_writew(struct vc_data *vc, u16 val, u16 *org)
        }
 }
 
-int is_console_suspend_safe(void)
-{
-       /* It is unsafe to suspend devices while X has control of the
-        * hardware. Make sure we are running on a kernel-controlled console.
-        */
-       return vc_cons[fg_console].d->vc_mode == KD_TEXT;
-}
-
 /*
  *     Visible symbols for modules
  */
index 530ae3f4248ccb6afb3dfe84cee7c1264e32ca38..fab5aed8ca315cc71217dae905e2dda1ac598201 100644 (file)
@@ -73,11 +73,6 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);
 int vt_waitactive(int vt);
 void change_console(struct vc_data *new_vc);
 void reset_vc(struct vc_data *vc);
-#ifdef CONFIG_VT
-int is_console_suspend_safe(void);
-#else
-static inline int is_console_suspend_safe(void) { return 1; }
-#endif
 
 /*
  * vc_screen.c shares this temporary buffer with the console write code so that