serial: 8250: implement write_atomic
Implement a non-sleeping NMI-safe write_atomic() console function in order to support atomic console printing during a panic. Trasmitting data requires disabling interrupts. Since write_atomic() can be called from any context, it may be called while another CPU is executing in console code. In order to maintain the correct state of the IER register, use the global cpu_sync to synchronize all access to the IER register. This synchronization is only necessary for serial ports that are being used as consoles. The global cpu_sync is also used to synchronize between the write() and write_atomic() callbacks. write() synchronizes per character, write_atomic() synchronizes per line. Signed-off-by: John Ogness <john.ogness@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
parent
0a7cee67
Please register or sign in to comment