Skip to content

Commit edd63cb

Browse files
committed
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> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent b0679c6 commit edd63cb

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎drivers/char/sysrq.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ static void __sysrq_put_key_op(int key, struct sysrq_key_op *op_p)
493493
sysrq_key_table[i] = op_p;
494494
}
495495

496-
static void __handle_sysrq(int key, struct tty_struct *tty, int check_mask)
496+
void __handle_sysrq(int key, struct tty_struct *tty, int check_mask)
497497
{
498498
struct sysrq_key_op *op_p;
499499
int orig_log_level;

‎include/linux/sysrq.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ struct sysrq_key_op {
4545
*/
4646

4747
void handle_sysrq(int key, struct tty_struct *tty);
48+
void __handle_sysrq(int key, struct tty_struct *tty, int check_mask);
4849
int register_sysrq_key(int key, struct sysrq_key_op *op);
4950
int unregister_sysrq_key(int key, struct sysrq_key_op *op);
5051
struct sysrq_key_op *__sysrq_get_key_op(int key);

‎kernel/debug/kdb/kdb_main.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,9 +1820,8 @@ static int kdb_sr(int argc, const char **argv)
18201820
{
18211821
if (argc != 1)
18221822
return KDB_ARGCOUNT;
1823-
sysrq_toggle_support(1);
18241823
kdb_trap_printk++;
1825-
handle_sysrq(*argv[1], NULL);
1824+
__handle_sysrq(*argv[1], NULL, 0);
18261825
kdb_trap_printk--;
18271826

18281827
return 0;

0 commit comments

Comments
 (0)