usb驱动 使中断服务程序停止

leiyun121 2010-11-01 04:34:57
安装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--->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;
}
...全文
66 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
leiyun121 2010-11-02
  • 打赏
  • 举报
回复
问题发现了,使用了两个enabel_irq().所以不动了!
asmlearn 2010-11-02
  • 打赏
  • 举报
回复
具体停在哪里,是死循环吗

4,438

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧