From: Jiri Slaby Date: Thu, 25 Aug 2011 13:12:04 +0000 (+0200) Subject: TTY: serial, use ASYNCB_CLOSING in uart_close X-Git-Tag: v3.2-rc1~170^2~49 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=426929f8d3514d7f727b8c464d1eeeaf74b21519;p=pandora-kernel.git TTY: serial, use ASYNCB_CLOSING in uart_close We need to move port->mutex locking after wait_until_sent in uart_close (for rationale see next patches). But if we did it now, we would introduce a race between close and open. This is exactly why port->mutex is locked at the top of uart_close. To avoid the race, we add ASYNCB_CLOSING to uart_close. Like every other sane TTY driver. Thanks to tty_port_block_til_ready used in uart_open we will have this for free. Then we can move the port->mutex lock. Also note that this will make the conversion to tty_port helpers easier. They are currently handling ASYNC_CLOSING flag correctly. Signed-off-by: Jiri Slaby Acked-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed