Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

TTY: wake up processes last at hangup

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@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Johan Hovold and committed by
Greg Kroah-Hartman
31ca020b 8bde9658

+1 -1
+1 -1
drivers/tty/tty_port.c
··· 231 231 } 232 232 port->tty = NULL; 233 233 spin_unlock_irqrestore(&port->lock, flags); 234 + tty_port_shutdown(port); 234 235 wake_up_interruptible(&port->open_wait); 235 236 wake_up_interruptible(&port->delta_msr_wait); 236 - tty_port_shutdown(port); 237 237 } 238 238 EXPORT_SYMBOL(tty_port_hangup); 239 239