From: Peter Hurley Date: Thu, 16 Oct 2014 20:54:18 +0000 (-0400) Subject: serial: Refactor uart_flush_buffer() from uart_close() X-Git-Tag: omap-for-v3.19/fixes-rc1~86^2~167 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=479e9b94fdce7bc46f669831012fc12f56696fd7;p=pandora-kernel.git serial: Refactor uart_flush_buffer() from uart_close() In the context of the final tty & port close, flushing the tx ring buffer after the hardware has already been shutdown and the ring buffer freed is neither required nor desirable. uart_flush_buffer() performs 3 operations: 1. Resets tx ring buffer indices, but the tx ring buffer has already been freed and the indices are reset if the port is re-opened. 2. Calls uart driver's flush_buffer() method 5 in-tree uart drivers define flush_buffer() methods: amba-pl011, atmel-serial, imx, serial-tegra, timbuart These have been refactored into the shutdown() method, if required. 3. Kicks the ldisc for more writing, but this is undesirable. The file handle is being released; any waiting writer will will be kicked out by tty_release() with a warning. Further, the N_TTY ldisc may generate SIGIO for a file handle which is no longer valid. Cc: Nicolas Ferre Cc: Russell King Cc: Laxman Dewangan Signed-off-by: Peter Hurley Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed