mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Andrew Morton <akpm@osdl.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -mm] swsusp/pm: refuse to suspend devices if wrong console is active
Date: Mon, 20 Feb 2006 11:38:55 +0100	[thread overview]
Message-ID: <20060220103855.GD16042@elf.ucw.cz> (raw)
In-Reply-To: <20060219213526.45efd900.akpm@osdl.org>

On Ne 19-02-06 21:35:26, Andrew Morton wrote:
> "Rafael J. Wysocki" <rjw@sisk.pl> wrote:
> >
> > 1) Remove the console-switching code from the suspend part of the swsusp
> > userland interface and let the userland tools switch the console.
> > 
> > 2) It is unsafe to suspend devices if the hardware is controlled by X.  Add
> > an extra check to prevent this from happening.
> > 
> > ...
> > @@ -82,6 +85,12 @@ int device_suspend(pm_message_t state)
> >  {
> >  	int error = 0;
> >  
> > +	/* It is unsafe to suspend devices while X has control of the
> > +	 * hardware. Make sure we are running on a kernel-controlled console.
> > +	 */
> > +	if (vc_cons[fg_console].d->vc_mode != KD_TEXT)
> > +		return -EINVAL;
> > +
> >  	down(&dpm_sem);
> 
> Does this mean that swsusp simply won't work if invoked while X is running
> and being displayed?  If so, that sounds like a pretty severe limitation.

No, no. Kernel with switch to text console before doing this in swsusp
case, and userspace has to switch to text console before doing this in
uswsusp case.

This is just a sanity check, to guard against misuse by uswsusp
program.

								Pavel
-- 
Web maintainer for suspend.sf.net (www.sf.net/projects/suspend) wanted...

      reply	other threads:[~2006-02-20 10:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-19 22:26 Rafael J. Wysocki
2006-02-20  5:35 ` Andrew Morton
2006-02-20 10:38   ` Pavel Machek [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060220103855.GD16042@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome