1
0
Fork 0
alistair23-linux/drivers/input
Linus Torvalds 55db4c64ed Revert "tty: make receive_buf() return the amout of bytes received"
This reverts commit b1c43f82c5.

It was broken in so many ways, and results in random odd pty issues.

It re-introduced the buggy schedule_work() in flush_to_ldisc() that can
cause endless work-loops (see commit a5660b41af6a: "tty: fix endless
work loop when the buffer fills up").

It also used an "unsigned int" return value fo the ->receive_buf()
function, but then made multiple functions return a negative error code,
and didn't actually check for the error in the caller.

And it didn't actually work at all.  BenH bisected down odd tty behavior
to it:
  "It looks like the patch is causing some major malfunctions of the X
   server for me, possibly related to PTYs.  For example, cat'ing a
   large file in a gnome terminal hangs the kernel for -minutes- in a
   loop of what looks like flush_to_ldisc/workqueue code, (some ftrace
   data in the quoted bits further down).

   ...

   Some more data: It -looks- like what happens is that the
   flush_to_ldisc work queue entry constantly re-queues itself (because
   the PTY is full ?) and the workqueue thread will basically loop
   forver calling it without ever scheduling, thus starving the consumer
   process that could have emptied the PTY."

which is pretty much exactly the problem we fixed in a5660b41af.

Milton Miller pointed out the 'unsigned int' issue.

Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reported-by: Milton Miller <miltonm@bga.com>
Cc: Stefan Bigler <stefan.bigler@keymile.com>
Cc: Toby Gray <toby.gray@realvnc.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-06-04 06:33:24 +09:00
..
gameport Merge branch 'next' into for-linus 2011-03-18 23:38:50 -07:00
joystick Fix common misspellings 2011-03-31 11:26:23 -03:00
keyboard input: Add Qualcomm pm8xxx keypad controller driver 2011-05-26 19:45:53 +02:00
misc input: Add support for Qualcomm PMIC8XXX power key 2011-05-26 19:45:54 +02:00
mouse Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2011-05-24 11:58:49 -07:00
serio Revert "tty: make receive_buf() return the amout of bytes received" 2011-06-04 06:33:24 +09:00
tablet Input: wacom - add support for Lenovo tablet ID (0xE6) 2011-03-31 22:41:24 -07:00
touchscreen Merge branch 'next' into for-linus 2011-05-24 00:06:26 -07:00
Kconfig Input: xen-kbdfront - move to drivers/input/misc 2011-03-16 23:26:01 -07:00
Makefile Input: xen-kbdfront - move to drivers/input/misc 2011-03-16 23:26:01 -07:00
apm-power.c Input: use pr_fmt and pr_<level> 2010-11-30 23:10:26 -08:00
evbug.c Input: use pr_fmt and pr_<level> 2010-11-30 23:10:26 -08:00
evdev.c Input: remove useless synchronize_rcu() calls 2011-05-12 08:28:57 -07:00
ff-core.c Input: use pr_fmt and pr_<level> 2010-11-30 23:10:26 -08:00
ff-memless.c Input: use pr_fmt and pr_<level> 2010-11-30 23:10:26 -08:00
fixp-arith.h
input-compat.c
input-compat.h arch/tile: finish enabling support for TILE-Gx 64-bit chip 2011-05-12 15:52:12 -04:00
input-mt.c input: mt: Move tracking and pointer emulation to input-mt 2010-12-16 10:41:38 +01:00
input-polldev.c Input: input-polldev - use system-wide freezable workqueue 2011-04-27 23:22:01 -07:00
input.c Input: remove useless synchronize_rcu() calls 2011-05-12 08:28:57 -07:00
joydev.c Input: remove useless synchronize_rcu() calls 2011-05-12 08:28:57 -07:00
mousedev.c Input: remove useless synchronize_rcu() calls 2011-05-12 08:28:57 -07:00
sparse-keymap.c Input: sparse-keymap - report KEY_UNKNOWN for unknown scan codes 2011-03-28 23:34:52 -07:00