免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 864 | 回复: 0
打印 上一主题 下一主题

2410 ADC不能唤醒的原因 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-09-14 19:41 |只看该作者 |倒序浏览
  前几天,2410wak_up函数一直有问题,睡眠了之后唤醒不成功,程序假死。终于明白了原来是interruptible_sleep_on deprecated on 2.6 kernels。
过时的原因:
> If the test is made with IRQ closed, and IRQ are then enabled after
> the test but before the call to interruptible_sleep_on, what happen
> if the handler break the procedure immediately before entering the
> interruptible_sleep_on function ?  I beleave that the interrupt
> handler, calling the wakeup function, will not wake our process,
> because is not in the waiting list. But at return from IRQ handler,
> the process will continue execution calling the sleep function, and
> nobody will wake it because the data is now already available.
This is why interruptible_sleep_on is deprecated and should not be
used anymore. The wait_event_interruptible, etc. functions avoid this
race since the condition is tested after the caller is put into the
wait queue, so if the condition is true you are guaranteed to be woken
up.
换了wait_event_interruptible()这个函数工作正常。但发现不用wake_up()函数也可以工作正常,不明白具体原因。感兴趣的分析一下,我前两篇转载的帖子。
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/93262/showart_2052358.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP