Is it safe to call printk
from an atomic context, e.g. an IRQ?
Asked
Active
Viewed 1,511 times
1 Answers
9
Yes, it's explicitly allowed to use it in atomic context; the function is in fact very robust since it may also be called at panic time.
printk
will just try to lock the console to print the message; if the lock is already taken then the output is queued to a buffer but the function will never block.

Luca Tettamanti
- 10,314
- 3
- 29
- 25