TTY: fix DTR being raised on hang up
Subsystems (2)
cover TTY: fix DTR being raised on hang up
These patches fix four custom block_til_ready implementations which could raise DTR after first having dropped it at hangup.
This was fixed in the tty-port implementation by commit e584a02cf ("TTY:
fix DTR being raised on hang up") in tty-next.
Note that the crisv10-driver still suffers from this behaviour but is broken in other ways as it, for example, does not honour CBAUD or raise DTR at non-blocking open.
Thanks,
Johan
Johan Hovold (4):
TTY: synclink: fix DTR being raised on hang up
TTY: synclink_gt: fix DTR being raised on hang up
TTY: synclinkmp: fix DTR being raised on hang up
TTY: ircomm: fix DTR being raised on hang up
drivers/tty/synclink.c | 2 +- drivers/tty/synclink_gt.c | 2 +- drivers/tty/synclinkmp.c | 2 +- net/irda/ircomm/ircomm_tty.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
1.8.1.5
PATCH 1/4 TTY: synclink: fix DTR being raised on hang up
Make sure to check ASYNC_INITIALISED before raising DTR when waking up from blocked open in block_til_ready.
Currently DTR could get raised at hang up as a blocked process would raise DTR unconditionally before checking for hang up and returning.
--- drivers/tty/synclink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/synclink.c +1 -1
@@ -3308,7 +3308,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp, port->blocked_open++;while (1 ) { -if (tty->termios.c_cflag &CBAUD ) +if (C_BAUD (tty) &&test_bit (ASYNCB_INITIALIZED , &port->flags))tty_port_raise_dtr_rts (port);set_current_state (TASK_INTERRUPTIBLE );
Signature · 1 line
1.8.1.5
PATCH 2/4 TTY: synclink_gt: fix DTR being raised on hang up
In reply to Johan HovoldMake sure to check ASYNC_INITIALISED before raising DTR when waking up from blocked open in block_til_ready.
Currently DTR could get raised at hang up as a blocked process would raise DTR unconditionally before checking for hang up and returning.
--- drivers/tty/synclink_gt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/synclink_gt.c +1 -1
@@ -3308,7 +3308,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, port->blocked_open++;while (1 ) { -if ((tty->termios.c_cflag &CBAUD )) +if (C_BAUD (tty) &&test_bit (ASYNCB_INITIALIZED , &port->flags))tty_port_raise_dtr_rts (port);set_current_state (TASK_INTERRUPTIBLE );
Signature · 1 line
1.8.1.5
PATCH 3/4 TTY: synclinkmp: fix DTR being raised on hang up
In reply to Johan HovoldMake sure to check ASYNC_INITIALISED before raising DTR when waking up from blocked open in block_til_ready.
Currently DTR could get raised at hang up as a blocked process would raise DTR unconditionally before checking for hang up and returning.
--- drivers/tty/synclinkmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/synclinkmp.c +1 -1
@@ -3329,7 +3329,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, port->blocked_open++;while (1 ) { -if (tty->termios.c_cflag &CBAUD ) +if (C_BAUD (tty) &&test_bit (ASYNCB_INITIALIZED , &port->flags))tty_port_raise_dtr_rts (port);set_current_state (TASK_INTERRUPTIBLE );
Signature · 1 line
1.8.1.5
PATCH 4/4 TTY: ircomm: fix DTR being raised on hang up
In reply to Johan HovoldMake sure to check ASYNC_INITIALISED before raising DTR when waking up from blocked open in ircomm_tty_block_til_ready.
Currently DTR could get raised at hang up as a blocked process would raise DTR unconditionally before checking for hang up and returning.
--- net/irda/ircomm/ircomm_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/irda/ircomm/ircomm_tty.c +1 -1
@@ -328,7 +328,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,spin_unlock_irqrestore (&port->lock, flags);while (1 ) { -if (tty->termios.c_cflag &CBAUD ) +if (C_BAUD (tty) &&test_bit (ASYNCB_INITIALIZED , &port->flags))tty_port_raise_dtr_rts (port);set_current_state (TASK_INTERRUPTIBLE );
Signature · 1 line
1.8.1.5
Re: [PATCH 4/4] TTY: ircomm: fix DTR being raised on hang up
From: Johan Hovold <[email protected]>
Date: Fri, 12 Apr 2013 10:32:31 +0200
Quoted 8 lines
Make sure to check
ASYNC_INITIALISEDbefore raising DTR when waking up from blocked open inircomm_tty_block_til_ready.Currently DTR could get raised at hang up as a blocked process would raise DTR unconditionally before checking for hang up and returning.
Cc David S. Miller <[email protected]>Signed-off-by Johan Hovold <[email protected]>
Quoted 9 lines · Johan Hovold
These patches fix four custom
block_til_readyimplementations which could raise DTR after first having dropped it at hangup.This was fixed in the tty-port implementation by commit
e584a02cf("TTY:
fix DTR being raised on hang up") in tty-next.Note that the crisv10-driver still suffers from this behaviour but is broken in other ways as it, for example, does not honour CBAUD or raise DTR at non-blocking open.
Thanks for fixing these.
Regards,
Peter Hurley