struct keyhandler *h;
int k;
- console_start_log_everything();
for ( k = 0; k < ARRAY_SIZE(key_table); k++ )
{
+ process_pending_softirqs_nested();
h = key_table[k];
if ( (h == NULL) || !h->diagnostic || h->irq_callback )
continue;
printk("[%c: %s]\n", k, h->desc);
(*h->u.fn)(k);
}
- console_end_log_everything();
}
static DECLARE_TASKLET(run_all_keyhandlers_tasklet,
struct keyhandler *h;
int k;
+ watchdog_disable();
+
printk("'%c' pressed -> firing all diagnostic keyhandlers\n", key);
/* Fire all the IRQ-context diangostic keyhandlers now */
- console_start_log_everything();
for ( k = 0; k < ARRAY_SIZE(key_table); k++ )
{
h = key_table[k];
printk("[%c: %s]\n", k, h->desc);
(*h->u.irq_fn)(k, regs);
}
- console_end_log_everything();
+
+ watchdog_enable();
/* Trigger the others from a tasklet in non-IRQ context */
tasklet_schedule(&run_all_keyhandlers_tasklet);
__do_softirq(1ul<<SCHEDULE_SOFTIRQ);
}
+void process_pending_softirqs_nested(void)
+{
+ ASSERT(!in_irq() && local_irq_is_enabled());
+ /*
+ * Do not enter scheduler as it can preempt the calling context,
+ * and do not run tasklets as we're running one currently.
+ */
+ __do_softirq((1ul<<SCHEDULE_SOFTIRQ) | (1ul<<TASKLET_SOFTIRQ));
+}
+
asmlinkage void do_softirq(void)
{
__do_softirq(0);
* Use this instead of do_softirq() when you do not want to be preempted.
*/
void process_pending_softirqs(void);
+/* ... and use this instead when running inside a tasklet. */
+void process_pending_softirqs_nested(void);
/*
* TASKLETS -- dynamically-allocatable tasks run in softirq context