linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wessel <jason.wessel@windriver.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-next@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: linux-next: build failure after merge of the kgdb tree
Date: Mon, 24 May 2010 15:04:17 -0500	[thread overview]
Message-ID: <4BFADBC1.9000802@windriver.com> (raw)
In-Reply-To: <20100524181735.GC6033@core.coreip.homeip.net>

On 05/24/2010 01:17 PM, Dmitry Torokhov wrote:

> Do we really need to force SysRq on or off? Maybe we should export
> __handle_sysrq() instead?


It seems cleanest to export __handle_sysrq() if that is ok?

> Also, I think I need to add locking in sysrq_toggle_support(), which
> will make it unsuitable for using in kdb handler, won't it?
> 

Any kind of locking would provide another opportunity to deadlock the
debugger.  It is probably worth noting that any of the sysrq
operations have the possibility to dead lock the system depending on
what type of exception was taken.  The idea is that you can use kdb in
one of these fatal exceptions and additionally run sysrq when you
might not have otherwise been able to before because the keyboard
handler was dead after a call to panic() for example.  At the point it
in time that it hangs there, the system was dead anyway. :-)


--------------

From: Jason Wessel <jason.wessel@windriver.com>
Subject: [PATCH] sysrq,kdb: Use __handle_sysrq() for kdb's sysrq function

The kdb code should not toggle the sysrq state in case an end user
wants to try and resume the normal kernel execution.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>

---
 drivers/char/sysrq.c        |    2 +-
 include/linux/sysrq.h       |    1 +
 kernel/debug/kdb/kdb_main.c |    3 +--
 3 files changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/char/sysrq.c
+++ b/drivers/char/sysrq.c
@@ -493,7 +493,7 @@ static void __sysrq_put_key_op(int key, 
                 sysrq_key_table[i] = op_p;
 }
 
-static void __handle_sysrq(int key, struct tty_struct *tty, int check_mask)
+void __handle_sysrq(int key, struct tty_struct *tty, int check_mask)
 {
 	struct sysrq_key_op *op_p;
 	int orig_log_level;
--- a/include/linux/sysrq.h
+++ b/include/linux/sysrq.h
@@ -45,6 +45,7 @@ struct sysrq_key_op {
  */
 
 void handle_sysrq(int key, struct tty_struct *tty);
+void __handle_sysrq(int key, struct tty_struct *tty, int check_mask);
 int register_sysrq_key(int key, struct sysrq_key_op *op);
 int unregister_sysrq_key(int key, struct sysrq_key_op *op);
 struct sysrq_key_op *__sysrq_get_key_op(int key);
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -1820,9 +1820,8 @@ static int kdb_sr(int argc, const char *
 {
 	if (argc != 1)
 		return KDB_ARGCOUNT;
-	sysrq_toggle_support(1);
 	kdb_trap_printk++;
-	handle_sysrq(*argv[1], NULL);
+	__handle_sysrq(*argv[1], NULL, 0);
 	kdb_trap_printk--;
 
 	return 0;

  reply	other threads:[~2010-05-24 20:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-23  4:04 linux-next: build failure after merge of the kgdb tree Stephen Rothwell
2010-03-25  4:43 ` Stephen Rothwell
2010-03-25  4:59   ` Dmitry Torokhov
2010-05-21  0:21     ` Stephen Rothwell
2010-05-21  0:49       ` Jason Wessel
2010-05-21  1:09         ` Stephen Rothwell
2010-05-21  1:23           ` Dmitry Torokhov
2010-05-21  1:28             ` Jason Wessel
2010-05-24 18:17               ` Dmitry Torokhov
2010-05-24 20:04                 ` Jason Wessel [this message]
2010-05-24 20:34                   ` Dmitry Torokhov
2010-05-24 20:50                     ` Jason Wessel
  -- strict thread matches above, loose matches on Subject: below --
2020-05-19 14:05 Stephen Rothwell
2020-05-19 14:58 ` Doug Anderson
2020-05-19 15:52   ` Doug Anderson

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=4BFADBC1.9000802@windriver.com \
    --to=jason.wessel@windriver.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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;
as well as URLs for NNTP newsgroup(s).