aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/sysrq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/sysrq.c')
-rw-r--r--drivers/tty/sysrq.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index ad1ee5d01b53..fa0ce7dd9e24 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -134,17 +134,10 @@ static struct sysrq_key_op sysrq_unraw_op = {
static void sysrq_handle_crash(int key)
{
- char *killer = NULL;
-
- /* we need to release the RCU read lock here,
- * otherwise we get an annoying
- * 'BUG: sleeping function called from invalid context'
- * complaint from the kernel before the panic.
- */
+ /* release the RCU read lock before crashing */
rcu_read_unlock();
- panic_on_oops = 1; /* force panic */
- wmb();
- *killer = 1;
+
+ panic("sysrq triggered crash\n");
}
static struct sysrq_key_op sysrq_crash_op = {
.handler = sysrq_handle_crash,
@@ -546,7 +539,6 @@ void __handle_sysrq(int key, bool check_mask)
*/
orig_log_level = console_loglevel;
console_loglevel = CONSOLE_LOGLEVEL_DEFAULT;
- pr_info("SysRq : ");
op_p = __sysrq_get_key_op(key);
if (op_p) {
@@ -555,14 +547,15 @@ void __handle_sysrq(int key, bool check_mask)
* should not) and is the invoked operation enabled?
*/
if (!check_mask || sysrq_on_mask(op_p->enable_mask)) {
- pr_cont("%s\n", op_p->action_msg);
+ pr_info("%s\n", op_p->action_msg);
console_loglevel = orig_log_level;
op_p->handler(key);
} else {
- pr_cont("This sysrq operation is disabled.\n");
+ pr_info("This sysrq operation is disabled.\n");
+ console_loglevel = orig_log_level;
}
} else {
- pr_cont("HELP : ");
+ pr_info("HELP : ");
/* Only print the help msg once per handler */
for (i = 0; i < ARRAY_SIZE(sysrq_key_table); i++) {
if (sysrq_key_table[i]) {
@@ -660,8 +653,7 @@ static void sysrq_do_reset(struct timer_list *t)
state->reset_requested = true;
- ksys_sync();
- kernel_restart(NULL);
+ orderly_reboot();
}
static void sysrq_handle_reset_request(struct sysrq_state *state)
@@ -736,6 +728,8 @@ static void sysrq_of_get_keyreset_config(void)
/* Get reset timeout if any. */
of_property_read_u32(np, "timeout-ms", &sysrq_reset_downtime_ms);
+
+ of_node_put(np);
}
#else
static void sysrq_of_get_keyreset_config(void)