Neither Smatch nor Coccinelle do a good job tracking when you're in atomic context. I've wanted to add this to Smatch but even then it would be to warn that "We're holding a spinlock so we can't sleep". It's trickier to say for sure when you're not holding a lock...
regards, dan carpenter

