阅读:1794回复:6
求教中断方式的驱动在超线程机器上死机的问题
一个pci卡的驱动,如果使用中断方式工作,那么就会在超线程机器上死机(非蓝屏,就是静止不动了),而在非超线程机器上就没有问题。如果使用查询方式工作,就都没有问题。
请问问题可能出在什么地方?thx |
|
沙发#
发布于:2004-11-17 22:10
用核心SEMAPHORE来同步
|
|
|
板凳#
发布于:2004-11-18 18:27
多谢!
现在我觉得问题可能出在ISR或者DPC例程中,您觉得呢? 能否给出上述两个例程的简单例子? |
|
地板#
发布于:2004-11-22 23:38
1. How about SMP machine?
2. If your driver hangs in SMP machine, too. Then it must be synchronized bug in your ISR/DPC, or any share data.KeSynchronizeExecution is another choice in ISR if you want to consider a alternative. |
|
地下室#
发布于:2004-11-23 18:45
经过测试,发现在SMP机器上也有同样的问题。
我在ISR和DPC中都添加了KSpinLock,但是问题仍然没有解决。 请问为什么? |
|
5楼#
发布于:2004-11-23 22:54
除了isr和dpc之外,其它竞争的地方是否也要spinlock呢?
如果在单cpu机子上没有问题,其它地方似乎没有必要使用spinlock。..... |
|
6楼#
发布于:2004-11-25 01:38
1. You won't need to create your own spinllock, every interrupt object has a buildin spinlock. You need your own only if your isr need to handle more than 1 vector or if the driver has more than 1 ISR. This is unlikely.
2. Hang is the most difficult problem to debug, without seeing your code or see some debug output, I can't figure why it hang. I might be able to give you some advices, though. (1) Do you use cli/sti? They might be fatal in SMP machine if used improperly. (2) Add debug output and use softice/windbg to see where it hang. You might try to comment out some code to get a point your driver won't hang, then add the code back one by one to figure out the culprit. |
|