2

我有一个字符设备驱动程序,它导致多核系统上的系统死锁。写调用有一个由自旋锁 (spin_lock_irqsave) 保护的临界区。ISR 也必须获得此锁才能完成其任务。如果在一个内核上调用 ISR,而写入正在另一个内核上执行临界区,则会由于看门狗定时器检测到 ISR 内核上的硬锁定而发生恐慌。写入过程永远不会返回完成执行。写进程不应该继续在它的核心上执行,释放锁以允许其 ISR 中的另一个核心运行吗?

关键部分大约需要 5us 才能完成。5 秒后发生硬锁定。

我假设我做错了什么,但不知道是什么。

感谢任何帮助!

4

1 回答 1

0

Turns out the critical section was calling wait_for_completion_timeout. Even though the timeout was zero, it still slept and didn't wake up to release the spin lock if the interrupt occurred in the blocking section. Using try_wait_for_completion in this case resolved the issue.

I would have posted source but it spans many modules and has architecture abstractions for portability between operating systems. Would have been a mess.

于 2012-11-01T23:49:33.167 回答