[PATCH] swsusp: add check for suspension of X-controlled devices
It is unsafe to suspend devices if the hardware is controlled by X. Add an extra check to prevent this from happening. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
e4e4d66556
commit
ff4da2e262
@@ -3234,6 +3234,14 @@ 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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user