[lkml]   [2012]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] tty: hold lock across tty buffer finding and buffer filling
    On Thu, 15 Mar 2012 02:06:43 +0000
    "Tu, Xiaobing" <> wrote:

    > From: Xiaobing Tu <>
    > 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

    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 ?


     \ /
      Last update: 2012-03-15 11:11    [W:0.019 / U:2.796 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site