I am trying to debug a device driver which apparently causes other task to hang. It is deterministic that which task or at what time it will hang.
Basically I got some error message from kernel saying that "task has been blocked for more than 120 seconds", along with some stack trace. The hung task vary from sendmail to mkfs to pdflush(a kernel thread". And the topmost function in the stack trace vary from "getnstimeofday" to "bio_submit" to "mark_locks_held".
I am having a hard time debugging this as it's very hard to locate the problem. The stack trace provided by the kernel is not very helpful neither. According to those stack traces, some of those hung process are not even trying to grab a lock (like in the getnstimeofday function), and I have no idea why they hang.
So I am wondering if anyone have some idea on how to debug such a problem. Would kgdb be useful here, maybe by giving me exactly at what point the process hangs, and what kind of lock it is waiting for?
Any suggestions are appreciated.