Re: [RFC PATCH v1 20/25] serial: 8250: implement write_atomic

2019-03-08 Thread Petr Mladek
On Fri 2019-03-08 05:05:12, John Ogness wrote: > On 2019-02-27, Petr Mladek wrote: > Implement a non-sleeping NMI-safe write_atomic console function in > order to support emergency printk messages. > >>> > >>> OK, it would be safe when prb_lock() is the only lock taken > >>> in the NMI

Re: [RFC PATCH v1 20/25] serial: 8250: implement write_atomic

2019-03-07 Thread John Ogness
On 2019-03-08, John Ogness wrote: > If the ringbuffer was fully lockless, we should be able to have > per-console CPU-reentrant spin locks as long as the ordering is > preserved, which I expect shouldn't be a problem. If any NMI context > needed a spin lock for its own purposes, it would need to

Re: [RFC PATCH v1 20/25] serial: 8250: implement write_atomic

2019-03-07 Thread John Ogness
On 2019-02-27, Petr Mladek wrote: Implement a non-sleeping NMI-safe write_atomic console function in order to support emergency printk messages. >>> >>> OK, it would be safe when prb_lock() is the only lock taken >>> in the NMI handler. >> >> Which is the case. As I wrote to you

Re: [RFC PATCH v1 20/25] serial: 8250: implement write_atomic

2019-02-27 Thread Petr Mladek
On Wed 2019-02-27 11:32:05, John Ogness wrote: > On 2019-02-27, Petr Mladek wrote: > >> Implement a non-sleeping NMI-safe write_atomic console function in > >> order to support emergency printk messages. > > > > It uses console_atomic_lock() added in 18th patch. That one uses > > prb_lock() added

Re: [RFC PATCH v1 20/25] serial: 8250: implement write_atomic

2019-02-27 Thread John Ogness
On 2019-02-27, Petr Mladek wrote: >> Implement a non-sleeping NMI-safe write_atomic console function in >> order to support emergency printk messages. > > It uses console_atomic_lock() added in 18th patch. That one uses > prb_lock() added by 2nd patch. > > Now, prb_lock() allows recursion on the

Re: [RFC PATCH v1 20/25] serial: 8250: implement write_atomic

2019-02-27 Thread Petr Mladek
On Tue 2019-02-12 15:29:58, John Ogness wrote: > Implement a non-sleeping NMI-safe write_atomic console function in > order to support emergency printk messages. It uses console_atomic_lock() added in 18th patch. That one uses prb_lock() added by 2nd patch. Now, prb_lock() allows recursion on

[RFC PATCH v1 20/25] serial: 8250: implement write_atomic

2019-02-12 Thread John Ogness
Implement a non-sleeping NMI-safe write_atomic console function in order to support emergency printk messages. Since interrupts need to be disabled during transmit, all usage of the IER register was wrapped with access functions that use the console_atomic_lock function to synchronize register