linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] TTY: fix DTR being raised on hang up
@ 2013-04-12  8:32 Johan Hovold
  2013-04-12  8:32 ` [PATCH 1/4] TTY: synclink: " Johan Hovold
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Johan Hovold @ 2013-04-12  8:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, Peter Hurley, David S. Miller, linux-serial,
	linux-kernel, 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,
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(-)

-- 
1.8.1.5


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] TTY: synclink: fix DTR being raised on hang up
  2013-04-12  8:32 [PATCH 0/4] TTY: fix DTR being raised on hang up Johan Hovold
@ 2013-04-12  8:32 ` Johan Hovold
  2013-04-12  8:32 ` [PATCH 2/4] TTY: synclink_gt: " Johan Hovold
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Johan Hovold @ 2013-04-12  8:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, Peter Hurley, David S. Miller, linux-serial,
	linux-kernel, 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.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
---
 drivers/tty/synclink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c
index 72d6071..8eaf1ab 100644
--- a/drivers/tty/synclink.c
+++ b/drivers/tty/synclink.c
@@ -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);
-- 
1.8.1.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] TTY: synclink_gt: fix DTR being raised on hang up
  2013-04-12  8:32 [PATCH 0/4] TTY: fix DTR being raised on hang up Johan Hovold
  2013-04-12  8:32 ` [PATCH 1/4] TTY: synclink: " Johan Hovold
@ 2013-04-12  8:32 ` Johan Hovold
  2013-04-12  8:32 ` [PATCH 3/4] TTY: synclinkmp: " Johan Hovold
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Johan Hovold @ 2013-04-12  8:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, Peter Hurley, David S. Miller, linux-serial,
	linux-kernel, 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.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
---
 drivers/tty/synclink_gt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c
index aa9eece..1abf946 100644
--- a/drivers/tty/synclink_gt.c
+++ b/drivers/tty/synclink_gt.c
@@ -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);
-- 
1.8.1.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] TTY: synclinkmp: fix DTR being raised on hang up
  2013-04-12  8:32 [PATCH 0/4] TTY: fix DTR being raised on hang up Johan Hovold
  2013-04-12  8:32 ` [PATCH 1/4] TTY: synclink: " Johan Hovold
  2013-04-12  8:32 ` [PATCH 2/4] TTY: synclink_gt: " Johan Hovold
@ 2013-04-12  8:32 ` Johan Hovold
  2013-04-12  8:32 ` [PATCH 4/4] TTY: ircomm: " Johan Hovold
  2013-04-15 15:11 ` [PATCH 0/4] TTY: " Peter Hurley
  4 siblings, 0 replies; 7+ messages in thread
From: Johan Hovold @ 2013-04-12  8:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, Peter Hurley, David S. Miller, linux-serial,
	linux-kernel, 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.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
---
 drivers/tty/synclinkmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/synclinkmp.c b/drivers/tty/synclinkmp.c
index 6d5780c..ff17138 100644
--- a/drivers/tty/synclinkmp.c
+++ b/drivers/tty/synclinkmp.c
@@ -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);
-- 
1.8.1.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] TTY: ircomm: fix DTR being raised on hang up
  2013-04-12  8:32 [PATCH 0/4] TTY: fix DTR being raised on hang up Johan Hovold
                   ` (2 preceding siblings ...)
  2013-04-12  8:32 ` [PATCH 3/4] TTY: synclinkmp: " Johan Hovold
@ 2013-04-12  8:32 ` Johan Hovold
  2013-04-12 17:23   ` David Miller
  2013-04-15 15:11 ` [PATCH 0/4] TTY: " Peter Hurley
  4 siblings, 1 reply; 7+ messages in thread
From: Johan Hovold @ 2013-04-12  8:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, Peter Hurley, David S. Miller, linux-serial,
	linux-kernel, 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 <davem@davemloft.net>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
---
 net/irda/ircomm/ircomm_tty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
index 362ba47..41ac7938 100644
--- a/net/irda/ircomm/ircomm_tty.c
+++ b/net/irda/ircomm/ircomm_tty.c
@@ -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);
-- 
1.8.1.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 4/4] TTY: ircomm: fix DTR being raised on hang up
  2013-04-12  8:32 ` [PATCH 4/4] TTY: ircomm: " Johan Hovold
@ 2013-04-12 17:23   ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2013-04-12 17:23 UTC (permalink / raw)
  To: jhovold; +Cc: gregkh, jslaby, peter, linux-serial, linux-kernel

From: Johan Hovold <jhovold@gmail.com>
Date: Fri, 12 Apr 2013 10:32:31 +0200

> 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 <davem@davemloft.net>
> Signed-off-by: Johan Hovold <jhovold@gmail.com>

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] TTY: fix DTR being raised on hang up
  2013-04-12  8:32 [PATCH 0/4] TTY: fix DTR being raised on hang up Johan Hovold
                   ` (3 preceding siblings ...)
  2013-04-12  8:32 ` [PATCH 4/4] TTY: ircomm: " Johan Hovold
@ 2013-04-15 15:11 ` Peter Hurley
  4 siblings, 0 replies; 7+ messages in thread
From: Peter Hurley @ 2013-04-15 15:11 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Greg Kroah-Hartman, Jiri Slaby, David S. Miller, linux-serial,
	linux-kernel

On Fri, 2013-04-12 at 10:32 +0200, Johan Hovold wrote:
> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-04-15 15:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-12  8:32 [PATCH 0/4] TTY: fix DTR being raised on hang up Johan Hovold
2013-04-12  8:32 ` [PATCH 1/4] TTY: synclink: " Johan Hovold
2013-04-12  8:32 ` [PATCH 2/4] TTY: synclink_gt: " Johan Hovold
2013-04-12  8:32 ` [PATCH 3/4] TTY: synclinkmp: " Johan Hovold
2013-04-12  8:32 ` [PATCH 4/4] TTY: ircomm: " Johan Hovold
2013-04-12 17:23   ` David Miller
2013-04-15 15:11 ` [PATCH 0/4] TTY: " Peter Hurley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).