android_kernel_xiaomi_sdm845/drivers/char
Linus Torvalds 202c4675c5 pty_write: don't do a tty_wakeup() when the buffers are full
Commit ac89a9174 ("pty: don't limit the writes to 'pty_space()' inside
'pty_write()'") removed the pty_space() checking, in order to let the
regular tty buffer code limit the buffering itself.

That was all good, but as a subtle side effect it meant that we'd be
doing a tty_wakeup() even in the case where the buffers were all filled
up, and didn't actually make any progress on the write.

Which sounds innocuous, but it interacts very badly with the ppp_async
code, which has an infinite loop in ppp_async_push() that tries to push
out data to the tty.  When we call tty_wakeup(), that loop ends up
thinking that progress was made (see the subtle interactions between
XMIT_WAKEUP and 'tty_stuffed' for details).  End result: one unhappy ppp
user.

Fixed by noticing when tty_insert_flip_string() didn't actually do
anything, and then not doing any more processing (including, very much
not calling tty_wakeup()).

Bisected-and-tested-by: Peter Volkov <pva@gentoo.org>
Cc: stable@kernel.org (2.6.31)
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-18 07:05:58 -07:00
..
agp
hw_random
ip2
ipmi
mwave
pcmcia
rio
tpm
xilinx_hwicap
.gitignore
amiserial.c
apm-emulation.c
applicom.c
applicom.h
bfin_jtag_comm.c
bfin-otp.c
briq_panel.c
bsr.c
cd1865.h
ChangeLog
consolemap.c
cp437.uni
cs5535_gpio.c
cyclades.c
defkeymap.c_shipped
defkeymap.map
digi1.h
digiFep1.h
digiPCI.h
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_irq.c
hvc_iseries.c
hvc_iucv.c
hvc_rtas.c
hvc_udbg.c
hvc_vio.c
hvc_xen.c
hvcs.c
hvsi.c
i8k.c
isicom.c
istallion.c
Kconfig
keyboard.c
lp.c
Makefile
mbcs.c
mbcs.h
mem.c
misc.c
mmtimer.c
moxa.c
moxa.h
mspec.c
mxser.c
mxser.h
n_hdlc.c
n_r3964.c
n_tty.c
nozomi.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_reg.h
riscom8.c
riscom8.h
rocket_int.h
rocket.c
rocket.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_event.c
snsc.c
snsc.h
sonypi.c
specialix_io8.h
specialix.c
stallion.c
sx.c
sx.h
sxboards.h
sxwindow.h
synclink_gt.c
synclink.c
synclinkmp.c
sysrq.c
tb0219.c
tlclk.c
toshiba.c
tty_audit.c
tty_buffer.c
tty_io.c
tty_ioctl.c
tty_ldisc.c
tty_port.c
vc_screen.c
viotape.c
virtio_console.c
vme_scc.c
vt_ioctl.c
vt.c