4,438
社区成员
发帖
与我相关
我的任务
分享
irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action)
{
irqreturn_t ret, retval = IRQ_NONE;
unsigned int status = 0;
printk("handle_IRQ_event--->1\n");
if (!(action->flags & IRQF_DISABLED))
{
printk("handle_IRQ_event-->local_irq_enable-->1\n");
local_irq_enable_in_hardirq(); //程序停在这里
//local_irq_enable(); //如果把上面那句换掉,程序会停在这里
printk("handle_IRQ_event--->local_irq_enable-->2\n");
}
do {
trace_irq_handler_entry(irq, action);
ret = action->handler(irq, action->dev_id);
trace_irq_handler_exit(irq, action, ret);
printk("handle_IRQ_event-->irqnum=%d\n", irq);
switch (ret) {
case IRQ_WAKE_THREAD:
/*
* Set result to handled so the spurious check
* does not trigger.
*/
ret = IRQ_HANDLED;
printk("handle_IRQ_event-->ret=IRQ_WAKE_THREAD\n");
/*
* Catch drivers which return WAKE_THREAD but
* did not set up a thread function
*/
if (unlikely(!action->thread_fn)) {
warn_no_thread(irq, action);
break;
}
/*
* Wake up the handler thread for this
* action. In case the thread crashed and was
* killed we just pretend that we handled the
* interrupt. The hardirq handler above has
* disabled the device interrupt, so no irq
* storm is lurking.
*/
if (likely(!test_bit(IRQTF_DIED,
&action->thread_flags))) {
set_bit(IRQTF_RUNTHREAD, &action->thread_flags);
printk("handle_IRQ_event-->set_bit\n");
wake_up_process(action->thread);
}
/* Fall through to add to randomness */
case IRQ_HANDLED:
status |= action->flags;
break;
default:
break;
}
retval |= ret;
action = action->next;
} while (action);
if (status & IRQF_SAMPLE_RANDOM)
add_interrupt_randomness(irq);
local_irq_disable();
return retval;
}