]> git.baikalelectronics.ru Git - kernel.git/commit
atmel_serial: fix hang in set_termios when crtscts is enabled
authorHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
Tue, 16 Jun 2009 16:02:03 +0000 (17:02 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 16 Jun 2009 19:01:16 +0000 (12:01 -0700)
commit64e76fbcd203f15014f33564258284ffffd7d54f
treec5fd8d151469b78f5a003a891b75f3446c0f5062
parente7b6f77837c39a949d3a8fde8fc3e288d74af390
atmel_serial: fix hang in set_termios when crtscts is enabled

After enabling hardware flow control, any subsequent termios call may hang
waiting for the transmitter to drain.  This appears to be caused by a
busy-loop in set_termios() waiting for the transmitter to become empty,
which may take a very long time (or hang indefinitely) if the device at
the other end is blocking us.

A quick look through the tty and serial_core code indicates that any
necessary flushing (which is optional) has already been done at this
point, so there's no need for the driver to flush the transmitter on its
own.

Fix it by removing the busy-loop altogether.

Tested-by: Eirik Aanonsen <eaa@wprmedical.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/serial/atmel_serial.c