3

Is it safe to call printk from an atomic context, e.g. an IRQ?

Albus Dumbledore
  • 12,368
  • 23
  • 64
  • 105

1 Answers1

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