WSL2-Linux-Kernel/drivers/bluetooth
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 Bluetooth: btmrvl: support Marvell Bluetooth device SD8787 2011-04-13 12:20:05 -03:00
Makefile Bluetooth: btwilink driver 2011-02-23 14:39:10 -08:00
ath3k.c Bluetooth: Device ids for ath3k on Pegatron Lucid tablets 2011-05-11 14:50:40 -03:00
bcm203x.c
bfusb.c
bluecard_cs.c pcmcia: Convert pcmcia_device_id declarations to const 2011-05-06 07:46:22 +02:00
bpa10x.c
bt3c_cs.c pcmcia: Convert pcmcia_device_id declarations to const 2011-05-06 07:46:22 +02:00
btmrvl_debugfs.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
btmrvl_drv.h
btmrvl_main.c
btmrvl_sdio.c Bluetooth: btmrvl: support Marvell Bluetooth device SD8787 2011-04-13 12:20:05 -03:00
btmrvl_sdio.h Bluetooth: btmrvl: support Marvell Bluetooth device SD8787 2011-04-13 12:20:05 -03:00
btsdio.c
btuart_cs.c pcmcia: Convert pcmcia_device_id declarations to const 2011-05-06 07:46:22 +02:00
btusb.c Bluetooth: Device ids for ath3k on Pegatron Lucid tablets 2011-05-11 14:50:40 -03:00
btwilink.c Bluetooth: btwilink driver 2011-02-23 14:39:10 -08:00
dtl1_cs.c pcmcia: Convert pcmcia_device_id declarations to const 2011-05-06 07:46:22 +02:00
hci_ath.c Bluetooth: hci_uart: check the return value of recv() 2011-04-13 12:20:03 -03:00
hci_bcsp.c
hci_h4.c Bluetooth: Check return value of hci_recv_stream_fragment() 2011-04-13 12:20:04 -03:00
hci_ldisc.c Revert "tty: make receive_buf() return the amout of bytes received" 2011-06-04 06:33:24 +09:00
hci_ll.c Fix common misspellings 2011-03-31 11:26:23 -03:00
hci_uart.h
hci_vhci.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00