mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
Revert "tty: make receive_buf() return the amout of bytes received"
This reverts commitb1c43f82c5. 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 commita5660b41af: "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 ina5660b41af. Milton Miller pointed out the 'unsigned int' issue. Reported-by: Benjamin Herrenschmidt <[email protected]> Reported-by: Milton Miller <[email protected]> Cc: Stefan Bigler <[email protected]> Cc: Toby Gray <[email protected]> Cc: Felipe Balbi <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Alan Cox <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
1fa7b6a29c
commit
55db4c64ed
20 changed files with 115 additions and 128 deletions
|
|
@ -674,7 +674,7 @@ gigaset_tty_ioctl(struct tty_struct *tty, struct file *file,
|
|||
* cflags buffer containing error flags for received characters (ignored)
|
||||
* count number of received characters
|
||||
*/
|
||||
static unsigned int
|
||||
static void
|
||||
gigaset_tty_receive(struct tty_struct *tty, const unsigned char *buf,
|
||||
char *cflags, int count)
|
||||
{
|
||||
|
|
@ -683,12 +683,12 @@ gigaset_tty_receive(struct tty_struct *tty, const unsigned char *buf,
|
|||
struct inbuf_t *inbuf;
|
||||
|
||||
if (!cs)
|
||||
return -ENODEV;
|
||||
return;
|
||||
inbuf = cs->inbuf;
|
||||
if (!inbuf) {
|
||||
dev_err(cs->dev, "%s: no inbuf\n", __func__);
|
||||
cs_put(cs);
|
||||
return -EINVAL;
|
||||
return;
|
||||
}
|
||||
|
||||
tail = inbuf->tail;
|
||||
|
|
@ -725,8 +725,6 @@ gigaset_tty_receive(struct tty_struct *tty, const unsigned char *buf,
|
|||
gig_dbg(DEBUG_INTR, "%s-->BH", __func__);
|
||||
gigaset_schedule_event(cs);
|
||||
cs_put(cs);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue