Skip to content

Commit

Permalink
[PATCH] revert "swsusp add check for suspension of X controlled devices"
Browse files Browse the repository at this point in the history
From: Andrew Morton <[email protected]>

Revert commit ff4da2e.

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

Tracked down by Matt Mackall <[email protected]>

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 <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed May 31, 2006
1 parent d61a3ea commit 760f1fc
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 17 deletions.
5 changes: 1 addition & 4 deletions drivers/base/power/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*
*/

#include <linux/vt_kern.h>
#include <linux/device.h>
#include <linux/kallsyms.h>
#include <linux/pm.h>
Expand Down Expand Up @@ -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.
Expand All @@ -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) {
Expand Down
8 changes: 0 additions & 8 deletions drivers/char/vt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
5 changes: 0 additions & 5 deletions include/linux/vt_kern.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 760f1fc

Please sign in to comment.