I have an interrupt handler which schedules a tasklet as follows (pseudo code) -
struct tasklet_struct mytasklet;
void my_tasklet_function(unsigned long arg1) {
...
pr_alert("Inside tasklet function\n");
...
}
int my_probe() {
....
....
tasklet_init(&mytasklet, my_tasklet_function, arg1);
....
/* Register interrupt handler my_irq_handler*/
....
}
irqreturn_t my_irq_handler(int irq, void *data) {
...
status = read_reg(base_addr, intr_status_reg_offset)
write_reg(base_addr, intr_status_reg_offset, status);
if (status & INTR_MASK_1) {
....
pr_alert("intr 1 came\n");
}
...
...
pr_alert("Schedule tasklet\n");
tasklet_schedule(&mytasklet);
pr_alert("Exit irq\n");
return IRQ_HANDLED;
}
It is observed that the kernel hangs after the following prints
intr 1 came
Schedule tasklet
The "Exit irq" print never shows up. The prints in the tasklet function are not printed.
What can be the reason for this tasklet not getting scheduled?
What can possibly cause the kernel to hang?