linux-sg2042/drivers/input/serio
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
..
Kconfig kconfig: rename CONFIG_EMBEDDED to CONFIG_EXPERT 2011-01-20 17:02:05 -08:00
Makefile Input: serio - add support for PS2Mult multiplexer protocol 2010-10-18 09:33:31 -07:00
altera_ps2.c altera_ps2: Add devicetree support 2011-02-15 21:39:21 -07:00
ambakmi.c ARM: amba: make probe() functions take const id tables 2011-02-23 16:24:14 +00:00
ams_delta_serio.c drivers: Final irq namespace conversion 2011-03-29 14:48:19 +02:00
at32psif.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ct82c710.c Input: ct82710c - return proper error code for ct82c710_open 2011-01-17 20:49:22 -08:00
gscps2.c parisc: Fix GSC PS/2 driver name for keyboard and mouse 2010-12-04 11:19:59 -05:00
hil_mlc.c Input: serio HIL MLC - don't deref null, don't leak and return proper error 2010-11-20 13:38:18 -08:00
hp_sdc.c Fix common misspellings 2011-03-31 11:26:23 -03:00
hp_sdc_mlc.c Input: serio HIL MLC - don't deref null, don't leak and return proper error 2010-11-20 13:38:18 -08:00
i8042-io.h powerpc: Add i8042 keyboard and mouse irq parsing 2010-07-09 11:28:33 +10:00
i8042-ip22io.h Input: make i8042_platform_init return 'real' error code 2005-09-04 01:41:38 -05:00
i8042-jazzio.h Input: make i8042_platform_init return 'real' error code 2005-09-04 01:41:38 -05:00
i8042-ppcio.h Input: i8042 - remove SPRUCE support 2010-06-04 00:44:30 -07:00
i8042-snirm.h Input: i8042 - add SNI RM support 2008-03-14 11:54:06 -04:00
i8042-sparcio.h dt/sparc: Eliminate users of of_platform_{,un}register_driver 2011-02-28 01:36:39 -07:00
i8042-unicore32io.h unicore32 io: redefine __REG(x) and re-use readl/writel funcs 2011-03-17 09:19:19 +08:00
i8042-x86ia64io.h Input: i8042 - introduce 'notimeout' blacklist for Dell Vostro V13 2011-01-08 01:38:11 -08:00
i8042.c Input: i8042 - downgrade selftest error message to dbg() 2011-03-31 00:12:40 -07:00
i8042.h unicore32 machine related files: ps2 driver 2011-03-17 09:19:15 +08:00
libps2.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
maceps2.c define global BIT macro 2007-10-19 11:53:42 -07:00
parkbd.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pcips2.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ps2mult.c Input: ps2mult - fix wrong kfree in ps2mult_connect error path 2010-11-21 22:32:09 -08:00
q40kbd.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
rpckbd.c Input: rpckbd - fix a leak of the IRQ during init failure 2011-04-02 21:47:53 -07:00
sa1111ps2.c Input: sa1111ps2 - annotate probe() and remove() methods 2009-12-11 23:46:05 -08:00
serio.c Input: serio/gameport - use 'long' system workqueue 2011-02-23 08:53:07 -08:00
serio_raw.c BKL: remove extraneous #include <smp_lock.h> 2010-11-17 08:59:32 -08:00
serport.c Revert "tty: make receive_buf() return the amout of bytes received" 2011-06-04 06:33:24 +09:00
xilinx_ps2.c Fix common misspellings 2011-03-31 11:26:23 -03:00