diff options
Diffstat (limited to 'drivers/tty/sysrq.c')
-rw-r--r-- | drivers/tty/sysrq.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index d008f5a75197..b674793be478 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c | |||
@@ -246,8 +246,10 @@ static void sysrq_handle_showallcpus(int key) | |||
246 | * architecture has no support for it: | 246 | * architecture has no support for it: |
247 | */ | 247 | */ |
248 | if (!trigger_all_cpu_backtrace()) { | 248 | if (!trigger_all_cpu_backtrace()) { |
249 | struct pt_regs *regs = get_irq_regs(); | 249 | struct pt_regs *regs = NULL; |
250 | 250 | ||
251 | if (in_irq()) | ||
252 | regs = get_irq_regs(); | ||
251 | if (regs) { | 253 | if (regs) { |
252 | pr_info("CPU%d:\n", smp_processor_id()); | 254 | pr_info("CPU%d:\n", smp_processor_id()); |
253 | show_regs(regs); | 255 | show_regs(regs); |
@@ -266,7 +268,10 @@ static struct sysrq_key_op sysrq_showallcpus_op = { | |||
266 | 268 | ||
267 | static void sysrq_handle_showregs(int key) | 269 | static void sysrq_handle_showregs(int key) |
268 | { | 270 | { |
269 | struct pt_regs *regs = get_irq_regs(); | 271 | struct pt_regs *regs = NULL; |
272 | |||
273 | if (in_irq()) | ||
274 | regs = get_irq_regs(); | ||
270 | if (regs) | 275 | if (regs) |
271 | show_regs(regs); | 276 | show_regs(regs); |
272 | perf_event_print_debug(); | 277 | perf_event_print_debug(); |
@@ -649,9 +654,9 @@ static void sysrq_parse_reset_sequence(struct sysrq_state *state) | |||
649 | state->reset_seq_version = sysrq_reset_seq_version; | 654 | state->reset_seq_version = sysrq_reset_seq_version; |
650 | } | 655 | } |
651 | 656 | ||
652 | static void sysrq_do_reset(unsigned long _state) | 657 | static void sysrq_do_reset(struct timer_list *t) |
653 | { | 658 | { |
654 | struct sysrq_state *state = (struct sysrq_state *) _state; | 659 | struct sysrq_state *state = from_timer(state, t, keyreset_timer); |
655 | 660 | ||
656 | state->reset_requested = true; | 661 | state->reset_requested = true; |
657 | 662 | ||
@@ -668,7 +673,7 @@ static void sysrq_handle_reset_request(struct sysrq_state *state) | |||
668 | mod_timer(&state->keyreset_timer, | 673 | mod_timer(&state->keyreset_timer, |
669 | jiffies + msecs_to_jiffies(sysrq_reset_downtime_ms)); | 674 | jiffies + msecs_to_jiffies(sysrq_reset_downtime_ms)); |
670 | else | 675 | else |
671 | sysrq_do_reset((unsigned long)state); | 676 | sysrq_do_reset(&state->keyreset_timer); |
672 | } | 677 | } |
673 | 678 | ||
674 | static void sysrq_detect_reset_sequence(struct sysrq_state *state, | 679 | static void sysrq_detect_reset_sequence(struct sysrq_state *state, |
@@ -904,8 +909,7 @@ static int sysrq_connect(struct input_handler *handler, | |||
904 | sysrq->handle.handler = handler; | 909 | sysrq->handle.handler = handler; |
905 | sysrq->handle.name = "sysrq"; | 910 | sysrq->handle.name = "sysrq"; |
906 | sysrq->handle.private = sysrq; | 911 | sysrq->handle.private = sysrq; |
907 | setup_timer(&sysrq->keyreset_timer, | 912 | timer_setup(&sysrq->keyreset_timer, sysrq_do_reset, 0); |
908 | sysrq_do_reset, (unsigned long)sysrq); | ||
909 | 913 | ||
910 | error = input_register_handle(&sysrq->handle); | 914 | error = input_register_handle(&sysrq->handle); |
911 | if (error) { | 915 | if (error) { |