Revert "tty: make receive_buf() return the amout of bytes received"
This reverts commit b1c43f82. 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 a5660b41: "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 a5660b41. Milton Miller pointed out the 'unsigned int' issue. Reported-by: Benjamin Herrenschmidt <firstname.lastname@example.org> Reported-by: Milton Miller <email@example.com> Cc: Stefan Bigler <firstname.lastname@example.org> Cc: Toby Gray <email@example.com> Cc: Felipe Balbi <firstname.lastname@example.org> Cc: Greg Kroah-Hartman <email@example.com> Cc: Alan Cox <firstname.lastname@example.org> Signed-off-by: Linus Torvalds <email@example.com>
Showing with 115 additions and 128 deletions