From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Pavel Machek <pavel@suse.cz>
Cc: Linux PM <linux-pm@osdl.org>
Subject: Re: [RFC][PATCH -mm] swsusp userland interface: additional ioctl
Date: Mon, 30 Jan 2006 22:15:09 +0100 [thread overview]
Message-ID: <200601302215.10384.rjw@sisk.pl> (raw)
In-Reply-To: <20060129230647.GE2318@elf.ucw.cz>
Hi,
On Monday 30 January 2006 00:06, Pavel Machek wrote:
> > > > The appended patch provides an additional ioctl() for the swsusp userland
> > > > interface that will allow the suspending and/or resuming utilities to change
> > > > the kernel log level at the time of suspend/resume (or even set it to 0 if
> > > > they are going to use some frame buffer graphics etc.).
> > >
> > > klogd can already change loglevel... It should be possible to use that
> > > to silence suspend, no?
> >
> > Well, no. Currently the kernel changes the log level to 10 unconditionally
> > in pm_prepare_console() (that's the reason for the patch, BTW).
>
> Can we just kill that log-level setting? It may have been useful in
> the past, but I do not think it has right to live any more.
Sure, we can:
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
kernel/power/console.c | 12 +-----------
kernel/power/power.h | 5 +++++
2 files changed, 6 insertions(+), 11 deletions(-)
Index: linux-2.6.16-rc1-mm4/kernel/power/console.c
===================================================================
--- linux-2.6.16-rc1-mm4.orig/kernel/power/console.c 2006-01-30 21:17:53.000000000 +0100
+++ linux-2.6.16-rc1-mm4/kernel/power/console.c 2006-01-30 21:32:24.000000000 +0100
@@ -9,18 +9,11 @@
#include <linux/console.h>
#include "power.h"
-static int new_loglevel = 10;
-static int orig_loglevel;
#ifdef SUSPEND_CONSOLE
static int orig_fgconsole, orig_kmsg;
-#endif
int pm_prepare_console(void)
{
- orig_loglevel = console_loglevel;
- console_loglevel = new_loglevel;
-
-#ifdef SUSPEND_CONSOLE
acquire_console_sem();
orig_fgconsole = fg_console;
@@ -41,18 +34,15 @@ int pm_prepare_console(void)
}
orig_kmsg = kmsg_redirect;
kmsg_redirect = SUSPEND_CONSOLE;
-#endif
return 0;
}
void pm_restore_console(void)
{
- console_loglevel = orig_loglevel;
-#ifdef SUSPEND_CONSOLE
acquire_console_sem();
set_console(orig_fgconsole);
release_console_sem();
kmsg_redirect = orig_kmsg;
-#endif
return;
}
+#endif
Index: linux-2.6.16-rc1-mm4/kernel/power/power.h
===================================================================
--- linux-2.6.16-rc1-mm4.orig/kernel/power/power.h 2006-01-30 21:19:43.000000000 +0100
+++ linux-2.6.16-rc1-mm4/kernel/power/power.h 2006-01-30 21:33:19.000000000 +0100
@@ -43,8 +43,13 @@ static struct subsys_attribute _name##_a
extern struct subsystem power_subsys;
+#ifdef SUSPEND_CONSOLE
extern int pm_prepare_console(void);
extern void pm_restore_console(void);
+#else
+static int pm_prepare_console(void) { return 0; }
+static void pm_restore_console(void) {}
+#endif
/* References to section boundaries */
extern const void __nosave_begin, __nosave_end;
next prev parent reply other threads:[~2006-01-30 21:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-29 21:56 [RFC][PATCH -mm] swsusp userland interface: additional ioctl Rafael J. Wysocki
2006-01-29 21:57 ` Pavel Machek
2006-01-29 22:46 ` Rafael J. Wysocki
2006-01-29 23:06 ` Pavel Machek
2006-01-30 4:54 ` Greg KH
2006-01-30 21:15 ` Rafael J. Wysocki [this message]
2006-01-30 21:59 ` Pavel Machek
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=200601302215.10384.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=linux-pm@osdl.org \
--cc=pavel@suse.cz \
/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