lkml.org 
[lkml]   [2012]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tty: hold lock across tty buffer finding and buffer filling
On Thu, 15 Mar 2012 02:06:43 +0000
"Tu, Xiaobing" <xiaobing.tu@intel.com> wrote:
> From: Xiaobing Tu <xiaobing.tu@intel.com>
>
> tty_buffer_request_room is well protected, but while after it returns,
> it releases the port->lock. tty->buf.tail might be modified

This can only occur in a way that matters if you have multiple writers to
the tty buffer.

It is a design requirement of the tty layer that your input is single
threaded paths and this is true for existing drivers. There is a good
reason it is true as well - ordering of bytes is defined for serial data,
any parallel writer breaks that ordering even if you have locks in
tty_insert_flip_*.

In practice that means that the tail pointer has a single incrementer and
the reader is the ldisc processing queue.

So NAK pending a lot more explanation and an actual case where you can
show it is required.

Under what situations with what in tree driver do you see a problem ?


Alan


\
 
 \ /
  Last update: 2012-03-15 11:11    [from the cache]
©2003-2011 Jasper Spaans