tty_flip_buffer_push in interrupt context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

many of the usb serial drivers are using the code fragement below to fill
received data into the read queue of the attached tty.

read_callback:
...
tty = tty_port_tty_get(&port->port);
        if (tty != NULL && urb->actual_length > 0) {
                tty_insert_flip_string(tty, data, urb->actual_length);
                tty_flip_buffer_push(tty);
        }
        tty_kref_put(tty);
...

Typically, tty->low_latency is set to 1 in the open function. 

Now, I read in the man page of tty_flip_buffer_push that it is not to be called
from an interrupt context if tty->low_latency=1. I understand however that the
callback handler runs in an interrupt context.
 
In a test driver I wrote, tty_flip_buffer_push(tty) makes the kernal crash if
tty->low_latency=1. If I remove this line, the kernal does not crash. And I have
a second driver that does not crash if tty->low_latency=1. It uses
tty_flip_buffer_push in the read_callback handler.

Can somebody please shed some light under what circumstance tty_flip_buffer_push
can be used from a callback handler ?

Thanks
Tilman

PS Kernel version I used is 3.0.8

  

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux