当前位置: 技术问答>linux和unix
usb驱动 使中断服务程序停止
来源: 互联网 发布时间:2016-10-12
本文导语: 安装usb的host驱动时,程序停在handle_IRQ_event中。 请大虾帮忙看下,真的是找不到原因: irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action) { irqreturn_t ret, retval = IRQ_NONE; unsigned int status = 0; printk("handle_IR...
安装usb的host驱动时,程序停在handle_IRQ_event中。
请大虾帮忙看下,真的是找不到原因:
请大虾帮忙看下,真的是找不到原因:
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--->1n");
if (!(action->flags & IRQF_DISABLED))
{
printk("handle_IRQ_event-->local_irq_enable-->1n");
local_irq_enable_in_hardirq(); //程序停在这里
//local_irq_enable(); //如果把上面那句换掉,程序会停在这里
printk("handle_IRQ_event--->local_irq_enable-->2n");
}
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=%dn", 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_THREADn");
/*
* 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_bitn");
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;
}
|
具体停在哪里,是死循环吗