lkml.org 
[lkml]   [2017]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 6/8] serdev: ttyport: release tty lock sooner on open
Date
Release the tty lock once tty-driver open returns to make it clear that
it does not protect neither tty->termios or the serport flags.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/tty/serdev/serdev-ttyport.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
index 334bce00364f..a8ddcd2ac5ea 100644
--- a/drivers/tty/serdev/serdev-ttyport.c
+++ b/drivers/tty/serdev/serdev-ttyport.c
@@ -130,6 +130,8 @@ static int ttyport_open(struct serdev_controller *ctrl)
if (ret)
goto err_close;

+ tty_unlock(serport->tty);
+
/* Bring the UART into a known 8 bits no parity hw fc state */
ktermios = tty->termios;
ktermios.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP |
@@ -143,7 +145,6 @@ static int ttyport_open(struct serdev_controller *ctrl)

set_bit(SERPORT_ACTIVE, &serport->flags);

- tty_unlock(serport->tty);
return 0;

err_close:
--
2.15.0
\
 
 \ /
  Last update: 2017-11-03 15:35    [W:0.204 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site