[PATCH v3 2/6] TTY: wake up processes last at hangup

From: Johan Hovold
Date: Thu Mar 07 2013 - 09:57:12 EST


Move wake up of processes on blocked-open and modem-status wait queues
to after port shutdown at hangup.

This way the woken up processes can use the ASYNC_INITIALIZED flag to
detect port shutdown.

Note that this is the order currently used by serial-core.

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

diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
index 57a061e..3de5918 100644
--- a/drivers/tty/tty_port.c
+++ b/drivers/tty/tty_port.c
@@ -231,9 +231,9 @@ void tty_port_hangup(struct tty_port *port)
}
port->tty = NULL;
spin_unlock_irqrestore(&port->lock, flags);
+ tty_port_shutdown(port);
wake_up_interruptible(&port->open_wait);
wake_up_interruptible(&port->delta_msr_wait);
- tty_port_shutdown(port);
}
EXPORT_SYMBOL(tty_port_hangup);

--
1.8.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/