Thread (8 messages) 8 messages, 2 authors, 2011-08-19

Re: tty_flip_buffer() from atomic context when low_latency==1

From: Grant Edwards <hidden>
Date: 2011-08-19 20:44:41

On 2011-08-19, Alan Cox [off-list ref] wrote:
quoted
But, many drivers appear to call tty_flip_buffer_push() from an atomic
context. If that is done with tty->low_latency==1 it turns into a call
to flush_to_ldisc(), which then calls disc->ops->receive_buf(), which
must not be called from an atomic context.
It's covered under "So don't do that then".
I don't do that, and wasn't asking if I should.

My point was that most of the drivers in the linux kernels sources
_do_ appear to do that, and I don't see how they avoid problems.

For exaple, 8250.c calls tty_flip_buffer_push() from receive_chars(),
calld from serial8250_handle_port(), called from
serial8250_interrupt().

How are problems avoided when tty->low_latency is set?

Is tty->low_latency never allowed to be set for the 8250 driver?

-- 
Grant Edwards               grant.b.edwards        Yow! VICARIOUSLY experience
                                  at               some reason to LIVE!!
                              gmail.com            
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help