linux/drivers/char
Cory T. Tusar db99247ac6 tty: fix logic change introduced by wait_event_interruptible_timeout()
Commit 5a52bd4a2d introduced a subtle logic
change in tty_wait_until_sent().  The original version would only error out
of the 'do { ...  } while (timeout)' loop if signal_pending() evaluated to
true; a timeout or break due to an empty buffer would fall out of the loop
and into the tty->driver->wait_until_sent handling.  The current
implementation will error out on either a pending signal or an empty
buffer, falling through to the tty->driver->wait_until_sent handling only
on a timeout.

The ->wait_until_sent() will not be reached if the buffer empties before
timeout jiffies have elapsed.  This behavior differs from that prior to commit
5a52bd4a2d.

I turned this up while using a little serial download utility to bootstrap an
ARM-based eval board.  The util worked fine on 2.6.22.x, but consistently
failed on 2.6.23.x.  Once I'd determined that, I narrowed things down with git
bisect, and found the above difference in logic in tty_wait_until_sent() by
inspection.

This change reverts the logic flow in tty_wait_until_sent() to match that
prior to the aforementioned commit.

Signed-off-by: Cory T. Tusar <ctusar@videon-central.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Acked-by: Jiri Slaby <jirislaby@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-12-23 12:54:37 -08:00
..
agp
drm
hw_random
ip2
ipmi
mwave
pcmcia
rio
tpm
.gitignore
ChangeLog
Kconfig
Makefile
amiserial.c
apm-emulation.c
applicom.c
applicom.h
briq_panel.c
cd1865.h
consolemap.c
cp437.uni
cs5535_gpio.c
cyclades.c
defkeymap.c_shipped
defkeymap.map
digi1.h
digiFep1.h
digiPCI.h
ds1286.c
ds1302.c
ds1620.c
dsp56k.c
dtlk.c
efirtc.c
epca.c
epca.h
epcaconfig.h
esp.c
generic_nvram.c
generic_serial.c
genrtc.c
hangcheck-timer.c
hpet.c
hvc_beat.c
hvc_console.c
hvc_console.h
hvc_iseries.c
hvc_rtas.c
hvc_vio.c
hvc_xen.c
hvcs.c
hvsi.c
i8k.c
ip27-rtc.c
isicom.c
istallion.c
keyboard.c
lcd.c
lcd.h
lp.c
mbcs.c
mbcs.h
mem.c
misc.c
mmtimer.c
moxa.c
mspec.c
mxser.c
mxser.h
mxser_new.c
mxser_new.h
n_hdlc.c
n_r3964.c
n_tty.c
nsc_gpio.c
nvram.c
nwbutton.c
nwbutton.h
nwflash.c
pc8736x_gpio.c
ppdev.c
ps3flash.c
pty.c
random.c
raw.c
riscom8.c
riscom8.h
riscom8_reg.h
rocket.c
rocket.h
rocket_int.h
rtc.c
scc.h
scx200_gpio.c
selection.c
ser_a2232.c
ser_a2232.h
ser_a2232fw.ax
ser_a2232fw.h
serial167.c
snsc.c
snsc.h
snsc_event.c
sonypi.c
specialix.c
specialix_io8.h
stallion.c
sx.c
sx.h
sxboards.h
sxwindow.h
synclink.c
synclink_gt.c
synclinkmp.c
sysrq.c
tb0219.c
tlclk.c
toshiba.c
tty_audit.c
tty_io.c
tty_ioctl.c tty: fix logic change introduced by wait_event_interruptible_timeout() 2007-12-23 12:54:37 -08:00
vc_screen.c
viocons.c
viotape.c
virtio_console.c
vme_scc.c
vr41xx_giu.c
vt.c
vt_ioctl.c