I have a linux kernel driver and a user app that interacts with it. The kernel driver has a deadlock in it. I came accross this feature in the linux kernel called \"lockdep\
There is not much to it – the lockdep code will simply print a description of the situation and a stack backtrace to the kernel log when it encounters a locking sequence that potentially deadlocks. You just have to watch your kernel output (via dmesg or serial line or whatever you use).
The lockdep code debugs only locks, it can not warn you about deadlocks that arise from something else.