diff options
author | Petr Mladek <pmladek@suse.com> | 2024-11-18 14:07:05 +0100 |
---|---|---|
committer | Petr Mladek <pmladek@suse.com> | 2024-11-18 14:07:05 +0100 |
commit | 34767e5357fc8051b192ff3fd921ade7c1b37c46 (patch) | |
tree | 9a5035eed562a39281164e4ab95e5ea818d073f6 /drivers/tty/sysrq.c | |
parent | a961ec4e2860af4933e8c1763fe4f038c2d6ac80 (diff) | |
parent | da115c4ee29f589bb72ec2e86eb5e196b6bbcb41 (diff) |
Merge branch 'for-6.13-force-console' into for-linus
Diffstat (limited to 'drivers/tty/sysrq.c')
-rw-r--r-- | drivers/tty/sysrq.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index 14f8f00fdcf9..4a8405478ad8 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c @@ -582,7 +582,6 @@ static void __sysrq_put_key_op(u8 key, const struct sysrq_key_op *op_p) void __handle_sysrq(u8 key, bool check_mask) { const struct sysrq_key_op *op_p; - int orig_log_level; int orig_suppress_printk; int i; @@ -592,13 +591,12 @@ void __handle_sysrq(u8 key, bool check_mask) rcu_sysrq_start(); rcu_read_lock(); /* - * Raise the apparent loglevel to maximum so that the sysrq header - * is shown to provide the user with positive feedback. We do not - * simply emit this at KERN_EMERG as that would change message - * routing in the consumers of /proc/kmsg. + * Enter in the force_console context so that sysrq header is shown to + * provide the user with positive feedback. We do not simply emit this + * at KERN_EMERG as that would change message routing in the consumers + * of /proc/kmsg. */ - orig_log_level = console_loglevel; - console_loglevel = CONSOLE_LOGLEVEL_DEFAULT; + printk_force_console_enter(); op_p = __sysrq_get_key_op(key); if (op_p) { @@ -608,11 +606,11 @@ void __handle_sysrq(u8 key, bool check_mask) */ if (!check_mask || sysrq_on_mask(op_p->enable_mask)) { pr_info("%s\n", op_p->action_msg); - console_loglevel = orig_log_level; + printk_force_console_exit(); op_p->handler(key); } else { pr_info("This sysrq operation is disabled.\n"); - console_loglevel = orig_log_level; + printk_force_console_exit(); } } else { pr_info("HELP : "); @@ -630,7 +628,7 @@ void __handle_sysrq(u8 key, bool check_mask) } } pr_cont("\n"); - console_loglevel = orig_log_level; + printk_force_console_exit(); } rcu_read_unlock(); rcu_sysrq_end(); |