process: Fix nready panic and hangs when using rts/cts
authorAlan Cox <alan@linux.intel.com>
Sat, 26 Jan 2019 23:03:29 +0000 (23:03 +0000)
committerAlan Cox <alan@linux.intel.com>
Sat, 26 Jan 2019 23:03:29 +0000 (23:03 +0000)
commitdbdb80cfc5c7b520e20a476f7f4c20527e6cb1bc
tree603584bcdf98f90adceca45f24713a8baf81728a
parent50025275bf04132f57a60312997e27698f5bfee3
process: Fix nready panic and hangs when using rts/cts

Actually what happens is that spend long enough waiting to write the byte
that we hit the poll timeout. In the usual case it doesn't matter but if

1. You hit a key
2. We are idle
3. We are doing idle key polling
4. The echo is blocked for a long long time

We then try and sleep the current process, only we are in idle so there isn't
one. Idle is really like being in an interrupt.

Now arguably we should fix tty output to retry the echo write until it gets
kicked for timing offences and then give up but tht means auditing all the
ininterrupt uses and also encourages the existing bad behaviour of not running
a small tx buffer.

So if it annoys you fix your tty output code 8)
Kernel/process.c