Skip to contentSkip to conversation

TTY: fix DTR being raised on hang up

PATCH In review Johan Hovold 3 participants 7 messages Apr 12, 2013 – Apr 15, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
#1 lore raw

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
index 72d6071..8eaf1ab 100644
@@ -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
#2 lore raw

PATCH 2/4 TTY: synclink_gt: fix DTR being raised on hang up

In reply to Johan Hovold

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_gt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/synclink_gt.c +1 -1
index aa9eece..1abf946 100644
@@ -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
#3 lore raw

PATCH 3/4 TTY: synclinkmp: fix DTR being raised on hang up

In reply to Johan Hovold

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/synclinkmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/synclinkmp.c +1 -1
index 6d5780c..ff17138 100644
@@ -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
#4 lore raw

PATCH 4/4 TTY: ircomm: fix DTR being raised on hang up

In reply to Johan Hovold

Make 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.

Cc David S. Miller <[email protected]>
---
 net/irda/ircomm/ircomm_tty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/irda/ircomm/ircomm_tty.c +1 -1
index 362ba47..41ac7938 100644
@@ -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
maintainer Acked-by on v1 4/4
#5 lore raw

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_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.

Cc David S. Miller <[email protected]>
#6 lore raw
In reply to Johan Hovold
Quoted 9 lines · Johan Hovold

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 for fixing these.

Regards,
Peter Hurley