diff options
| author | Andrew Morton <akpm@osdl.org> | 2006-05-31 00:26:03 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-05-31 19:27:11 -0400 |
| commit | 760f1fce030ccc620ec430a8aff8fc604e7891ed (patch) | |
| tree | d2e14b5c6d101e4b368300d2a7e6c6fd438133a8 | |
| parent | d61a3ead268084cc271d7b2aa2950fc822a37cf5 (diff) | |
[PATCH] revert "swsusp add check for suspension of X controlled devices"
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>
| -rw-r--r-- | drivers/base/power/suspend.c | 5 | ||||
| -rw-r--r-- | drivers/char/vt.c | 8 | ||||
| -rw-r--r-- | include/linux/vt_kern.h | 5 |
3 files changed, 1 insertions, 17 deletions
diff --git a/drivers/base/power/suspend.c b/drivers/base/power/suspend.c index 662209d3f42d..2a769cc6f5f9 100644 --- a/drivers/base/power/suspend.c +++ b/drivers/base/power/suspend.c | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | * | 8 | * |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #include <linux/vt_kern.h> | ||
| 12 | #include <linux/device.h> | 11 | #include <linux/device.h> |
| 13 | #include <linux/kallsyms.h> | 12 | #include <linux/kallsyms.h> |
| 14 | #include <linux/pm.h> | 13 | #include <linux/pm.h> |
| @@ -66,6 +65,7 @@ int suspend_device(struct device * dev, pm_message_t state) | |||
| 66 | return error; | 65 | return error; |
| 67 | } | 66 | } |
| 68 | 67 | ||
| 68 | |||
| 69 | /** | 69 | /** |
| 70 | * device_suspend - Save state and stop all devices in system. | 70 | * device_suspend - Save state and stop all devices in system. |
| 71 | * @state: Power state to put each device in. | 71 | * @state: Power state to put each device in. |
| @@ -85,9 +85,6 @@ int device_suspend(pm_message_t state) | |||
| 85 | { | 85 | { |
| 86 | int error = 0; | 86 | int error = 0; |
| 87 | 87 | ||
| 88 | if (!is_console_suspend_safe()) | ||
| 89 | return -EINVAL; | ||
| 90 | |||
| 91 | down(&dpm_sem); | 88 | down(&dpm_sem); |
| 92 | down(&dpm_list_sem); | 89 | down(&dpm_list_sem); |
| 93 | while (!list_empty(&dpm_active) && error == 0) { | 90 | while (!list_empty(&dpm_active) && error == 0) { |
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index acc5d47844eb..6c94879e0b99 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
| @@ -3238,14 +3238,6 @@ void vcs_scr_writew(struct vc_data *vc, u16 val, u16 *org) | |||
| 3238 | } | 3238 | } |
| 3239 | } | 3239 | } |
| 3240 | 3240 | ||
| 3241 | int is_console_suspend_safe(void) | ||
| 3242 | { | ||
| 3243 | /* It is unsafe to suspend devices while X has control of the | ||
| 3244 | * hardware. Make sure we are running on a kernel-controlled console. | ||
| 3245 | */ | ||
| 3246 | return vc_cons[fg_console].d->vc_mode == KD_TEXT; | ||
| 3247 | } | ||
| 3248 | |||
| 3249 | /* | 3241 | /* |
| 3250 | * Visible symbols for modules | 3242 | * Visible symbols for modules |
| 3251 | */ | 3243 | */ |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 530ae3f4248c..fab5aed8ca31 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
| @@ -73,11 +73,6 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); | |||
| 73 | int vt_waitactive(int vt); | 73 | int vt_waitactive(int vt); |
| 74 | void change_console(struct vc_data *new_vc); | 74 | void change_console(struct vc_data *new_vc); |
| 75 | void reset_vc(struct vc_data *vc); | 75 | void reset_vc(struct vc_data *vc); |
| 76 | #ifdef CONFIG_VT | ||
| 77 | int is_console_suspend_safe(void); | ||
| 78 | #else | ||
| 79 | static inline int is_console_suspend_safe(void) { return 1; } | ||
| 80 | #endif | ||
| 81 | 76 | ||
| 82 | /* | 77 | /* |
| 83 | * vc_screen.c shares this temporary buffer with the console write code so that | 78 | * vc_screen.c shares this temporary buffer with the console write code so that |
