lkml.org 
[lkml]   [2014]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH -next 09/10] serial: core: Remove extra locking in uart_write()
    Date
    uart_start() only claims the port->lock to call __uart_start(),
    which does the actual processing. Eliminate the extra acquire/release
    in uart_write(); call __uart_start() directly with port->lock already
    held.

    Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
    ---
    drivers/tty/serial/serial_core.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
    index e04ae58..6a3571e 100644
    --- a/drivers/tty/serial/serial_core.c
    +++ b/drivers/tty/serial/serial_core.c
    @@ -537,9 +537,10 @@ static int uart_write(struct tty_struct *tty,
    count -= c;
    ret += c;
    }
    +
    + __uart_start(tty);
    spin_unlock_irqrestore(&port->lock, flags);

    - uart_start(tty);
    return ret;
    }

    --
    2.1.1


    \
     
     \ /
      Last update: 2014-10-16 23:41    [W:3.129 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site